]> Creatis software - clitk.git/blobdiff - common/vvImage.cxx
Merge branch 'master' of git.creatis.insa-lyon.fr:clitk
[clitk.git] / common / vvImage.cxx
index 71986c64f94c42296c86828c08c97e9a9c818e4c..0bddb262cb7a4f8ce70d204d8be1750e3ae35f0c 100644 (file)
@@ -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()
 {