X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=common%2FvvImage.cxx;h=9842d4a7f2f64945580c53a6779b82957f561e55;hb=1c314c7b44201bfa914c04cf406211c1b64ef5a4;hp=71986c64f94c42296c86828c08c97e9a9c818e4c;hpb=b29eb65e42740eaea460a8c503f3df05bb554ffe;p=clitk.git diff --git a/common/vvImage.cxx b/common/vvImage.cxx index 71986c6..9842d4a 100644 --- a/common/vvImage.cxx +++ b/common/vvImage.cxx @@ -3,7 +3,7 @@ Authors belong to: - University of LYON http://www.universite-lyon.fr/ - - Léon Bérard cancer center http://oncora1.lyon.fnclcc.fr + - Léon Bérard cancer center http://www.centreleonberard.fr - CREATIS CNRS laboratory http://www.creatis.insa-lyon.fr This software is distributed WITHOUT ANY WARRANTY; without even @@ -14,7 +14,7 @@ - BSD See included LICENSE.txt file - CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html -======================================================================-====*/ +===========================================================================**/ #ifndef VVIMAGE_CXX #define VVIMAGE_CXX @@ -32,7 +32,7 @@ #include //-------------------------------------------------------------------- -vvImage::vvImage():mTransform(vtkSmartPointer::New()) +vvImage::vvImage() { Init(); } @@ -63,6 +63,27 @@ void vvImage::Reset() } //-------------------------------------------------------------------- +//-------------------------------------------------------------------- +void vvImage::AddVtkImage(vtkImageData* input) +{ + // RP: 20/12/2011 + // Note that we're simply adding a new image to the vector. + // mItkToVtkConverters is therefore not being updated, but + // up to here it's not being used anyway... + mImageDimension = 0; + int* extent = input->GetWholeExtent(); + if (extent[4] != extent[5]) + mImageDimension = 3; + else if (extent[3] != extent[4]) + mImageDimension = 2; + else if (extent[0] != extent[1]) + mImageDimension = 1; + + mVtkImages.push_back(input); +} + +//-------------------------------------------------------------------- + //-------------------------------------------------------------------- int vvImage::GetNumberOfSpatialDimensions() { @@ -230,7 +251,7 @@ bool vvImage::IsScalarTypeInteger(int t) //-------------------------------------------------------------------- //-------------------------------------------------------------------- -vtkSmartPointer vvImage::GetTransform() +const std::vector< vtkSmartPointer >& vvImage::GetTransform() { return this->mTransform; } @@ -248,6 +269,11 @@ bool vvImage::HaveSameSizeAndSpacingThan(vvImage * other) return same; } //-------------------------------------------------------------------- +itk::MetaDataDictionary* vvImage::GetFirstMetaDataDictionary() +{ + return mDictionary[0]; +} +//-------------------------------------------------------------------- #endif // VVIMAGE_CXX