[ITK] [ITK-users] Small gaussian sphere iterator over 3D image
Leslie Solorzano
lesolorzanov at gmail.com
Tue Mar 31 11:58:32 EDT 2015
Thank you.
I investigated a lot these days and played with different things. I read
the Software guide for ITK 4.7 and found interesting things and I will
leave them here and also give the solution to my problem but in 2D.
Firstly I thought of making the sphere discretization myself and use a
simple ImageIterator as in section 4.1 in the software guide.
Then I got to the spatial objects and I had fun tweaking around with
EllipseSpatialObject and GaussianSpatialObjects and learned how to save
them to an image. SpatialObjects have a pretty neat feature that lets you
calculate simple statistics inside it
using SpatialObjectToImageStatisticsCalculator.
The code that helped me the most is here
http://www.itk.org/Wiki/ITK/Examples/Iterators/ShapedNeighborhoodIterator
I uploaded code I've been playing with here:
https://github.com/zloysmiertniy/itk-arena/blob/master/GaussianToImage.cxx
https://github.com/zloysmiertniy/itk-arena/blob/master/ShapedNeighborhoodIterator.cxx
Finally I guess I will be using ShapedNeighborhoodIterator and change its
location everytime, calculate, and set the value in the output image.
Thankyou very much Matt and Bill for the links.
Leslie
2015-03-30 19:59 GMT+02:00 Bill Lorensen <bill.lorensen at gmail.com>:
> These examples may help:
> http://itk.org/Wiki/ITK/Examples/Iterators/ShapedNeighborhoodIterator
> http://itk.org/Wiki/ITK/Examples/Iterators/ShapedNeighborhoodIteratorManual
>
>
> On Mon, Mar 30, 2015 at 6:58 AM, Matt McCormick
> <matt.mccormick at kitware.com> wrote:
> > Hi Leslie,
> >
> > The ShapedNeighborhoodIterator allows activations of a box of voxels
> > within a given radii.
> >
> > For your operation, you may want to investigate the
> > NeighborhoodOperator and related classes [1].
> >
> > More information on how to use neighborhood classes can be found in
> > the ITK Software Guide (see itk.org for links to both the electronic
> > and hard copy versions).
> >
> > Hope this helps,
> > Matt
> >
> >
> > [1]
> http://www.itk.org/Doxygen/html/classitk_1_1NeighborhoodOperator.html
> >
> > On Mon, Mar 30, 2015 at 9:15 AM, Leslie Solorzano
> > <lesolorzanov at gmail.com> wrote:
> >> I am aware of the existance of ShapedNeighborhoodIterator. But I don't
> >> understand how to use it.
> >> I have a 3D image and I would like to iterate trought it and calculate a
> >> value according to a guassian sphere centered at each voxel.
> >>
> >> I don't understand if the shaped iterator makes a box with given radii
> (or
> >> offsets), or it makes an ellipse with given offsets.
> >>
> >> My sphere is very small, a 4 voxel raidus (7 maximum), and I'd like the
> >> values farthest from the center weight less in my sum, thus the
> gaussian.
> >>
> >> So it is pretty simple, make a shapedneighborhooditerator to be a
> sphere,
> >> iterate and keep each value as the weighted sum of the values in its
> >> neighbors in a 3D image, can some point me in the right direction?
> >>
> >> Thankyou
> >>
> >> _______________________________________________
> >> Community mailing list
> >> Community at itk.org
> >> http://public.kitware.com/mailman/listinfo/community
> >>
> > _______________________________________________
> > Community mailing list
> > Community at itk.org
> > http://public.kitware.com/mailman/listinfo/community
>
>
>
> --
> Unpaid intern in BillsBasement at noware dot com
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/community/attachments/20150331/302dadbf/attachment.html>
More information about the Community
mailing list