From b4850f17d2a4a88dcb3541ec5fd789075652b6fe Mon Sep 17 00:00:00 2001 From: tbaudier Date: Thu, 16 Feb 2017 11:24:32 +0100 Subject: [PATCH] Copy transform matrix in clitkNVectorImageTo4DImage tool --- tools/clitkNVectorImageTo4DImageGenericFilter.txx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tools/clitkNVectorImageTo4DImageGenericFilter.txx b/tools/clitkNVectorImageTo4DImageGenericFilter.txx index 06d5792..1ea4436 100644 --- a/tools/clitkNVectorImageTo4DImageGenericFilter.txx +++ b/tools/clitkNVectorImageTo4DImageGenericFilter.txx @@ -103,17 +103,24 @@ namespace clitk spacing.Fill(1); typename OutputImageType::PointType origin; origin.Fill(0); + typename OutputImageType::DirectionType direction; + direction.SetIdentity(); for (unsigned int pixelDim=0; pixelDimGetLargestPossibleRegion().GetSize(pixelDim); spacing[pixelDim]=input->GetSpacing()[pixelDim]; origin[pixelDim]=input->GetOrigin()[pixelDim]; + for (unsigned int pixelDim2=0; pixelDim2GetDirection()[pixelDim][pixelDim2]; + } } typename OutputImageType::RegionType region; region.SetSize(size); region.SetIndex(index); output->SetRegions(region); output->SetOrigin(origin); + output->SetDirection(direction); output->SetSpacing(spacing); output->Allocate(); writer->SetInput(output); -- 2.47.1