[ITK-users] Radius in itkVectorGradientMagnitudeImageFilter

Bradley Lowekamp brad at lowekamp.net
Thu Dec 3 20:56:30 EST 2015


Kevin,

I recall being stumped by this filter when I tried ( and apparently didn’t ) wrap this class for SimpleITK. There were several odd behaviors.

Looking at the code, it does not look like the NeighborhoodRadius is actually used for the computation in the algorithm. Likely this filter was based on another, and never fully cleaned up.

I think that the neighborhood parameter could just be removed and the code cleaned up without a problem.

Brad

> On Dec 2, 2015, at 2:49 PM, Kevin H. Hobbs <hobbsk at ohio.edu> wrote:
> 
> For the attached program I see no difference in the output between
> 
>  radius[0] = 1;
>  radius[1] = 1;
>  radius[2] = 1;
> 
> and
> 
>  radius[0] = 8;
>  radius[1] = 8;
>  radius[2] = 8;
> 
> The RadiusType m_NeighborhoodRadius is set, printed, and used to expand
> the requested region but the gradient calculations use central
> differences only between pixels adjacent to the neighborhood center :
> 
>  d_phi_du[i][j] = ... it.GetNext(i)[j] - it.GetPrevious(i)[j]...
> 
> Should these be :
> 
>  NeighborhoodIndexType ri = m_NeighborhoodRadius[i];
>  d_phi_du[i][j] = ... it.GetNext(i,ri)[j] - it.GetPrevious(i,ri)[j]...
> 
> ?
> <RGBGradMag.cxx>_____________________________________
> Powered by www.kitware.com
> 
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
> 
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.php
> 
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
> 
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/insight-users



More information about the Insight-users mailing list