31 DataObjectPointerArraySizeType numberOfInputs = this->GetNumberOfInputs();
33 if ( numberOfInputs == 0 )
return;
35 this->CreateOutputsForAllInputs();
38 if ( m_LastValuesList.size() != numberOfInputs )
40 this->InitializeLastValuesList();
44 for (
unsigned int i = 0; i < numberOfInputs; ++i )
46 this->AddValue(i,this->GetInput(i)->GetPosition());
50 for (
unsigned int i = 0; i < numberOfInputs; ++i)
68 m_LastValuesList = std::map< int, std::map< int , mitk::Point3D> >();
70 for (
unsigned int i = 0; i < this->GetNumberOfOutputs(); ++i )
72 std::map<int,mitk::Point3D> currentList;
73 for (
int j = 0; j < m_NumerOfValues; ++j )
77 currentList.insert(std::pair<int, mitk::Point3D>(j, emptyPoint));
79 m_LastValuesList.insert(std::pair<
int, std::map<int,mitk::Point3D> > (i,currentList));
85 for (
int i = 1; i < m_NumerOfValues; ++i)
87 m_LastValuesList[outputID][i-1] = m_LastValuesList[outputID][i];
90 m_LastValuesList[outputID][m_NumerOfValues-1] = value;
97 for (
int i=0; i<m_NumerOfValues; i++)
99 mean[0] += m_LastValuesList[outputID][i][0];
100 mean[1] += m_LastValuesList[outputID][i][1];
101 mean[2] += m_LastValuesList[outputID][i][2];
103 mean[0] /= m_NumerOfValues;
104 mean[1] /= m_NumerOfValues;
105 mean[2] /= m_NumerOfValues;
mitk::Point3D GetMean(int outputID)
void AddValue(int outputID, mitk::Point3D value)
virtual ~NavigationDataSmoothingFilter()
NavigationDataToNavigationDataFilter is the base class of all filters that receive NavigationDatas as...
NavigationDataSmoothingFilter()
DataCollection - Class to facilitate loading/accessing structured data.
virtual void SetDataValid(bool _arg)
sets the dataValid flag of the NavigationData object indicating if the object contains valid data ...
virtual void GenerateData() override
void InitializeLastValuesList()
virtual bool IsDataValid() const
returns true if the object contains valid data
virtual void SetPosition(PositionType _arg)
sets the position of the NavigationData object
virtual void Graft(const DataObject *data) override
Graft the data and information from one NavigationData to another.