X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=common%2FvvImage.cxx;h=9a6fc8ff489f39c1d661b1a55940a46253d3a2c3;hb=e1098dccba022441144bfc1c44a2b58db7dde34e;hp=951c2b36a4221c60d31e1217bf4a489273598db5;hpb=dc5463b1f63c99ca11ca8f5db0ddc7bed36e8d66;p=clitk.git diff --git a/common/vvImage.cxx b/common/vvImage.cxx index 951c2b3..9a6fc8f 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 @@ -26,14 +26,11 @@ // vtk #include -#include #include // std #include -#define NO_RESLICE 1 - //-------------------------------------------------------------------- vvImage::vvImage():mTransform(vtkSmartPointer::New()) { @@ -54,7 +51,6 @@ void vvImage::Init() //-------------------------------------------------------------------- vvImage::~vvImage() { - // DD("vvImage got deleted!"); Reset(); } //-------------------------------------------------------------------- @@ -62,9 +58,7 @@ vvImage::~vvImage() //-------------------------------------------------------------------- void vvImage::Reset() { - mVtkImages.resize(0); - mVtkImageReslice.resize(0); - + mVtkImages.clear(); Init(); } //-------------------------------------------------------------------- @@ -73,11 +67,6 @@ void vvImage::Reset() int vvImage::GetNumberOfSpatialDimensions() { return mImageDimension; - // int dim=GetNumberOfDimensions(); - // if (IsTimeSequence()) - // return dim+1; - // else - // return dim; } //-------------------------------------------------------------------- @@ -89,14 +78,6 @@ int vvImage::GetNumberOfDimensions() const return mImageDimension+1; else return mImageDimension; - // int dimension = 3; - // int extent[6]; - // mVtkImages[0]->GetWholeExtent(extent); - // if (extent[5] - extent[4] >= 1) - // dimension++; - // // if (mVtkImages.size() > 1) - // // dimension++; - // return dimension; } return 0; } @@ -246,7 +227,6 @@ bool vvImage::IsScalarTypeInteger(int t) return false; } } - //-------------------------------------------------------------------- //-------------------------------------------------------------------- @@ -256,13 +236,18 @@ vtkSmartPointer vvImage::GetTransform() } //-------------------------------------------------------------------- + //-------------------------------------------------------------------- -void vvImage::UpdateReslice() +bool vvImage::HaveSameSizeAndSpacingThan(vvImage * other) { - for (unsigned int i=0; iUpdate(); + bool same = true; + for(int i=0; iGetSize()[i]) same = false; + if ( GetSpacing()[i] != other->GetSpacing()[i]) same = false; } + return same; } //-------------------------------------------------------------------- + #endif // VVIMAGE_CXX