[Insight-users] Grid Node Iterator

Luis Ibanez luis.ibanez at kitware.com
Wed Nov 4 12:10:22 EST 2009


Hi Somi,

This is an interesting problem...

We don't have such an iterator in ITK,
but...
you probably can build it "easily" by
modifying the code of the itkImageRegion iterator.

It would seem that the key point that you need to
modify is the use of the Offset Table.

See the use of the m_Offset variable in the mehtods

operator++()
operator--()

of the itkImageRegionIterator,
for example...


Note also that the strategy that you describe have
already been implemented in the context of the
FEMRegistration filter. That is, an image metric
is computed using a neighborhood around the
nodes of a grid (the FEM grid in this case).


Although,
I'm not sure how reusable it may actually be...


     Regards,


           Luis


----------------------------------------------
On Mon, Nov 2, 2009 at 12:14 AM, somi <seesomi at gmail.com> wrote:
> Hi,
> Is there any neighborhood iterator which automatically divides image into
> regular grid of fixed density and iterates on the grid nodes ?
>
> I plan to use it for something like this:
>
> a) Divided image into grids and define some neighborhood
> b) Visit each grid node in the source image/ compare the source image patch
> with the corresponding moving image after applying some random translation
> and get a metric value.
> c) After running through all nodes we would have a metric matrix same size
> as the grid.
>
> I was wondering which iterator/set of classes would be most efficient in
> terms of speed for this purpose.
> The iterators that I saw in ITK either go pixel-wise, or if we add a
> constant offset it doesn't visit the grid nodes that I expect it to.
> So each time I have to setLocation in the iterator, which kind of defeats
> the purpose of using an iterator. Should I go for the traditional way:
> for i=1:gridspacing:LengthX
> for j=1:gridspacing:LengthY
> ??
> I would appreciate any help from experienced people who might work on a
> similar problem.
>
> Regards,
> Somi
>
>
> _____________________________________
> 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.html
>
> 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://www.itk.org/mailman/listinfo/insight-users
>
>


More information about the Insight-users mailing list