From: tbaudier Date: Thu, 16 Feb 2017 10:34:38 +0000 (+0100) Subject: Copy transform matrix in clitk4DImageToNVectorImage tool X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=b1690434fe48cdd5c059feba1a5bd2f1f1752dd5;p=clitk.git Copy transform matrix in clitk4DImageToNVectorImage tool --- 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();