]> Creatis software - clitk.git/blobdiff - common/vvImage.txx
Comment snoutID
[clitk.git] / common / vvImage.txx
index ab518cb9095f60df17204d5d74e9614096fe8890..cc047bb1caf9c69bb187b52ab94311a14c81751f 100644 (file)
@@ -41,11 +41,21 @@ void vvImage::AddItkImage(TItkImageType *input)
   matrix->Identity();
   for(unsigned int i=0; i<input->GetImageDimension(); i++) {
     for(unsigned int j=0; j<input->GetImageDimension(); j++) {
+#if VTK_MAJOR_VERSION <= 6
       (*matrix)[i][j] = input->GetDirection()[i][j];
       // Direction is used around the image origin in ITK
       (*matrix)[i][3] -= (*matrix)[i][j] * input->GetOrigin()[j];
+#else
+      (*matrix).SetElement(i, j, input->GetDirection()[i][j]);
+      // Direction is used around the image origin in ITK
+      (*matrix).SetElement(i, 3, (*matrix).GetElement(i,3) - (*matrix).GetElement(i,j) * input->GetOrigin()[j]);
+#endif
     }
+#if VTK_MAJOR_VERSION <= 6
     (*matrix)[i][3] += input->GetOrigin()[i];
+#else
+    (*matrix).SetElement(i, 3, (*matrix).GetElement(i,3) + input->GetOrigin()[i]);
+#endif
   }
 
   // GetDirection provides the forward transform, vtkImageReslice wants the inverse
@@ -72,7 +82,6 @@ void vvImage::ComputeScalarRangeBase(itk::Image<TPixelType,VImageDimension> *inp
 template<class TPixelType, unsigned int VImageDimension>
 void vvImage::ComputeScalarRange(DimensionDispatchBase, itk::Image<TPixelType,VImageDimension> *input)
 {
-     cout << "try" << endl;
 }
 
 //--------------------------------------------------------------------