From d98418e7948315cd8c6ae9a2d5452ef0b52f9827 Mon Sep 17 00:00:00 2001 From: tbaudier Date: Thu, 18 Apr 2019 10:18:55 +0200 Subject: [PATCH] Debug clitkNormalizeImage 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 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/clitkNormalizeImageFilterGenericFilter.txx b/tools/clitkNormalizeImageFilterGenericFilter.txx index ea87733..fd62269 100644 --- a/tools/clitkNormalizeImageFilterGenericFilter.txx +++ b/tools/clitkNormalizeImageFilterGenericFilter.txx @@ -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 -- 2.47.1