]> Creatis software - clitk.git/commitdiff
Change the origin of registered cropped image in clitkCropImage
authortbaudier <thomas.baudier@creatis.insa-lyon.fr>
Thu, 25 Feb 2016 14:25:33 +0000 (15:25 +0100)
committertbaudier <thomas.baudier@creatis.insa-lyon.fr>
Thu, 25 Feb 2016 14:25:33 +0000 (15:25 +0100)
tools/clitkCropImageGenericFilter.cxx

index ede400746d028373718d3f3d45444ab6865a3468..0e2818ac67e4d3584e20891545aa37d641ce0fba 100644 (file)
@@ -183,8 +183,7 @@ void clitk::CropImageGenericFilter::UpdateWithInputImageType()
   typename ImageType::PointType origin = output->GetOrigin();
   typename ImageType::SpacingType spacing = output->GetSpacing();
   if (mArgsInfo.verbose_flag) std::cout << "origin before crop " << origin << std::endl;
-  for (unsigned int i = 0; i < output->GetImageDimension(); i++)
-    origin[i] += index[i]*spacing[i];
+  input->TransformIndexToPhysicalPoint(index,origin);
   if (mArgsInfo.verbose_flag) std::cout << "origin after crop " << origin << std::endl;
   output->SetOrigin(origin);