[Insight-users] Filters for converting images to regular or irregular grids

Karthik Krishnan karthik.krishnan at kitware.com
Sun Nov 11 11:00:23 EST 2007


On 11/11/07, Ali - <saveez at hotmail.com> wrote:
>
>
> Luis and Karthik,
>
> Thanks for the hints.
>
> (1) Both of the filters that you pointed out were drived from
> itk::ImageToMeshFilter, where one of them
> (itk::BinaryMaskToNarrowBandPointSetFilter) seems to make no use of mesh and
> is effectively an image-to-pointset filter. Just for the sake of efficiency,
> is there reasons at all for not having an itk::ImageToPointset super-class?
>

I don't see an immediate utility in having a itk::ImageToPointSet superclass
? An itk::Mesh is a subclass of the PointSet. Unless you provide topological
information, it pretty much is a PointSet.

(2) Consider a 2D gray-scale image of 512 x 512 size and assume that we want
> to 'sample' this image by smaller sub-regions of, say, 32 x 32 size and
> find, say, the mean value of pixels inside these sub-regions and store the
> result in a point located in the centre of the sub-region. The sub-regions
> may be overlapped, eg by 50% or so. Moreover, each point should store the
> information about the sub-region it represents, eg by an itk::ImageRegion
> type. I am not sure if having the use of itk::Mesh and its cells would be of
> help in designing such a filter. Could you confirm that there is no similar
> filter that 'samples' sub-regions and calculates and stores some statistics
> in the way described here? The closest that I could find was the label
> objects statistics descriptors submitted to IJ by Gaëtan Lehmann, however,
> labels are a little bit different creatures compared to the discussed
> overlapped sub-regions.
>

You need to find a data-structure to model your information.

- If your information can be represented as lying on a regular grid, then
you can use an itk::Image< T >. What each of the grid points store is
irrelevant, since you can templated the images over your own pixel type
(which could itself be a class).

- If the points lie on an irregular grid, the only datastructure available
is a PointSet. This also can be templated over your own PixelType (could be
a class again).

-- 
Karthik Krishnan
R&D Engineer,
Kitware Inc.

PS: If you write a class for a non-native PixelType, you'll have to provide
traits and operators for it.


>
> >
> > Hi Ali,
> >
> > Yes there are ITK filters that take as input an itkImage
> > and produce a PointSet as output.
> >
> > See for example:
> >
> > itkBinaryMaskToNarrowBandPointSetFilter
> >
> http://www.itk.org/Insight/Doxygen/html/classitk_1_1BinaryMaskToNarrowBandPointSetFilter.html
> >
> > the itkPointSet class has data associated to points and data associated
> > to cells. The type of the data is one of the template parameters defined
> > in the MeshTraits.
> >
> >
> > Note that in this case, the output is a topologically disconnected
> > set of points, but you could have created cells between these points
> > and generated an itkMesh instead.
> >
> > You may want to look a the souce code of this filter
> > in Code/BasicFilters
> >
> > and to look at the ITK Software Guide
> >
> >
> > http://www.itk.org/ItkSoftwareGuide.pdf
> >
> >
> > in particular to the "Data Representation" Chapter and
> > its section on the PointSet and the Mesh classes.
> >
> >
> > Regards,
> >
> >
> > Luis
> >
> >
> > ----------------
> > Ali - wrote:
> > > Hi,
> > >
> > > Assume an image filter which takes an ordinary gray-scale image as
> input
> > > and generated a set of 'points' as output. For instance, consider a
> > > binary thresholding filter where the output is supposed to be the 2D
> > > positions or the pixel intensity of the centriods. In this case the
> > > positions of the centriods form an irregular grid, however, this
> > > question also involves structured grids.
> > >
> > > Is there any available filters in ITK which can convert an image to a
> > > grid where each grid point can hold a scalar or vector value?
> > >
> > > If not, one way of implementing this could be by using a storing the
> > > grid points in an ordinary image, where the non-grid points must be
> > > marked with a data type which is different to the pixel value type.
> Some
> > > high-level languages support things like 'not-a-number' which are
> useful
> > > in a case like this, but I am not sure if this is supported in ITK.
> > >
> > > _______________________________________________
> > > Insight-users mailing list
> > > Insight-users at itk.org
> > > http://www.itk.org/mailman/listinfo/insight-users
>
> ------------------------------
> Do you know a place like the back of your hand? Share local knowledge with
> BackOfMyHand.com <http://www.backofmyhand.com>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/insight-users/attachments/20071111/62df8b4b/attachment.html


More information about the Insight-users mailing list