+
+ // Pad images with air to prevent patient touching the image border
+ typedef itk::ConstantPadImageFilter<InputImageType, InputImageType> PadFilterType;
+ typename PadFilterType::Pointer padFilter = PadFilterType::New();
+ padFilter->SetInput(input);
+ padFilter->SetConstant(GetUpperThreshold() - 1);
+ typename InputImageType::SizeType bounds;
+ for (unsigned i = 0; i < Dim - 1; ++i)
+ bounds[i] = 1;
+ bounds[Dim - 1] = 0;
+ padFilter->SetPadLowerBound(bounds);
+ padFilter->SetPadUpperBound(bounds);
+
+ typedef itk::BinaryThresholdImageFilter<InputImageType, InternalImageType> BinarizeFilterType;