X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;ds=sidebyside;f=common%2FvvImage.cxx;h=6ba06c5a17b4b0de30d07af5eb887e13c68dce05;hb=3a823a03d4a2217e41e4dd3b05a8ea825bb762a5;hp=0bddb262cb7a4f8ce70d204d8be1750e3ae35f0c;hpb=f919b21c1ae12c0b81b653dcd00db5eaaad5a343;p=clitk.git diff --git a/common/vvImage.cxx b/common/vvImage.cxx index 0bddb26..6ba06c5 100644 --- a/common/vvImage.cxx +++ b/common/vvImage.cxx @@ -27,12 +27,16 @@ // vtk #include #include +#include +#include +#include +#include // std #include //-------------------------------------------------------------------- -vvImage::vvImage():mTransform(vtkSmartPointer::New()) +vvImage::vvImage() { Init(); } @@ -71,7 +75,12 @@ void vvImage::AddVtkImage(vtkImageData* input) // mItkToVtkConverters is therefore not being updated, but // up to here it's not being used anyway... mImageDimension = 0; +#if VTK_MAJOR_VERSION <= 5 int* extent = input->GetWholeExtent(); +#else + int* extent = input->GetInformation()->Get(vtkDataObject::DATA_EXTENT()); +#endif + if (extent[4] != extent[5]) mImageDimension = 3; else if (extent[3] != extent[4]) @@ -251,7 +260,7 @@ bool vvImage::IsScalarTypeInteger(int t) //-------------------------------------------------------------------- //-------------------------------------------------------------------- -vtkSmartPointer vvImage::GetTransform() +const std::vector< vtkSmartPointer >& vvImage::GetTransform() { return this->mTransform; } @@ -269,6 +278,11 @@ bool vvImage::HaveSameSizeAndSpacingThan(vvImage * other) return same; } //-------------------------------------------------------------------- +itk::MetaDataDictionary* vvImage::GetFirstMetaDataDictionary() +{ + return mDictionary[0]; +} +//-------------------------------------------------------------------- #endif // VVIMAGE_CXX