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
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.