From b1690434fe48cdd5c059feba1a5bd2f1f1752dd5 Mon Sep 17 00:00:00 2001 From: tbaudier Date: Thu, 16 Feb 2017 11:34:38 +0100 Subject: [PATCH] Copy transform matrix in clitk4DImageToNVectorImage tool --- tools/clitk4DImageToNVectorImageGenericFilter.txx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tools/clitk4DImageToNVectorImageGenericFilter.txx b/tools/clitk4DImageToNVectorImageGenericFilter.txx index 554cec7..1f8f3eb 100644 --- a/tools/clitk4DImageToNVectorImageGenericFilter.txx +++ b/tools/clitk4DImageToNVectorImageGenericFilter.txx @@ -97,9 +97,15 @@ namespace clitk extractFilter->SetInput(input); typename InputImageType::SizeType size; + typename OutputImageType::DirectionType direction; + direction.SetIdentity(); for (unsigned int nbDimension=0; nbDimensionGetLargestPossibleRegion().GetSize(nbDimension); + for (unsigned int pixelDim2=0; pixelDim2GetDirection()[nbDimension][pixelDim2]; + } } size[Dimension-1] = 0; typename MedianImageType::Pointer tempImage = MedianImageType::New(); @@ -124,7 +130,10 @@ namespace clitk imageToVectorImageFilter->Update(); - // Output + // Copy transform matrix + imageToVectorImageFilter->GetOutput()->SetDirection(direction); + + //Output writer->SetInput(imageToVectorImageFilter->GetOutput()); writer->SetFileName(fileName); writer->Update(); -- 2.47.1