[ITK] Binary Dilate/Erode filter
Matt McCormick
matt.mccormick at kitware.com
Mon May 29 13:41:13 EDT 2017
Hi Jay,
The region will be padded by the radius. The cropping will possibly
shrink the region at the input image's boundaries.
HTH,
Matt
On Mon, May 29, 2017 at 12:54 PM, jay nanavati
<jaysnanavati at hotmail.co.uk> wrote:
> Hi - Looking at
> ITK\Modules\Filtering\BinaryMathematicalMorphology\include\itkBinaryErodeImageFilter.hxx,
> I am a bit confused with regards to the padding and cropping of the regions
> for example, in the snippet below:
>
> ypename TInputImage::RegionType tmpRequestedRegion = outputRegion;
> typename TInputImage::RegionType paddedInputRegion =
> input->GetBufferedRegion();
> paddedInputRegion.PadByRadius(radius); // to support boundary values
> InputSizeType padBy = radius;
> for ( i = 0; i < KernelDimension; ++i )
> {
> padBy[i] = ( padBy[i] > kernel.GetRadius(i) ? padBy[i] :
> kernel.GetRadius(i) );
> }
> tmpRequestedRegion.PadByRadius(padBy);
> tmpRequestedRegion.Crop(paddedInputRegion);
>
> It appears that tmpRequestedRegion is padded but then immediately cropped,
> which means it will always be padded by a radius of 1 in each dimension
> anyways? Similar operations are performed when padding the
> inputRegionForThread:
>
> // Pad the input region by the kernel
> inputRegionForThread.PadByRadius( kernel.GetRadius() );
> inputRegionForThread.Crop( input->GetBufferedRegion() );
>
> It would be great if someone could guide me on this.
>
> Thanks,
> Jay
>
>
> _______________________________________________
> Community mailing list
> Community at itk.org
> http://public.kitware.com/mailman/listinfo/community
>
More information about the Community
mailing list