X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=common%2FvvImage.txx;h=cc047bb1caf9c69bb187b52ab94311a14c81751f;hb=ed673c4df16c5541a1bd46413b4a67376b28008d;hp=ab518cb9095f60df17204d5d74e9614096fe8890;hpb=7ecd8498ac882223280979e6090d1af4763e9eac;p=clitk.git diff --git a/common/vvImage.txx b/common/vvImage.txx index ab518cb..cc047bb 100644 --- a/common/vvImage.txx +++ b/common/vvImage.txx @@ -41,11 +41,21 @@ void vvImage::AddItkImage(TItkImageType *input) matrix->Identity(); for(unsigned int i=0; iGetImageDimension(); i++) { for(unsigned int j=0; jGetImageDimension(); 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 *inp template void vvImage::ComputeScalarRange(DimensionDispatchBase, itk::Image *input) { - cout << "try" << endl; } //--------------------------------------------------------------------