17 #include <itksys/SystemTools.hxx> 22 this->SetNumberOfRequiredOutputs(1);
23 this->SetNthOutput(0, output.GetPointer());
25 this->SetNumberOfRequiredInputs(1);
59 this->ProcessObject::SetNthInput(0, const_cast<NavigationData*>(nd));
67 this->ProcessObject::SetNthInput(idx, const_cast<NavigationData*>(nd));
74 if (this->GetNumberOfInputs() < 1)
76 return static_cast<const NavigationData*
>(this->ProcessObject::GetInput(0));
82 if (this->GetNumberOfInputs() < 1)
84 return static_cast<const NavigationData*
>(this->ProcessObject::GetInput(idx));
93 this->SetNumberOfIndexedOutputs(this->GetNumberOfIndexedInputs());
96 this->SetNumberOfIndexedOutputs(this->GetNumberOfIndexedInputs());
99 this->SetNumberOfIndexedOutputs(1);
105 for (
unsigned int idx = 0; idx < this->GetNumberOfIndexedOutputs(); ++idx)
109 DataObjectPointer newOutput = this->
MakeOutput(idx);
110 this->SetNthOutput(idx, newOutput);
120 for (
unsigned int i = 0; i < this->GetNumberOfIndexedOutputs() ; ++i)
142 for (
unsigned int i = 0; i < this->GetNumberOfIndexedOutputs() ; ++i)
149 std::vector<unsigned int> counterVec(this->GetNumberOfIndexedOutputs(),0);
152 std::vector<mitk::NavigationData::TimeStampType> vectorOldTime(this->GetNumberOfIndexedOutputs());
157 bool numberForMean_is_reached =
false;
158 while (!numberForMean_is_reached)
160 for (
unsigned int i = 0; i < this->GetNumberOfIndexedOutputs() ; ++i)
167 if (counterVec[i] == 0)
179 this->ProcessObject::GetInput(i)->Update();
182 if (vectorOldTime[i]<newTime)
188 vec.SetVnlVector(pos.GetVnlVector());
191 output->
SetPoint(newPointId, oPoint);
195 vectorOldTime[i] = newTime;
200 numberForMean_is_reached =
true;
201 for (
unsigned int i = 0; i < this->GetNumberOfIndexedOutputs() ; ++i)
204 numberForMean_is_reached =
false;
210 for (
unsigned int i = 0; i < this->GetNumberOfIndexedOutputs() ; ++i)
214 for (
unsigned int index = 0; index < oPoint.Size(); index++)
215 oPoint[index] = oPoint[index] / counterVec[i];
216 output->
SetPoint(newPointId, oPoint);
217 MBI_INFO <<
"For output # " << i <<
", " << counterVec[i] <<
" tracked positions used for averaging";
225 for (
unsigned int index = 0; index < this->GetNumberOfIndexedInputs(); index++)
NavigationDataToPointSetFilter()
empty implementation to prevent calling of the superclass method that would try to copy information f...
itk::DataObject::Pointer MakeOutput(DataObjectPointerArraySizeType idx) override
OperationMode
There are two different operation modes.
virtual void GenerateDataMode3D()
Generates the output for Mode3D.
Constants for most interaction classes, due to the generic StateMachines.
virtual PositionType GetPosition() const
returns position of the NavigationData object
DataType::PointIdentifier PointIdentifier
double TimeStampType
type that holds the time at which the data was recorded in milliseconds
#define MBI_INFO
Macros for different message levels. Creates an instance of class PseudoStream with the corresponding...
virtual void GenerateDataMode4D()
Generates the output for Mode4D.
virtual int GetSize(unsigned int t=0) const
returns the current size of the point-list
virtual void CreateOutputsForAllInputs()
create output objects according to OperationMode for all inputs
virtual TimeStampType GetIGTTimeStamp() const
gets the IGT timestamp of the NavigationData object in milliseconds Please note, that there is also t...
unsigned int m_RingBufferSize
Stores the ringbuffer size.
virtual void SetOperationMode(OperationMode mode)
Sets the mode of this filter.
Data structure which stores a set of points. Superclass of mitk::Mesh.
void GenerateData() override
filter execute method
void InsertPoint(PointIdentifier id, PointType point, int t=0)
Set the given point in world coordinate system into the itkPointSet.
~NavigationDataToPointSetFilter() override
void SetPoint(PointIdentifier id, PointType point, int t=0)
Set the given point in world coordinate system into the itkPointSet.
const mitk::NavigationData * GetInput()
Returns the input of this filter.
OperationMode m_OperationMode
Stores the mode. See enum OperationMode.
unsigned int m_NumberForMean
Number of Navigation Data, which should be averaged.
virtual void GenerateDataMode3DMean()
Generates the output for Mode3DMean.
PointType GetPoint(PointIdentifier id, int t=0) const
Get the point with ID id in world coordinates.
virtual bool IsDataValid() const
returns true if the object contains valid data
virtual void SetInput(const mitk::NavigationData *NavigationData)
Sets one input NavigationData.
unsigned int m_CurrentTimeStep
Indicates the current timestamp.