[Insight-developers] optimization question

Zachary Pincus zpincus at stanford.edu
Wed Nov 9 19:56:19 EST 2005


I believe that you are correct and that the boundary condition is not  
used. A quick check over the NeighborhoodIterator code will confirm  
this.

Note further that the NeighborhoodIterator uses the FacesCalculator  
internally so that the relatively-time-consuming boundary checks are  
only applied when needed anyway (I believe). So really there's not  
necessarily a whole lot of gain from using the faces calculator  
yourself, since for most of the pixels, the boundary condition  
wouldn't be detected or used anyhow.

If this is grossly incorrect, someone should correct me, but this is  
what I remember from the last time I looked over the  
NeighborhoodIterator's code. (It's clean and simple code, as per  
usual for ITK, so it's not much of a pain to manually verify  
something like this.)

Zach Pincus

Program in Biomedical Informatics and Department of Biochemistry
Stanford University School of Medicine


On Nov 9, 2005, at 3:52 PM, Richard Beare wrote:

> Hi,
> This query is somewhat related to Gaetan's query of a few days ago.
>
> Suppose I construct a processing pipeline of filters that use
> neighborhood information of a known size - e.g a local neighborhood
> for region growing type algorithms. If I am happy to ignore the border
> I might set the image region that I pass to the pipeline to be a
> subset equivalent to that computed by the faces calculator. Would the
> code that detects boundary conditions get disabled in this case?
>
> I suspect that in some situtations it might be a easy to optimize
> using this kind of trick at the pipeline level, and I suspect that the
> code for dealing with regions might do the right thing already.
>
> Can anyone confirm?
>
> Thanks
> _______________________________________________
> Insight-developers mailing list
> Insight-developers at itk.org
> http://www.itk.org/mailman/listinfo/insight-developers



More information about the Insight-developers mailing list