From ac538b72507046befd497a70d9545f824724372b Mon Sep 17 00:00:00 2001 From: tbaudier Date: Thu, 25 Feb 2016 15:25:33 +0100 Subject: [PATCH] Change the origin of registered cropped image in clitkCropImage --- tools/clitkCropImageGenericFilter.cxx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tools/clitkCropImageGenericFilter.cxx b/tools/clitkCropImageGenericFilter.cxx index ede4007..0e2818a 100644 --- a/tools/clitkCropImageGenericFilter.cxx +++ b/tools/clitkCropImageGenericFilter.cxx @@ -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); -- 2.47.1