90 switch (m_OperationMode)
93 this->SetNumberOfIndexedOutputs(this->GetNumberOfIndexedInputs());
96 this->SetNumberOfIndexedOutputs(this->GetNumberOfIndexedInputs());
99 this->SetNumberOfIndexedOutputs(1);
105 for (
unsigned int idx = 0; idx < this->GetNumberOfIndexedOutputs(); ++idx)
107 if (this->GetOutput(idx) ==
nullptr)
109 DataObjectPointer newOutput = this->MakeOutput(idx);
110 this->SetNthOutput(idx, newOutput);
142 for (
unsigned int i = 0; i < this->GetNumberOfIndexedOutputs() ; ++i)
144 assert(this->GetOutput(i));
145 assert(this->GetInput(i));
149 std::vector<unsigned int> counterVec(this->GetNumberOfIndexedOutputs(),0);
152 std::vector<mitk::NavigationData::TimeStampType> vectorOldTime(this->GetNumberOfIndexedOutputs());
155 mitk::PointSet::PointIdentifier newPointId = this->GetOutput()->GetSize();
157 bool numberForMean_is_reached =
false;
158 while (!numberForMean_is_reached)
160 for (
unsigned int i = 0; i < this->GetNumberOfIndexedOutputs() ; ++i)
162 mitk::PointSet* output = this->GetOutput(i);
166 mitk::PointSet::PointType pos;
167 if (counterVec[i] == 0)
169 vectorOldTime[i] = input->GetIGTTimeStamp();
172 pos = input->GetPosition();
173 output->InsertPoint(newPointId, pos);
179 this->ProcessObject::GetInput(i)->Update();
180 input = this->GetInput(i);
182 if (vectorOldTime[i]<newTime)
184 pos = input->GetPosition();
187 mitk::Vector3D vec(0.0);
188 vec.SetVnlVector(pos.GetVnlVector().as_ref());
189 mitk::PointSet::PointType oPoint = output->GetPoint(newPointId);
191 output->SetPoint(newPointId, oPoint);
195 vectorOldTime[i] = newTime;
200 numberForMean_is_reached =
true;
201 for (
unsigned int i = 0; i < this->GetNumberOfIndexedOutputs() ; ++i)
203 if (counterVec[i]<m_NumberForMean)
204 numberForMean_is_reached =
false;
210 for (
unsigned int i = 0; i < this->GetNumberOfIndexedOutputs() ; ++i)
212 mitk::PointSet* output = this->GetOutput(i);
213 mitk::PointSet::PointType oPoint = output->GetPoint(newPointId);
214 for (
unsigned int index = 0; index < oPoint.Size(); index++)
215 oPoint[index] = oPoint[index] / counterVec[i];
216 output->SetPoint(newPointId, oPoint);
217 MITK_INFO <<
"For output # " << i <<
", " << counterVec[i] <<
" tracked positions used for averaging";