]> Creatis software - clitk.git/commitdiff
Debug clitkNormalizeImage
authortbaudier <thomas.baudier@creatis.insa-lyon.fr>
Thu, 18 Apr 2019 08:18:55 +0000 (10:18 +0200)
committertbaudier <thomas.baudier@creatis.insa-lyon.fr>
Thu, 18 Apr 2019 08:18:55 +0000 (10:18 +0200)
With a image with a non-null direction matrix, it failed during min/max computation
Set direction matrix to output and mask copying the input direction matrix to solve the problem

tools/clitkNormalizeImageFilterGenericFilter.txx

index ea8773334d2307d99953eab8c0a133690c215bc8..fd62269988dbb8a1ede174f43f3ce116dcd4248e 100644 (file)
@@ -103,6 +103,7 @@ namespace clitk
             mask->SetRegions(input->GetLargestPossibleRegion());
             mask->SetOrigin(input->GetOrigin());
             mask->SetSpacing(input->GetSpacing());
+            mask->SetDirection(input->GetDirection());
             mask->Allocate();
             mask->FillBuffer(1);
         }
@@ -112,6 +113,7 @@ namespace clitk
         outputImage->SetRegions(input->GetLargestPossibleRegion());
         outputImage->SetOrigin(input->GetOrigin());
         outputImage->SetSpacing(input->GetSpacing());
+        outputImage->SetDirection(input->GetDirection());
         outputImage->Allocate();
         outputImage->FillBuffer(0.0);
         // Set output iterator