Error in CropImageFilter example

Hello everybody,
I was adapting this example to my project: https://itk.org/Doxygen/html/WikiExamples_2ImageProcessing_2CropImageFilter_8cxx-example.html

But I think that it is wrong within this statement

// The SetBoundaryCropSize( cropSize ) method specifies the size of
// the boundary to be cropped at both the uppper & lower ends of the
// image eg. cropSize/2 pixels will be removed at both upper & lower
// extents
cropFilter->SetBoundaryCropSize(cropSize);

It seems to me that the filter crops “cropSize” pixels from the top and “cropSize” from the bottom, not half of them as the example specify.

I thought It may be interesting for you to check and maybe fix the error in the example.

1 Like

I created a PR to fix this. Thanks for the report.

1 Like