]> Creatis software - clitk.git/commitdiff
Ensure to have correct value
authortbaudier <thomas.baudier@creatis.insa-lyon.fr>
Mon, 15 May 2017 09:27:19 +0000 (11:27 +0200)
committertbaudier <thomas.baudier@creatis.insa-lyon.fr>
Mon, 15 May 2017 09:27:19 +0000 (11:27 +0200)
tools/clitkImage2DicomSeriesGenericFilter.txx

index 9a87c5250266b21c31415296f4b33abc6ecb716f..7e11da4b880fdc78af3c886fc5463139b84897f2 100644 (file)
@@ -46,6 +46,8 @@
  
 #include "itkImageSeriesReader.h"
 #include "itkImageSeriesWriter.h"
+
+#include <itkThresholdImageFilter.h>
  
 #include "itkResampleImageFilter.h"
  
@@ -262,7 +264,21 @@ Image2DicomSeriesGenericFilter<args_info_type>::UpdateWithDimAndPixelType()
       outputSpacing[i] = input->GetSpacing()[i];
       outputSize[i] = input->GetLargestPossibleRegion().GetSize()[i];
     }
+
+////////////////////////////////////////////////
+// 2) Ensure to have value >= -1024
+
+  typedef itk::ThresholdImageFilter <InputImageType> 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();