27 DataObjectPointerArraySizeType numberOfInputs = this->GetNumberOfInputs();
29 if ( numberOfInputs == 0 )
return;
31 this->CreateOutputsForAllInputs();
34 if ( m_LastValuesList.size() != numberOfInputs )
36 this->InitializeLastValuesList();
40 for (
unsigned int i = 0; i < numberOfInputs; ++i )
42 this->AddValue(i,this->GetInput(i)->GetPosition());
46 for (
unsigned int i = 0; i < numberOfInputs; ++i)
56 output->SetPosition(GetMean(i));
64 m_LastValuesList = std::map< int, std::map< int , mitk::Point3D> >();
66 for (
unsigned int i = 0; i < this->GetNumberOfOutputs(); ++i )
68 std::map<int,mitk::Point3D> currentList;
69 for (
int j = 0; j < m_NumerOfValues; ++j )
71 mitk::Point3D emptyPoint;
73 currentList.insert(std::pair<int, mitk::Point3D>(j, emptyPoint));
75 m_LastValuesList.insert(std::pair<
int, std::map<int,mitk::Point3D> > (i,currentList));
93 for (
int i=0; i<m_NumerOfValues; i++)
95 mean[0] += m_LastValuesList[outputID][i][0];
96 mean[1] += m_LastValuesList[outputID][i][1];
97 mean[2] += m_LastValuesList[outputID][i][2];
99 mean[0] /= m_NumerOfValues;
100 mean[1] /= m_NumerOfValues;
101 mean[2] /= m_NumerOfValues;