From: tbaudier Date: Thu, 16 Feb 2017 16:17:51 +0000 (+0100) Subject: Copy transform matrix for NVector Image in vv X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=3a065704c5a062414593171bcb34d113e67ae973;p=clitk.git Copy transform matrix for NVector Image in vv --- diff --git a/common/vvImageReader.txx b/common/vvImageReader.txx index d1fddfb..4bf6616 100644 --- a/common/vvImageReader.txx +++ b/common/vvImageReader.txx @@ -157,11 +157,17 @@ void vvImageReader::UpdateWithDimAndInputPixelType() 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); @@ -169,6 +175,7 @@ void vvImageReader::UpdateWithDimAndInputPixelType() output->SetRegions(region); output->SetOrigin(origin); output->SetSpacing(spacing); + output->SetDirection(direction); output->Allocate(); //Copy each channel