diff --git a/Core/Code/DataManagement/mitkOldTypeConversions.h b/Core/Code/DataManagement/mitkOldTypeConversions.h index bdfe72b685..cd29efcc00 100644 --- a/Core/Code/DataManagement/mitkOldTypeConversions.h +++ b/Core/Code/DataManagement/mitkOldTypeConversions.h @@ -1,242 +1,242 @@ /*=================================================================== 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 MITKOLDTYPECONVERSIONS_H_ #define MITKOLDTYPECONVERSIONS_H_ #include #include "mitkTypeBasics.h" #include "mitkTypedefs.h" #include "mitkVector.h" template class VectorTraits { public: typedef T ValueType; }; template <> class VectorTraits { public: typedef mitk::ScalarType ValueType; }; template<> class VectorTraits { public: typedef float ValueType; }; template<> class VectorTraits< itk::Index<5> > { public: typedef itk::Index<5>::IndexValueType ValueType; }; template<> class VectorTraits< itk::Index<3> > { public: typedef itk::Index<3>::IndexValueType ValueType; }; template<> class VectorTraits< long int [3]> { public: typedef long int ValueType; }; template<> class VectorTraits< float [3]> { public: typedef float ValueType; }; template<> class VectorTraits< double [3]> { public: typedef double ValueType; }; template<> class VectorTraits< vnl_vector_fixed > { public: typedef mitk::ScalarType ValueType; }; template<> class VectorTraits< long unsigned int[3]> { public: typedef long unsigned int ValueType; }; template<> class VectorTraits< unsigned int *> { public: typedef unsigned int ValueType; }; template<> class VectorTraits< double[4] > { public: typedef double ValueType; }; template<> class VectorTraits< itk::Vector > { public: typedef float ValueType; }; template<> class VectorTraits< itk::Vector > { public: typedef double ValueType; }; template<> class VectorTraits< itk::Vector > { public: typedef int ValueType; }; -/* + template<> class VectorTraits< mitk::Vector > { public: typedef double ValueType; -};*/ +}; template<> class VectorTraits< mitk::Point > { public: typedef float ValueType; }; template<> class VectorTraits< mitk::Point > { public: typedef float ValueType; }; template<> class VectorTraits< itk::Point > { public: typedef float ValueType; }; template<> class VectorTraits< itk::Point > { public: typedef float ValueType; }; template<> class VectorTraits< mitk::Point > { public: typedef double ValueType; }; template<> class VectorTraits< mitk::Point > { public: typedef double ValueType; }; template<> class VectorTraits< itk::Point > { public: typedef double ValueType; }; template<> class VectorTraits< itk::Point > { public: typedef double ValueType; }; template<> class VectorTraits< mitk::Point > { public: typedef int ValueType; }; namespace mitk { template inline void FillVector3D(Tout& out, mitk::ScalarType x, mitk::ScalarType y, mitk::ScalarType z) { out[0] = (typename VectorTraits::ValueType)x; out[1] = (typename VectorTraits::ValueType)y; out[2] = (typename VectorTraits::ValueType)z; } template inline void FillVector4D(Tout& out, mitk::ScalarType x, mitk::ScalarType y, mitk::ScalarType z, mitk::ScalarType t) { out[0] = (typename VectorTraits::ValueType)x; out[1] = (typename VectorTraits::ValueType)y; out[2] = (typename VectorTraits::ValueType)z; out[3] = (typename VectorTraits::ValueType)t; } template inline void itk2vtk(const Tin& in, Tout& out) { out[0]=(typename VectorTraits::ValueType)(in[0]); out[1]=(typename VectorTraits::ValueType)(in[1]); out[2]=(typename VectorTraits::ValueType)(in[2]); } template inline void vtk2itk(const Tin& in, Tout& out) { out[0]=(typename VectorTraits::ValueType)(in[0]); out[1]=(typename VectorTraits::ValueType)(in[1]); out[2]=(typename VectorTraits::ValueType)(in[2]); } template inline void vnl2vtk(const vnl_vector& in, Tout *out) { unsigned int i; for(i=0; i inline void vtk2vnl(const Tin *in, vnl_vector& out) { unsigned int i; for(i=0; i inline void vtk2vnlref(const Tin *in, vnl_vector_ref& out) { unsigned int i; for(i=0; i inline void vnl2vtk(const vnl_vector_fixed& in, Tout *out) { unsigned int i; for(i=0; i inline void vtk2vnl(const Tin *in, vnl_vector_fixed& out) { unsigned int i; for(i=0; i inline void TransferMatrix(const itk::Matrix& in, itk::Matrix& out) { for (unsigned int i = 0; i < in.RowDimensions; ++i) for (unsigned int j = 0; j < in.ColumnDimensions; ++j) out[i][j] = in[i][j]; } } // namespace mitk #endif /* MITKOLDTYPECONVERSIONS_H_ */ diff --git a/Core/Code/DataManagement/mitkPoint.h b/Core/Code/DataManagement/mitkPoint.h index 59a9c15521..841bdeeeec 100644 --- a/Core/Code/DataManagement/mitkPoint.h +++ b/Core/Code/DataManagement/mitkPoint.h @@ -1,77 +1,76 @@ /*=================================================================== 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 #include #include "mitkTypeBasics.h" -namespace mitk { +namespace mitk { -//##Documentation -//##@brief enumeration of the type a point can be -enum PointSpecificationType -{ - PTUNDEFINED = 0, - PTSTART, - PTCORNER, - PTEDGE, - PTEND -}; - - -template -class Point : public itk::Point -{ - -public: - /** Default constructor has nothing to do. */ - Point() {} - - /** Pass-through constructors for the Array base class. */ - 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 + //##Documentation + //##@brief enumeration of the type a point can be + enum PointSpecificationType + { + PTUNDEFINED = 0, + PTSTART, + PTCORNER, + PTEDGE, + PTEND + }; + + template + class Point : public itk::Point { - for (int i = 0; i < this->GetPointDimension(); i++) + + public: + /** Default constructor has nothing to do. */ + Point() {} + + /** Pass-through constructors for the Array base class. */ + 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 { - array_p[i] = this->GetElement(i); + for (int i = 0; i < this->GetPointDimension(); i++) + { + array_p[i] = this->GetElement(i); + } } - } -}; + }; -typedef Point Point2D; -typedef Point Point3D; -typedef Point Point4D; + typedef Point Point2D; + typedef Point Point3D; + typedef Point Point4D; -typedef Point Point2I; -typedef Point Point3I; -typedef Point Point4I; + typedef Point Point2I; + typedef Point Point3I; + typedef Point Point4I; } // namespace mitk #endif /* MITKPOINT_H */ diff --git a/Core/Code/DataManagement/mitkTypedefs.h b/Core/Code/DataManagement/mitkTypedefs.h index 3054cd58ce..a4832024ff 100644 --- a/Core/Code/DataManagement/mitkTypedefs.h +++ b/Core/Code/DataManagement/mitkTypedefs.h @@ -1,52 +1,52 @@ /*=================================================================== 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 MITKTYPEDEFS_H_ #define MITKTYPEDEFS_H_ #include #include #include #include #include #include +#include #include "mitkTypeBasics.h" //template class Vector; namespace mitk { typedef itk::Matrix Matrix3D; typedef itk::Matrix Matrix4D; typedef vnl_matrix_fixed VnlMatrix3D; typedef itk::Transform Transform3D; typedef vnl_vector VnlVector; typedef vnl_vector_ref VnlVectorRef; typedef itk::Index<3> Index3D; typedef itk::ContinuousIndex ContinuousIndex3D; typedef vnl_quaternion Quaternion; typedef itk::NumericTraits ScalarTypeNumericTraits; -typedef itk::Vector Vector2D; -typedef itk::Vector Vector3D; +typedef std::pair FileServiceOption; } #endif /* MITKTYPEDEFS_H_ */ diff --git a/Core/Code/DataManagement/mitkVector.h b/Core/Code/DataManagement/mitkVector.h index 11edb5f7f7..77c837e77d 100644 --- a/Core/Code/DataManagement/mitkVector.h +++ b/Core/Code/DataManagement/mitkVector.h @@ -1,23 +1,58 @@ /*=================================================================== 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 MITKVECTOR_H_ #define MITKVECTOR_H_ - +#include + +#include "mitkTypeBasics.h" + +namespace mitk +{ + + template + class Vector : public itk::Vector + { + public: + /** Default constructor has nothing to do. */ + Vector() {} + + /** Pass-through constructors for the Array base class. */ + Vector(const Vector& r) : itk::Vector(r) {} + Vector(const TCoordRep r[NPointDimension]):itk::Vector(r) {} + Vector(const TCoordRep & v):itk::Vector(v) {} + Vector(const itk::Vector r) : itk::Vector(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 Vector Vector2D; + typedef Vector Vector3D; + typedef Vector Vector4D; + +} #endif /* MITKVECTOR_H_ */