[Insight-users] MetaIO, large volume (>2GB) and HeaderSize

Simon Rit simon.rit at creatis.insa-lyon.fr
Thu Apr 18 12:03:42 EDT 2013


Sorry if I did not make myself clear: I have solutions for this (here
I used HeaderSize = -1), I'm actually reporting what I consider being
a bug! By the way, your solution will result in reading the whole
image, I would rather use Matt's solution which might read only what's
required.
Thank you for your help and sorry for not being clearer. If you
consider this a minor issue, I'll just keep in mind the limitation of
HeaderSize to 2GB. But my advice would be to consider replacing int by
something more robust, e.g., size_type...
Simon

On Thu, Apr 18, 2013 at 5:57 PM, Bradley Lowekamp
<blowekamp at mail.nih.gov> wrote:
> Hello Simon,
>
> If you need a quick way to mung an image file SimpleITK is very good for this purpose. In Python it'd just be:
>
> import SimpleITK as sitk
> img = sitk.ReadImage("myfile.mhd")
> sitk.WriteImage(img[:,:,-1], "outfile.mhd")
>
> Brad
>
> On Apr 18, 2013, at 11:16 AM, Simon Rit <simon.rit at creatis.insa-lyon.fr> wrote:
>
>> It is a lot handier to directly modify the header file rather than
>> adding an optional extract filter in my software with the gui (here,
>> http://vv.creatis.insa-lyon.fr/). And it does not change the fact that
>> this is a bug or a limitation of MetaIO...
>>
>> On Thu, Apr 18, 2013 at 5:07 PM, Matt McCormick
>> <matt.mccormick at kitware.com> wrote:
>>> Hi Simon,
>>>
>>> Hacking the .mhd file may not be a good way to select a slice.
>>> Instead, try something like
>>> http://www.itk.org/Doxygen/html/classitk_1_1ExtractImageFilter.html.
>>>
>>> MetaIO is maintained alongside ITK/VTK.
>>>
>>> HTH,
>>> Matt
>>>
>>> On Thu, Apr 18, 2013 at 2:55 PM, Simon Rit
>>> <simon.rit at creatis.insa-lyon.fr> wrote:
>>>> Hi,
>>>> I'm using the mhd format to read one slice of a 4GB raw volume. At
>>>> some point, I wanted to display the last slice of my volume so I put
>>>> "HeaderSize = -1" at the beginning of my mhd file which was pointing
>>>> to the raw data. Doing the same with the exact position, i.e.,
>>>> "HeaderSize = 4278190080" failed... I found out that m_HeaderSize is
>>>> an int in metaImage.cxx so the value is read as negative.
>>>> Is this a bug or a known limitation? In the second case, any
>>>> alternative suggestion? In the first case, where should I report this
>>>> since it's a third party library?
>>>> Thanks,
>>>> Simon
>>>> _____________________________________
>>>> 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.php
>>>>
>>>> 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
>> _____________________________________
>> 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.php
>>
>> 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