X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=common%2FvvImage.h;h=cbb0284ce0e925f706032825c7e8888da7744987;hb=d55f025b18f68066a52b8f33c2dc6481e82c2580;hp=10ffc865fa2ed353605e4844abd6c456e5e678ee;hpb=a93208c4ebf1cb3c89a8c8d0c022d17cc66a6f8e;p=clitk.git diff --git a/common/vvImage.h b/common/vvImage.h index 10ffc86..cbb0284 100644 --- a/common/vvImage.h +++ b/common/vvImage.h @@ -22,6 +22,8 @@ #include #include #include +#include +#include #define VTK_EXCLUDE_STRSTREAM_HEADERS #include @@ -37,6 +39,10 @@ public : typedef itk::SmartPointer Pointer; typedef itk::ProcessObject::Pointer ConverterPointer; itkNewMacro(Self); + + struct DimensionDispatchBase {}; + template< unsigned int VDimension > + struct DimensionDispatch:public DimensionDispatchBase {}; void Init(); void Reset(); @@ -47,10 +53,14 @@ public : int GetNumberOfDimensions() const; int GetNumberOfSpatialDimensions(); void GetScalarRange(double* range); + template void ComputeScalarRangeBase(itk::Image *input); + template void ComputeScalarRange(DimensionDispatchBase, itk::Image *input); + template void ComputeScalarRange(DimensionDispatch< 1 >, itk::Image *input); unsigned long GetActualMemorySize(); std::vector GetSpacing(); std::vector GetOrigin() const; std::vector GetSize(); + std::vector< std::vector > GetDirection(); std::string GetScalarTypeAsITKString(); int GetNumberOfScalarComponents(); int GetScalarSize(); @@ -58,6 +68,7 @@ public : bool IsScalarTypeInteger(); bool IsScalarTypeInteger(int t); const std::vector< vtkSmartPointer >& GetTransform(); + void InitializeTransform(); void SetTimeSpacing(double s) { mTimeSpacing = s; } void SetTimeOrigin(double o) { mTimeOrigin = o; } bool HaveSameSizeAndSpacingThan(vvImage * other); @@ -77,6 +88,7 @@ private: double mTimeOrigin; double mTimeSpacing; unsigned int mImageDimension; + double mrange[2]; }; //------------------------------------------------------------------------------