X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=common%2FvvImage.cxx;h=0bddb262cb7a4f8ce70d204d8be1750e3ae35f0c;hb=89a782167f649e3667519233c30ec11c759c23b2;hp=71986c64f94c42296c86828c08c97e9a9c818e4c;hpb=b29eb65e42740eaea460a8c503f3df05bb554ffe;p=clitk.git diff --git a/common/vvImage.cxx b/common/vvImage.cxx index 71986c6..0bddb26 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 @@ -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() {