<div dir="ltr">Thank you dzenanz</div><span>
</span><br><div class="gmail_quote"><div dir="ltr">On Fri, 16 Sep 2016, 01:06 Dženan Zukić, <<a href="mailto:dzenanz@gmail.com" target="_blank">dzenanz@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">Hi Swetha,</div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">since NIFTI has a binary header, I guess someone confusingly dumped NIFTI header in text format and renamed that .mhd. That is neither valid MHD nor NIFTI. In short, it is a corrupted file.</div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">Regards,</div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">Dženan</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Sep 15, 2016 at 9:11 AM, Swetha Sharma <span dir="ltr"><<a href="mailto:swetha.bsharma@gmail.com" target="_blank">swetha.bsharma@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><p dir="ltr">I am trying to read the file using an application outside <a href="http://itk.it" target="_blank">itk.it</a> can read the regular .mhd but it failed when I input this.</p>
<p dir="ltr"> When I investigated the header I found these tags hence the post<br>
</p><div><div>
<br><div class="gmail_quote"><div dir="ltr">On Thu, 15 Sep 2016, 18:37 Lowekamp, Bradley (NIH/NLM/LHC) [C], <<a href="mailto:blowekamp@mail.nih.gov" target="_blank">blowekamp@mail.nih.gov</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">MetaIO does not have many formal fields. Those that are defined are here:<br>
<br>
<a href="https://itk.org/Wiki/ITK/MetaIO/Documentation" rel="noreferrer" target="_blank">https://itk.org/Wiki/ITK/MetaIO/Documentation</a><br>
<br>
MetaIO Image from ITK also writes out the ITK's Meta Data Dictionary along with the image. The dictionary can contain arbitrary information. These fields looks like they came from a NIFT file:<br>
<br>
<a href="https://brainder.org/2012/09/23/the-nifti-file-format/" rel="noreferrer" target="_blank">https://brainder.org/2012/09/23/the-nifti-file-format/</a><br>
<br>
It is generally more productive to learn how to use existing libraries as opposed to hacking your own for IO. This help ensure that everyones files are compatible and usable.<br>
<br>
HTH,<br>
Brad<br>
<br>
> On Sep 15, 2016, at 3:26 AM, swetha <<a href="mailto:swetha.bsharma@gmail.com" target="_blank">swetha.bsharma@gmail.com</a>> wrote:<br>
><br>
> Hi,<br>
><br>
>  I have this mhd file header<br>
><br>
> ObjectType = Image<br>
> NDims = 3<br>
> BinaryData = True<br>
> BinaryDataByteOrderMSB = False<br>
> CompressedData = False<br>
> TransformMatrix = 1 0 0 0 1 0 0 0 1<br>
> Offset = 0 0 0<br>
> CenterOfRotation = 0 0 0<br>
> AnatomicalOrientation = RAI<br>
> ElementSpacing = 1 1 1<br>
> bitpix = 8<br>
> cal_max = 256<br>
> cal_min = 0<br>
> datatype = 2<br>
> dim[0] = 4<br>
> dim[1] = 480<br>
> dim[2] = 480<br>
> dim[3] = 256<br>
> dim[4] = 1<br>
> dim[5] = 1<br>
> dim[6] = 0<br>
> dim[7] = 0<br>
> dim_info =<br>
> intent_code = 0<br>
> intent_p1 = 1.86143e+034<br>
> intent_p2 = 0<br>
> intent_p3 = 0<br>
> pixdim[0] = 0<br>
> pixdim[1] = 1<br>
> pixdim[2] = 1<br>
> pixdim[3] = 1<br>
> pixdim[4] = 0<br>
> pixdim[5] = 0<br>
> pixdim[6] = 0<br>
> pixdim[7] = 0<br>
> qform_code = 0<br>
> qoffset_x = 0<br>
> qoffset_y = 0<br>
> qoffset_z = 0<br>
> quatern_b = 0<br>
> quatern_c = 0<br>
> quatern_d = 0<br>
> scl_inter = 0<br>
> scl_slope = 1<br>
> sform_code = 0<br>
> slice_code =<br>
> slice_duration = 0<br>
> slice_end = 0<br>
> slice_start = 0<br>
> srow_x = 0 0 0 0<br>
> srow_y = 0 0 0 0<br>
> srow_z = 0 0 0 0<br>
> toffset = 0<br>
> vox_offset = 0<br>
> xyzt_units =<br>
> DimSize = 480 480 256<br>
> ElementType = MET_SHORT<br>
> ElementDataFile = usg2_-2.raw<br>
><br>
> I want to know what the tags mean so that i can write a function to parse<br>
> and display the image.<br>
> -swetha<br>
><br>
><br>
><br>
><br>
> --<br>
> View this message in context: <a href="http://itk-insight-users.2283740.n2.nabble.com/itk-mhd-header-tp7589210.html" rel="noreferrer" target="_blank">http://itk-insight-users.2283740.n2.nabble.com/itk-mhd-header-tp7589210.html</a><br>
> Sent from the ITK Insight Users mailing list archive at Nabble.com.<br>
> _____________________________________<br>
> Powered by <a href="http://www.kitware.com" rel="noreferrer" 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" rel="noreferrer" 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" rel="noreferrer" 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" rel="noreferrer" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
><br>
> Follow this link to subscribe/unsubscribe:<br>
> <a href="http://public.kitware.com/mailman/listinfo/insight-users" rel="noreferrer" target="_blank">http://public.kitware.com/mailman/listinfo/insight-users</a><br>
<br>
</blockquote></div>
</div></div><br>_____________________________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" 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" rel="noreferrer" 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" rel="noreferrer" 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" rel="noreferrer" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/insight-users" rel="noreferrer" target="_blank">http://public.kitware.com/mailman/listinfo/insight-users</a><br>
<br></blockquote></div><br></div>
</blockquote></div>