Skip to content

Commit c5ca654

Browse files
N-Dekkerhjmjohnson
authored andcommitted
STYLE: Fix SetIn/OutsideValue calls ConnectedComponentImageFilterTestRGB
The `SetInsideValue` and `SetOutsideValue` member functions of `BinaryThresholdImageFilter<InternalImageType, RGBImageType>` expect an RGB pixel value as argument, not just a single `unsigned short` value! Issue found by locally (temporarily) declaring the converting constructor `RGBPixel(const ComponentType &)` "explicit".
1 parent 12a501c commit c5ca654

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Modules/Segmentation/ConnectedComponents/test/itkConnectedComponentImageFilterTestRGB.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ itkConnectedComponentImageFilterTestRGB(int argc, char * argv[])
7171
threshold_hi = std::stoi(argv[4]);
7272

7373
threshold->SetInput(reader->GetOutput());
74-
threshold->SetInsideValue(itk::NumericTraits<InternalPixelType>::OneValue());
75-
threshold->SetOutsideValue(itk::NumericTraits<InternalPixelType>::ZeroValue());
74+
threshold->SetInsideValue(itk::NumericTraits<RGBPixelType>::OneValue());
75+
threshold->SetOutsideValue(itk::NumericTraits<RGBPixelType>::ZeroValue());
7676
threshold->SetLowerThreshold(threshold_low);
7777
threshold->SetUpperThreshold(threshold_hi);
7878
threshold->Update();

0 commit comments

Comments
 (0)