diff --git a/Core/Code/DataManagement/itkVtkAbstractTransform.txx b/Core/Code/DataManagement/itkVtkAbstractTransform.txx index fa7f1982fa..66aaba9d27 100644 --- a/Core/Code/DataManagement/itkVtkAbstractTransform.txx +++ b/Core/Code/DataManagement/itkVtkAbstractTransform.txx @@ -1,250 +1,250 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #include "itkVtkAbstractTransform.h" #include #include namespace itk { template itk::VtkAbstractTransform::VtkAbstractTransform() : m_VtkAbstractTransform(NULL), m_InverseVtkAbstractTransform(NULL), m_LastVtkAbstractTransformTimeStamp(0) { } template itk::VtkAbstractTransform::~VtkAbstractTransform() { if(m_VtkAbstractTransform!=NULL) m_VtkAbstractTransform->UnRegister(NULL); } template vtkAbstractTransform* itk::VtkAbstractTransform::GetVtkAbstractTransform() const { return m_VtkAbstractTransform; } template vtkAbstractTransform* itk::VtkAbstractTransform::GetInverseVtkAbstractTransform() const { return m_InverseVtkAbstractTransform; } template void itk::VtkAbstractTransform::SetVtkAbstractTransform(vtkAbstractTransform* aVtkAbstractTransform) { if(m_VtkAbstractTransform==aVtkAbstractTransform) return; if(m_VtkAbstractTransform!=NULL) m_VtkAbstractTransform->UnRegister(NULL); m_VtkAbstractTransform=aVtkAbstractTransform; if(m_VtkAbstractTransform!=NULL) { m_VtkAbstractTransform->Register(NULL); m_InverseVtkAbstractTransform=m_VtkAbstractTransform->GetInverse(); // memory managed by m_VtkAbstractTransform } m_LastVtkAbstractTransformTimeStamp = m_VtkAbstractTransform->GetMTime(); this->Modified(); } // Transform a point template typename itk::VtkAbstractTransform::OutputPointType itk::VtkAbstractTransform:: TransformPoint(const InputPointType &point) const { assert(m_VtkAbstractTransform!=NULL); OutputPointType outputpoint; vnl_vector vnl_vec; - ScalarType vtkpt[3]; + mitk::ScalarType vtkpt[3]; mitk::itk2vtk(point, vtkpt); m_VtkAbstractTransform->TransformPoint(vtkpt, vtkpt); mitk::vtk2itk(vtkpt, outputpoint); return outputpoint; } // Transform a vector template typename itk::VtkAbstractTransform::OutputVectorType itk::VtkAbstractTransform:: TransformVector(const InputVectorType &vect) const { assert(m_VtkAbstractTransform!=NULL); OutputVectorType outputvector; vnl_vector vnl_vec; - ScalarType vtkpt[3]={0,0,0}; - ScalarType vtkvec[3]; - mitk::vnl2vtk(vect.GetVnlVector(), vtkvec); + mitk::ScalarType vtkpt[3]={0,0,0}; + mitk::ScalarType vtkvec[3]; + mitk::vnl2vtk(vect.GetVnlVector(), vtkvec); m_VtkAbstractTransform->TransformVectorAtPoint(vtkpt, vtkvec, vtkvec); mitk::vtk2itk(vtkvec, outputvector); return outputvector; } // Transform a vnl_vector_fixed template typename itk::VtkAbstractTransform::OutputVnlVectorType itk::VtkAbstractTransform:: TransformVector(const InputVnlVectorType &vect) const { assert(m_VtkAbstractTransform!=NULL); OutputVnlVectorType outputvector; - ScalarType vtkpt[3]={0,0,0}; - ScalarType vtkvec[3]; - mitk::vnl2vtk(vect, vtkvec); + mitk::ScalarType vtkpt[3]={0,0,0}; + mitk::ScalarType vtkvec[3]; + mitk::vnl2vtk(vect, vtkvec); m_VtkAbstractTransform->TransformVectorAtPoint(vtkpt, vtkvec, vtkvec); mitk::vtk2itk(vtkvec, outputvector); return outputvector; } // Transform a CovariantVector template typename itk::VtkAbstractTransform::OutputCovariantVectorType itk::VtkAbstractTransform:: TransformCovariantVector(const InputCovariantVectorType &/*vec*/) const { itkExceptionMacro( << "implement before using!" ); OutputCovariantVectorType result; // Converted vector // for (unsigned int i = 0; i < NDimensions; i++) // { -// result[i] = NumericTraits::Zero; +// result[i] = NumericTraits::Zero; // for (unsigned int j = 0; j < NDimensions; j++) // { // result[i] += m_Inverse[j][i]*vec[j]; // Inverse transposed // } // } return result; } // Back transform a point template typename VtkAbstractTransform::InputPointType itk::VtkAbstractTransform:: BackTransform(const OutputPointType &point) const { assert(m_VtkAbstractTransform!=NULL); OutputPointType outputpoint; - ScalarType vtkpt[3]; + mitk::ScalarType vtkpt[3]; mitk::itk2vtk(point, vtkpt); m_InverseVtkAbstractTransform->TransformPoint(vtkpt, vtkpt); mitk::vtk2itk(vtkpt, outputpoint); return outputpoint; } // Back transform a vector template typename VtkAbstractTransform::InputVectorType itk::VtkAbstractTransform:: BackTransform(const OutputVectorType &vect ) const { assert(m_VtkAbstractTransform!=NULL); OutputVectorType outputvector; - ScalarType vtkpt[3]={0,0,0}; - ScalarType vtkvec[3]; + mitk::ScalarType vtkpt[3]={0,0,0}; + mitk::ScalarType vtkvec[3]; mitk::itk2vtk(vect, vtkvec); m_InverseVtkAbstractTransform->TransformVectorAtPoint(vtkpt, vtkvec, vtkvec); mitk::vtk2itk(vtkvec, outputvector); return outputvector; } // Back transform a vnl_vector template typename VtkAbstractTransform::InputVnlVectorType itk::VtkAbstractTransform:: BackTransform(const OutputVnlVectorType &vect ) const { assert(m_InverseVtkAbstractTransform!=NULL); OutputVnlVectorType outputvector; - ScalarType vtkpt[3]={0,0,0}; - ScalarType vtkvec[3]; + mitk::ScalarType vtkpt[3]={0,0,0}; + mitk::ScalarType vtkvec[3]; mitk::itk2vtk(vect, vtkvec); m_InverseVtkAbstractTransform->TransformVectorAtPoint(vtkpt, vtkvec, vtkvec); mitk::vtk2itk(vtkvec, outputvector); return outputvector; } // Back Transform a CovariantVector template typename VtkAbstractTransform::InputCovariantVectorType itk::VtkAbstractTransform:: BackTransform(const OutputCovariantVectorType &vec) const { itkExceptionMacro( << "implement before using!" ); // for (unsigned int i = 0; i < NDimensions; i++) // { -// result[i] = NumericTraits::Zero; +// result[i] = NumericTraits::Zero; // for (unsigned int j = 0; j < NDimensions; j++) // { // result[i] += m_Matrix[j][i]*vec[j]; // Direct matrix transposed // } // } return vec; } template unsigned long itk::VtkAbstractTransform::GetMTime() const { if((m_VtkAbstractTransform != NULL) && (m_LastVtkAbstractTransformTimeStamp < m_VtkAbstractTransform->GetMTime())) { m_LastVtkAbstractTransformTimeStamp=m_VtkAbstractTransform->GetMTime(); this->Modified(); } return Superclass::GetMTime(); } template void itk::VtkAbstractTransform::SetParameters(const ParametersType&) { // TODO } template void itk::VtkAbstractTransform::SetFixedParameters(const ParametersType&) { // TODO } template void itk::VtkAbstractTransform::ComputeJacobianWithRespectToParameters(const InputPointType&, JacobianType&) const { // TODO } template void itk::VtkAbstractTransform::ComputeJacobianWithRespectToPosition(const InputPointType&, JacobianType&) const { // TODO } } // namespace itk diff --git a/Core/Code/DataManagement/mitkPoint.h b/Core/Code/DataManagement/mitkPoint.h index 731b2f6853..44766d5b25 100644 --- a/Core/Code/DataManagement/mitkPoint.h +++ b/Core/Code/DataManagement/mitkPoint.h @@ -1,78 +1,78 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef MITKPOINT_H #define MITKPOINT_H // this is needed for memcopy in ITK // can be removed when fixed in ITK #include #include #include #include #include #include #include #include #include #include #include "mitkDataTypeBasics.h" namespace mitk { template class Point : public itk::Point { public: /** Default constructor has nothing to do. */ - mitk::Point() {} + Point() {} /** Pass-through constructors for the Array base class. */ - mitk::Point(const mitk::Point& r) : itk::Point(r) {} - mitk::Point(const ValueType r[NPointDimension]):itk::Point(r) {} - mitk::Point(const ValueType & v):itk::Point(v) {} - mitk::Point(const itk::Point r) : itk::Point(r) {} + Point(const mitk::Point& r) : itk::Point(r) {} + Point(const TCoordRep r[NPointDimension]):itk::Point(r) {} + Point(const TCoordRep & v):itk::Point(v) {} + Point(const itk::Point r) : itk::Point(r) {} /** * Warning: Array must have same dimension as Point */ void CopyToArray(ScalarType* const array_p) const { for (int i = 0; i < this->GetPointDimension(); i++) { array_p[i] = this->GetElement(i); } } }; -typedef mitk::Point Point2D; -typedef mitk::Point Point3D; -typedef mitk::Point Point4D; +typedef Point Point2D; +typedef Point Point3D; +typedef Point Point4D; -typedef mitk::Point Point2I; -typedef mitk::Point Point3I; -typedef mitk::Point Point4I; +typedef Point Point2I; +typedef Point Point3I; +typedef Point Point4I; } // namespace mitk #endif /* MITKPOINT_H */ diff --git a/Modules/Segmentation/DataManagement/mitkContour.h b/Modules/Segmentation/DataManagement/mitkContour.h index b10433813b..8b76143f74 100644 --- a/Modules/Segmentation/DataManagement/mitkContour.h +++ b/Modules/Segmentation/DataManagement/mitkContour.h @@ -1,185 +1,185 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef _MITK_CONTOUR_H_ #define _MITK_CONTOUR_H_ #include "mitkCommon.h" #include "SegmentationExports.h" #include "mitkBaseData.h" #include #include namespace mitk { /** \brief Stores vertices for drawing a contour. \deprecated Use class mitk::ContourModel instead. \sa ContourModel */ class Segmentation_EXPORT Contour : public BaseData { public: mitkClassMacro(Contour, BaseData); itkNewMacro(Self); mitkCloneMacro(Contour); typedef itk::PolyLineParametricPath<3> PathType; typedef PathType::Pointer PathPointer; typedef PathType::ContinuousIndexType ContinuousIndexType; typedef PathType::InputType InputType; typedef PathType::OutputType OutputType; typedef PathType::OffsetType OffsetType; typedef itk::BoundingBox >> BoundingBoxType; + itk::VectorContainer< unsigned long, mitk::Point< ScalarType, 3 > > > BoundingBoxType; typedef BoundingBoxType::PointsContainer PointsContainer; typedef BoundingBoxType::PointsContainer::Pointer PointsContainerPointer; typedef BoundingBoxType::PointsContainerIterator PointsContainerIterator; /** * sets whether the contour should be closed or open. * by default the contour is closed */ itkSetMacro(Closed, bool); /** * returns if the contour is closed or opened */ itkGetMacro(Closed, bool); itkSetMacro(Selected, bool); itkGetMacro(Selected, bool); itkSetMacro(Width, float); itkGetMacro(Width, float); /** * clean up the contour data */ void Initialize(); /** * add a new vertex to the contour */ void AddVertex(mitk::Point3D newPoint); /** * return an itk parametric path of the contour */ PathPointer GetContourPath() const; /** * set the current render window. This is helpful if one * wants to draw the contour in one special window only. */ void SetCurrentWindow(vtkRenderWindow* rw); /** * returns the points to the current render window */ vtkRenderWindow* GetCurrentWindow() const; /** * returns the number of points stored in the contour */ unsigned int GetNumberOfPoints() const; /** * returns the container of the contour points */ PointsContainerPointer GetPoints() const; /** * set the contour points container. */ void SetPoints(PointsContainerPointer points); /** * intherited from parent */ virtual void UpdateOutputInformation(); /** * intherited from parent */ virtual void SetRequestedRegionToLargestPossibleRegion(); /** * intherited from parent */ virtual bool RequestedRegionIsOutsideOfTheBufferedRegion(); /** * intherited from parent */ virtual bool VerifyRequestedRegion(); /** * intherited from parent */ virtual void SetRequestedRegion( const itk::DataObject *data); protected: Contour(); Contour(const Contour & other); virtual ~Contour(); virtual void PrintSelf(std::ostream& os, itk::Indent indent) const; private: /** * parametric path of a contour; */ PathType::Pointer m_ContourPath; /** * the current render window */ vtkRenderWindow* m_CurrentWindow; /** * the bounding box of the contour */ BoundingBoxType::Pointer m_BoundingBox; /** * container for all contour points */ BoundingBoxType::PointsContainer::Pointer m_Vertices; /** * decide whether th contour is open or closed */ bool m_Closed; bool m_Selected; float m_Width; }; } // namespace mitk #endif //_MITK_CONTOUR_H_