]> Creatis software - clitk.git/commitdiff
Take into account directions into clitk warp tool
authortbaudier <thomas.baudier@creatis.insa-lyon.fr>
Tue, 21 Mar 2017 16:24:44 +0000 (17:24 +0100)
committertbaudier <thomas.baudier@creatis.insa-lyon.fr>
Tue, 21 Mar 2017 16:24:44 +0000 (17:24 +0100)
tools/clitkWarpImageGenericFilter.txx

index d1d1f714f3a76b46978fd0e9f3335740c1006a2c..84bfbaaec7148cc5f133180c3b5290ca608eb491 100644 (file)
@@ -132,6 +132,7 @@ WarpImageGenericFilter::UpdateWithDimAndPixelType()
     resampler =itk::VectorResampleImageFilter<DeformationFieldType, DeformationFieldType >::New();
     resampler->SetInput(deformationField);
     resampler->SetOutputSpacing(deformationField->GetSpacing());
+    resampler->SetOutputDirection(deformationField->GetDirection());
     resampler->SetSize(newSize);
     resampler->SetOutputOrigin(input->GetOrigin());
     resampler->SetInterpolator(genericInterpolator->GetInterpolatorPointer());
@@ -163,6 +164,7 @@ WarpImageGenericFilter::UpdateWithDimAndPixelType()
     resampler =itk::VectorResampleImageFilter<DeformationFieldType, DeformationFieldType >::New();
     resampler->SetInput(deformationField);
     resampler->SetOutputSpacing(input->GetSpacing());
+    resampler->SetOutputDirection(deformationField->GetDirection());
     resampler->SetSize(newSize);
     resampler->SetOutputOrigin(input->GetOrigin());
     resampler->SetInterpolator(genericInterpolator->GetInterpolatorPointer());
@@ -210,6 +212,7 @@ WarpImageGenericFilter::UpdateWithDimAndPixelType()
     backwardWarpFilter->SetOutputSpacing( deformationField->GetSpacing() );
     backwardWarpFilter->SetOutputOrigin( input->GetOrigin() );
     backwardWarpFilter->SetOutputSize( deformationField->GetLargestPossibleRegion().GetSize() );
+    backwardWarpFilter->SetOutputDirection( input->GetDirection() );
     typename itk::VectorResampleImageFilter<DeformationFieldType, DeformationFieldType >::Pointer
     resampler =itk::VectorResampleImageFilter<DeformationFieldType, DeformationFieldType >::New();
     backwardWarpFilter->SetInterpolator(genericInterpolator->GetInterpolatorPointer());