<div dir="ltr">Looks like a bug to me.<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Apr 18, 2013 at 12:03 PM, Simon Rit <span dir="ltr"><<a href="mailto:simon.rit@creatis.insa-lyon.fr" target="_blank">simon.rit@creatis.insa-lyon.fr</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Sorry if I did not make myself clear: I have solutions for this (here<br>
I used HeaderSize = -1), I'm actually reporting what I consider being<br>
a bug! By the way, your solution will result in reading the whole<br>
image, I would rather use Matt's solution which might read only what's<br>
required.<br>
Thank you for your help and sorry for not being clearer. If you<br>
consider this a minor issue, I'll just keep in mind the limitation of<br>
HeaderSize to 2GB. But my advice would be to consider replacing int by<br>
something more robust, e.g., size_type...<br>
<span class="HOEnZb"><font color="#888888">Simon<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
On Thu, Apr 18, 2013 at 5:57 PM, Bradley Lowekamp<br>
<<a href="mailto:blowekamp@mail.nih.gov">blowekamp@mail.nih.gov</a>> wrote:<br>
> Hello Simon,<br>
><br>
> If you need a quick way to mung an image file SimpleITK is very good for this purpose. In Python it'd just be:<br>
><br>
> import SimpleITK as sitk<br>
> img = sitk.ReadImage("myfile.mhd")<br>
> sitk.WriteImage(img[:,:,-1], "outfile.mhd")<br>
><br>
> Brad<br>
><br>
> On Apr 18, 2013, at 11:16 AM, Simon Rit <<a href="mailto:simon.rit@creatis.insa-lyon.fr">simon.rit@creatis.insa-lyon.fr</a>> wrote:<br>
><br>
>> It is a lot handier to directly modify the header file rather than<br>
>> adding an optional extract filter in my software with the gui (here,<br>
>> <a href="http://vv.creatis.insa-lyon.fr/" target="_blank">http://vv.creatis.insa-lyon.fr/</a>). And it does not change the fact that<br>
>> this is a bug or a limitation of MetaIO...<br>
>><br>
>> On Thu, Apr 18, 2013 at 5:07 PM, Matt McCormick<br>
>> <<a href="mailto:matt.mccormick@kitware.com">matt.mccormick@kitware.com</a>> wrote:<br>
>>> Hi Simon,<br>
>>><br>
>>> Hacking the .mhd file may not be a good way to select a slice.<br>
>>> Instead, try something like<br>
>>> <a href="http://www.itk.org/Doxygen/html/classitk_1_1ExtractImageFilter.html" target="_blank">http://www.itk.org/Doxygen/html/classitk_1_1ExtractImageFilter.html</a>.<br>
>>><br>
>>> MetaIO is maintained alongside ITK/VTK.<br>
>>><br>
>>> HTH,<br>
>>> Matt<br>
>>><br>
>>> On Thu, Apr 18, 2013 at 2:55 PM, Simon Rit<br>
>>> <<a href="mailto:simon.rit@creatis.insa-lyon.fr">simon.rit@creatis.insa-lyon.fr</a>> wrote:<br>
>>>> Hi,<br>
>>>> I'm using the mhd format to read one slice of a 4GB raw volume. At<br>
>>>> some point, I wanted to display the last slice of my volume so I put<br>
>>>> "HeaderSize = -1" at the beginning of my mhd file which was pointing<br>
>>>> to the raw data. Doing the same with the exact position, i.e.,<br>
>>>> "HeaderSize = 4278190080" failed... I found out that m_HeaderSize is<br>
>>>> an int in metaImage.cxx so the value is read as negative.<br>
>>>> Is this a bug or a known limitation? In the second case, any<br>
>>>> alternative suggestion? In the first case, where should I report this<br>
>>>> since it's a third party library?<br>
>>>> Thanks,<br>
>>>> Simon<br>
>>>> _____________________________________<br>
>>>> Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
>>>><br>
>>>> Visit other Kitware open-source projects at<br>
>>>> <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
>>>><br>
>>>> Kitware offers ITK Training Courses, for more information visit:<br>
>>>> <a href="http://www.kitware.com/products/protraining.php" target="_blank">http://www.kitware.com/products/protraining.php</a><br>
>>>><br>
>>>> Please keep messages on-topic and check the ITK FAQ at:<br>
>>>> <a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
>>>><br>
>>>> Follow this link to subscribe/unsubscribe:<br>
>>>> <a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
>> _____________________________________<br>
>> Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
>><br>
>> Visit other Kitware open-source projects at<br>
>> <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
>><br>
>> Kitware offers ITK Training Courses, for more information visit:<br>
>> <a href="http://www.kitware.com/products/protraining.php" target="_blank">http://www.kitware.com/products/protraining.php</a><br>
>><br>
>> Please keep messages on-topic and check the ITK FAQ at:<br>
>> <a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
>><br>
>> Follow this link to subscribe/unsubscribe:<br>
>> <a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
><br>
_____________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at<br>
<a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Kitware offers ITK Training Courses, for more information visit:<br>
<a href="http://www.kitware.com/products/protraining.php" target="_blank">http://www.kitware.com/products/protraining.php</a><br>
<br>
Please keep messages on-topic and check the ITK FAQ at:<br>
<a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Unpaid intern in BillsBasement at noware dot com<br>
</div>