X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=common%2FvvImage.h;h=37fa547cf163b6dcae1e0f0a9c8e4383bcd10270;hb=39cefd8c1cb4a39b5d451b113e5877cd27f388a6;hp=106189f2310aea4b142d22d474efa2bac5243557;hpb=48d8569538b93bf923de2f8d5c4b9db51640978f;p=clitk.git diff --git a/common/vvImage.h b/common/vvImage.h index 106189f..37fa547 100644 --- a/common/vvImage.h +++ b/common/vvImage.h @@ -1,7 +1,7 @@ /*========================================================================= Program: vv http://www.creatis.insa-lyon.fr/rio/vv - Authors belong to: + Authors belong to: - University of LYON http://www.universite-lyon.fr/ - Léon Bérard cancer center http://oncora1.lyon.fnclcc.fr - CREATIS CNRS laboratory http://www.creatis.insa-lyon.fr @@ -21,69 +21,65 @@ #include #include #include +#include + +#include #include +#include class vtkImageData; -class vtkImageReslice; -class vtkTransform; -class vtkImageReslice; -class vtkAbstractTransform; -class vvImage : public itk::LightObject { +//------------------------------------------------------------------------------ +class vvImage : public itk::LightObject +{ public : typedef vvImage Self; typedef itk::SmartPointer Pointer; + typedef itk::ProcessObject::Pointer ConverterPointer; itkNewMacro(Self); void Init(); void Reset(); - - void SetImage(std::vector images); - void AddImage(vtkImageData* image); + template void AddItkImage(TItkImageType *input); const std::vector& GetVTKImages(); + const std::vector& GetTransformedVTKImages(); vtkImageData* GetFirstVTKImageData(); - int GetNumberOfDimensions() const; int GetNumberOfSpatialDimensions(); - ///Writes the scalar range to the provided array, which must have room for two doubles void GetScalarRange(double* range); unsigned long GetActualMemorySize(); std::vector GetSpacing(); std::vector GetOrigin() const; std::vector GetSize(); - std::string GetScalarTypeAsString(); + std::string GetScalarTypeAsITKString(); int GetNumberOfScalarComponents(); int GetScalarSize(); - bool IsTimeSequence(); + bool IsTimeSequence() const; bool IsScalarTypeInteger(); bool IsScalarTypeInteger(int t); - vtkAbstractTransform * GetTransform(); - void SetTransform(vtkAbstractTransform *transform); - vtkImageReslice* GetVTKImageReslice(); - void SetVTKImageReslice(vtkImageReslice *reslice); - - void SetRotateX(int xvalue); - void SetRotateY(int yvalue); - void SetRotateZ(int zvalue); - - void SetTranslationX(int xvalue); - void SetTranslationY(int yvalue); - void SetTranslationZ(int zvalue); - void SetOrigin(double value[3]); - private: - + vtkSmartPointer GetTransform(); void SetTimeSpacing(double s) { mTimeSpacing = s; } void SetTimeOrigin(double o) { mTimeOrigin = o; } + void UpdateReslice(); + bool HaveSameSizeAndSpacingThan(vvImage * other); - private: +private: vvImage(); ~vvImage(); + + std::vector< ConverterPointer > mItkToVtkConverters; std::vector mVtkImages; - vtkSmartPointer mVtkImageReslice; - vtkSmartPointer transform; + + std::vector< vtkSmartPointer > mVtkImageReslice; + vtkSmartPointer mTransform; + std::vector mTransformedVtkImages; + double mTimeOrigin; double mTimeSpacing; - double * origin; + unsigned int mImageDimension; }; +//------------------------------------------------------------------------------ + +#include "vvImage.txx" #endif