From c128aacc440d819036e5595883421ba8df690313 Mon Sep 17 00:00:00 2001 From: tbaudier Date: Mon, 15 May 2017 11:27:19 +0200 Subject: [PATCH] Ensure to have correct value --- tools/clitkImage2DicomSeriesGenericFilter.txx | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/tools/clitkImage2DicomSeriesGenericFilter.txx b/tools/clitkImage2DicomSeriesGenericFilter.txx index 9a87c52..7e11da4 100644 --- a/tools/clitkImage2DicomSeriesGenericFilter.txx +++ b/tools/clitkImage2DicomSeriesGenericFilter.txx @@ -46,6 +46,8 @@ #include "itkImageSeriesReader.h" #include "itkImageSeriesWriter.h" + +#include #include "itkResampleImageFilter.h" @@ -262,7 +264,21 @@ Image2DicomSeriesGenericFilter::UpdateWithDimAndPixelType() outputSpacing[i] = input->GetSpacing()[i]; outputSize[i] = input->GetLargestPossibleRegion().GetSize()[i]; } - + +//////////////////////////////////////////////// +// 2) Ensure to have value >= -1024 + + typedef itk::ThresholdImageFilter ThresholdImageFilterType; + typename ThresholdImageFilterType::Pointer thresholdFilter = ThresholdImageFilterType::New(); + thresholdFilter->SetInput(input); + thresholdFilter->ThresholdBelow(-1024); + thresholdFilter->SetOutsideValue(-1024); + thresholdFilter->Update(); + + input=thresholdFilter->GetOutput(); + + + //////////////////////////////////////////////// // 2) Resample the series /* typename InterpolatorType::Pointer interpolator = InterpolatorType::New(); -- 2.47.1