[Insight-users] sparse images?
Bradley Lowekamp
blowekamp at mail.nih.gov
Thu Nov 5 10:49:39 EST 2009
Hello,
There is an article I wrote for the Kitware Source that is useful if
you want to do IO Streaming:
http://www.kitware.com/products/archive/kitware_quarterly0409.pdf
And it's related example in:
Insight/Examples/IO/VisibleHumanStreamReadWrite.cxx
Currently metaIO is the only format to fully support streaming IO. So
you will need to use an mha (or mhd) file extension.
To enable streaming IO, you simple need to have a file format which
supports it and the call
ImageFileWriter::SetNumerOfStreamDivisions( unsigned int )
For this parameter the number of z-slices frequently works well, which
can be obtained after
ImageFileReader::GenerateOutputInformation( )
has been called. Then accessing the LargestPossibleRegion.
Hope this helps,
Brad
On Nov 5, 2009, at 4:24 AM, Dan Mueller wrote:
> Hi Darren,
>
> Reading your email again, perhaps I jumped the gun a bit by suggesting
> the sparse image. The sparse image is designed for images which have a
> few relevant pixels, but the rest background (ie. you don't set all
> the pixels, just a few here and there).
>
> If you need to process an entire image, then I think ITK's read/write
> streaming feature will better suit your needs (assuming you can break
> your processing into chunks).
> http://www.cmake.org/pipermail/insight-users/2002-May/000472.html
> http://www.itk.org/Doxygen/html/StreamingPage.html
> http://www.itk.org/Doxygen/html/group__StreamingGroup.html
> http://www.insight-journal.org/browse/publication/305
>
> Please provide an exact overview of what you are trying to achieve, so
> we can help determine the best approach.
>
> Cheers, Dan
>
> 2009/11/5 Darren Weber <darren.weber.lists at gmail.com>:
>>
>> Hi Dan,
>>
>> The proposal is very interesting. Having read the PDF, I'll take a
>> look at
>> the code. I may be able to offer a review (time permitting).
>>
>> Do you have any recent examples of using either the SliceContiguous
>> or the
>> Sparse images to compose a 3D volume from a series of 2D image
>> files? Do
>> you somehow
>>
>> a) Allocate the custom image memory (if known size & pixtype)
>> b) Create an IO object to read data from an image file
>> c) manually iterate over the IO object data with Get/Set accessors
>> to put
>> data into custom image memory
>> d) Filter, etc. (if possible)
>> e) Write out image data to disk (somehow)
>>
>> I can take the performance hit for the sparse image with Setting
>> values.
>>
>> Should I be looking into streaming data models? Essentially all I
>> need to
>> do is stream a set of 2D input data straight out to a 3D output
>> data file.
>> I'm currently using a series reader (with a regex to define the image
>> series) and piping it straight to a writer (with vtkIO for the
>> writer). If
>> a streaming model is available for this data transfer, it might
>> avoid the
>> segfaults due to allocation limits (I have plenty of disk space,
>> just not
>> enough RAM).
>>
>> Thanks!
>> Darren
>>
>>
>>
>>
>>
>> On Wed, Nov 4, 2009 at 1:54 PM, Dan Mueller <dan.muel at gmail.com>
>> wrote:
>>>
>>> Hi Darren,
>>>
>>> You might want to investigate the following Insight Journal
>>> submission:
>>> http://www.insight-journal.org/browse/publication/646
>>>
>>> <shameless plug>
>>> Make sure you leave a review!
>>> </shameless plug>
>>>
>>> Cheers, Dan
>>>
>>> 2009/11/4 Darren Weber <darren.weber.lists at gmail.com>:
>>>>
>>>> I'm working with a very large dataset (1000's of 2D images, size >
>>>> 1024x1024
>>>> pixels, ushort RGB pixels). A large portion of these images is
>>>> background.
>>>>
>>>> A few routines, like saving all the 2D images into a 3D volume,
>>>> fail
>>>> with
>>>> segfaults due to malloc errors (on OSX 10.5.8 with 24Gb RAM;
>>>> using ITK
>>>> 3.16.0).
>>>>
>>>> Is there an image format that provides 'sparse' images? This
>>>> implies
>>>> there
>>>> are no data values for some of the image pixels (is this the same
>>>> thing
>>>> as
>>>> transparent background?).
>>>>
>>>> What is an optimal image format for working with this data?
>>>>
>>>> Thanks in advance (TIA),
>>>> Darren
> _____________________________________
> 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
========================================================
Bradley Lowekamp
Lockheed Martin Contractor for
Office of High Performance Computing and Communications
National Library of Medicine
blowekamp at mail.nih.gov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20091105/149bff3b/attachment.htm>
More information about the Insight-users
mailing list