[Insight-users] itk::SparseImage + binary images in general

BUI XUAN Viet V.Bui-Xuan at exeter.ac.uk
Wed Apr 6 08:25:38 EDT 2005


Hello everyone,
 
I was interested to see Robert's questions regarding the
itk::SparseImage. But if I understand Joshua's answer correctly, it
isn't the ideal solution. 
 
I'm also interested in ways of handling the type of images that Robert
described (binary volumes with a relatively small number of "on" voxels)
and binary images in general.
 
Setting aside the question of whether a compression scheme is more
efficient than another for a specific type of data, I would like to know
if there are ways to store data in a certain form (not as an itk::Image)
and use them transparently with itk.
 
I have the feeling that there are different levels at which the problem
can be handled:
 
====================
1/ Complete "solution" that allows to work with an itk pipeline and with
iterators to access pixels directly.
 
Ideally in this case the data never needs to be de-compressed (we never
need to re-create an itk::Image) and some intelligent iterators are able
to access a given voxel without creating the whole itk::Image.
====================
2/ Solution that allows to preserve the integrity of itk pipelines but
no direct iterator pixel access.
 
In this case, filters will need to decompress the data (create an
itk::Image) temporarily, which is what a user would have to do in order
to iterate through the data.
====================
3/ Solution only suitable for temporary data storage where the
"compressed" image needs to be decompressed manually every time if
access is needed (no itk pipeline support). 
====================
 
In the following mailing list entry Luis Ibanez also suggested a
solution:
http://www.itk.org/pipermail/insight-users/2003-December/005912.html
on how to store the data.
 
It seems to me that one solution suggested by Luis (1-bit or RLE
compressed structure) only deals with the 3rd case. It could be however
that the other solution, using the Brains2MaskImageIO (or any IO that
uses a suitable storage scheme and can read/write in a buffer), allows
storing the data in a way that would allow propagation of update calls
through the itk pipeline (2nd case).
 
I'm not sure however whether there is an elegant solution to the first
case.
 
>From what I understand from Joshua's reply, itk::SparseImage would fit
in the 3rd category (is that correct?) but would have little benefit for
binary images.
 
I've also noticed the existence of an itk::Octree class, but again, I'm
not sure how useful and how easy it would be to use. Depending in the
way it's implemented, it seems like it could only be used in the 3rd
case (temporary compressed data that needs to be manually un-compressed
everytime it needs to be used). But maybe it can be adapted to fit in
the 1st category? :)
 
Any suggestion or ideas or simply discussion on how best it would be to
tackle each "level" and/or what work's being done on the subject would
be very welcome.
 
Don't hesitate to correct me if my understanding made me say things that
make no sense!
 
Thanks
 
Viet
 
> Hi Robert,
> 
> The SparseImage is a full itk::Image of pointers which may be assigned
to dynamically allocated pixels as necessary, > and set to 0 where the
image has/needs no values.  Note that (1) this is only useful when the
pixel type is large > (e.g. long and/or dynamic length feature vectors)
and (2) ITK iterator and other image manipulators do not > transparently
handle this image representation, so your code will need to explicitly
manage this format. The sparse > image class was first developed for use
in a narrow band PDE solver where a relatively large vector of values is
> maintained only on pixels located in the band.
> 
> Josh.
> 
> ______________________________
>  Josh Cates                 
>  Scientific Computing and Imaging Institute
>  University of Utah
>  http://www.sci.utah.edu/~cates
> 
> 
> On Tue, 5 Apr 2005, Robert Maroon wrote:
> 
> > For very large binary volumes with a relatively small
> > number of "on" voxels, does ITK provide a data
> > structure for handling this type of image in a memory-efficient way 
> > (e.g., similar to Matlab's "sparse" matrix type)? Ideally, of
course, 
> > the fact that an image is sparse would be transparent to any
> > functions that manipulated it, and all iterators and
> > such would function as usual.
> > 
> > I found the SparseImage class, but I'm not sure if
> > this applies (also, there's very little information
> > about it on Google).
> > 
> > Thanks,
> > 
> > Robert
> > 
> > 
> > 
> >         
> > __________________________________
> > Yahoo! Messenger 
> > Show us what our next emoticon should look like. Join the fun. 
> > http://www.advision.webevents.yahoo.com/emoticontest
> > _______________________________________________
> > Insight-users mailing list
> > Insight-users at itk.org
> > http://www.itk.org/mailman/listinfo/insight-users
> > 
> 
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/insight-users/attachments/20050406/6873ec62/attachment.html


More information about the Insight-users mailing list