Hi Jason,<div><br></div><div>OK, if the issue isn't datatype-related (i.e. if a command like "mrconvert output.mif -datatype int16 output.nii" doesn't produce an image you can load in fslview), then the issue might be related to memory. How large is the image you're having trouble with? There's a good chance it won't load if it's larger than 2GB, and fslview is compiled in 32-bit mode. Also, can you confirm that fslview crashes with no other information than 'segmentation fault'? On my system, an unexpected datatype causes fslview to crash with a failed assertion message: </div>
<div><br></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><div><i>fslview: /usr/include/boost/smart_ptr/shared_ptr.hpp:418: T* boost::shared_ptr< <template-parameter-1-1> >::operator->() const [with T = OverlayList]: Assertion `px != 0' failed.</i></div>
</div></blockquote><div><div><br></div><div>which at least gives the <i>very</i> informed user some clue as to what might conceivable be the problem. A message such as 'std::bad_alloc' would already be a big clue...</div>
<div><br></div><div>Cheers,</div><div><br></div><div>Donald.</div><div><br></div><br><div class="gmail_quote">On 19 June 2012 08:21, Langley, Jason Allen <span dir="ltr"><<a href="mailto:jason.langley@emory.edu" target="_blank">jason.langley@emory.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>
<div style="direction:ltr;font-size:10pt;font-family:Tahoma">Hi Donald,
<br>
<br>
Oddly enough, the issue only occurs with the fraction images (connectivity / TDI maps?). I am able to convert other .mif images (FA maps for example) to .nii and read those images into FSL or other imaging programs. The segmentation fault only occurs when I
convert a fraction image from .mif to .nii . I have tried all of the datatype options listed in the source of mrconvert.cpp and none seem to work.
<br>
<br>
I have noticed some issues between the other .mif images and the fraction images. When looking at the images in a hex editor, the FA maps (and other .mif images) seem to have nonzero values in each byte where as in the fraction image, only the first byte in
each group is nonzero. I have attached an image that illustrates this with a FA map (in the terminal on the left) and a fraction image (in the terminal on the right). However, I am not sure if this is an issue.
<br>
<br>
Best,<br>
Jason<br>
<div style="font-size:16px;font-family:Times New Roman">
<hr>
<div style="direction:ltr"><font color="#000000" face="Tahoma"><b>From:</b> Donald Tournier [<a href="mailto:d.tournier@brain.org.au" target="_blank">d.tournier@brain.org.au</a>]<br>
<b>Sent:</b> Sunday, June 17, 2012 8:25 PM<br>
<b>To:</b> Langley, Jason Allen<br>
<b>Subject:</b> Re: Converting Fraction Images to Nifti<br>
</font><br>
</div><div><div class="h5">
<div></div>
<div>Hi Jason,
<div><br>
</div>
<div>This is not an uncommon issue. Basically, most packages don't support the full set of datatypes allowed in the NIfTI specification, whereas MRtrix does. If it produces an image using one of those datatypes, other packages won't be able to handle it. In
the case of FSL, rather than detecting this case and reporting it, it typically just segfaults without any useful information. In any case, you can easily get around this using the -datatype option of mrconvert, with a datatype supported by FSL. In my experience,
the set of datatypes that will work are: uint8, int16, int32, float32 & float64. </div>
<div><br>
On a different note: can I ask you to post these kinds of questions on the MRtrix mailing list? You can find it at: <a href="http://www.nitrc.org/mailman/listinfo/mrtrix-discussion" target="_blank">http://www.nitrc.org/mailman/listinfo/mrtrix-discussion</a>.
This way other users might also benefit...<br>
<br>
Hope this helps.</div>
<div>Cheers,</div>
<div><br>
</div>
<div>Donald.</div>
<div><br>
<br>
<div class="gmail_quote">On 16 June 2012 02:24, Langley, Jason Allen <span dir="ltr">
<<a href="mailto:jason.langley@emory.edu" target="_blank">jason.langley@emory.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>
<div style="direction:ltr;font-size:10pt;font-family:Tahoma">Dear Donald,<br>
<br>
I'm having issues reading converted fraction images. My processing steps are as follows:
<br>
(1) Preprocessing and then fibre tracking using streamtrack<br>
(2) Creation of the fraction image from the tracks using tracks2prob<br>
(3) Conversion of the fraction image from .mif to .nii using mrconvert<br>
<br>
After the conversion, I am unable to read the resultant .nii file in FSL, Afni, SPM, ... . For example, if I use fslview to read the converted fraction image, an error saying 'Segmentation fault' will appear in the terminal.
<br>
<br>
So far, I've only had this issue with the fraction images and other images (FA maps, masks, etc) that I convert can be read in other viewers. Do you have any thoughts / solutions to this issue?
<br>
<br>
Thanks,<br>
Jason<br>
</div>
<br>
<hr>
<font color="Gray" face="Arial" size="1"><br>
This e-mail message (including any attachments) is for the sole use of<br>
the intended recipient(s) and may contain confidential and privileged<br>
information. If the reader of this message is not the intended<br>
recipient, you are hereby notified that any dissemination, distribution<br>
or copying of this message (including any attachments) is strictly<br>
prohibited.<br>
<br>
If you have received this message in error, please contact<br>
the sender by reply e-mail message and destroy all copies of the<br>
original message (including attachments).<br>
</font></div>
</blockquote>
</div>
<br>
<br clear="all">
<div><br>
</div>
-- <br>
Jacques-Donald Tournier (PhD)<br>
Brain Research Institute, Melbourne, Australia<br>
Tel: +61 (0)3 9035 7033<br>
</div>
</div>
</div></div></div>
</div>
</div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>Jacques-Donald Tournier (PhD)<br>Brain Research Institute, Melbourne, Australia<br>Tel: +61 (0)3 9035 7033<br>
</div>