]> Creatis software - clitk.git/commitdiff
Copy transform matrix for NVector Image in vv
authortbaudier <thomas.baudier@creatis.insa-lyon.fr>
Thu, 16 Feb 2017 16:17:51 +0000 (17:17 +0100)
committertbaudier <thomas.baudier@creatis.insa-lyon.fr>
Thu, 16 Feb 2017 16:17:51 +0000 (17:17 +0100)
common/vvImageReader.txx

index d1fddfb58639143a45b4b616be5d034880e93265..4bf6616f5f8d7d29cd570ccfb66a3e7b7ff01f41 100644 (file)
@@ -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; pixelDim<VImageDimension-1; ++pixelDim)
     {
       size[pixelDim]=adaptor->GetLargestPossibleRegion().GetSize(pixelDim);
       spacing[pixelDim]=input->GetSpacing()[pixelDim];
       origin[pixelDim]=input->GetOrigin()[pixelDim];
+      for (unsigned int pixelDim2=0; pixelDim2<VImageDimension-1; ++pixelDim2)
+      {
+        direction[pixelDim][pixelDim2]=input->GetDirection()[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