<div dir="ltr">Hi,<div><br></div><div style>Thank you very much in advance. I am trying to visualize my own ODFs with my own calculated coefficients for the SH basis. I create an analyze file and try to mrconvert to a .mif file but I get a segmentation fault. Can you please help me to understand what I'm doing wrong? My debugging process and output is outlined below.</div>
<div style><br></div><div style>Thanks so much,</div><div style><br></div><div style>Evan</div><div style><br></div><div style><br></div><div style>To debug I did the following:</div><div style><br></div><div style>1) I first generate a CSD4.mif file properly by csdeconv.</div>
<div style>2) I mrconvert the CSD4.mif to CSD4.img</div><div style>3) I read the analyze file into matlab and replace the .img with my own 4D coefficient matrix. For debugging purposes I use here a matrix of all zeros.</div>
<div style>4) Then I write this new matrix as a analyze file with the same header information as before.</div><div style>5) I mrconvert my .img file to a new .mif file (using the -debug flag)</div><div style><br></div><div style>
I get the following output:</div><div style><br></div><div style><div>$ mrconvert -info -debug CSD4_clsArray.img CSD4_clsArray.mif</div><div>mrconvert [DEBUG]: reading key/value file "/etc/mrtrix.conf"...</div><div>
mrconvert [INFO]: opening image "CSD4_clsArray.img"...</div><div>mrconvert [DEBUG]: preparing file "./CSD4_clsArray.hdr"</div><div>mrconvert [DEBUG]: file "./CSD4_clsArray.hdr" mapped at 0x7feb2e267000, size 348 (read-only)</div>
<div>mrconvert [INFO]: assuming Analyse images are encoded left to right</div><div>mrconvert [DEBUG]: preparing file "./CSD4_clsArray.img"</div><div>mrconvert [DEBUG]: unmapping file "./CSD4_clsArray.hdr"</div>
<div>mrconvert [DEBUG]: setting up image "CSD4_clsArray.img"...</div><div>mrconvert [DEBUG]: sanitising transformation matrix...</div><div>mrconvert [DEBUG]: setting up data increments for "CSD4_clsArray.img"...</div>
<div>mrconvert [DEBUG]: data increments initialised with start = 0, stride = [ 1 112 12544 815360 ]</div><div>mrconvert [DEBUG]: mapping image "CSD4_clsArray.img"...</div><div>mrconvert [DEBUG]: file "./CSD4_clsArray.img" mapped at 0x7feb2b206000, size 3261440 (read-only)</div>
<div>mrconvert [DEBUG]: data mapper for image "CSD4_clsArray.img" mapped with segment size = 12230400 (optimised)</div><div>mrconvert [INFO]: creating image "CSD4_clsArray.mif"...</div><div>mrconvert [DEBUG]: preparing file "./CSD4_clsArray.mif"</div>
<div>mrconvert [DEBUG]: setting up image "./CSD4_clsArray.mif"...</div><div>mrconvert [DEBUG]: sanitising transformation matrix...</div><div>mrconvert [DEBUG]: setting up data increments for "./CSD4_clsArray.mif"...</div>
<div>mrconvert [DEBUG]: data increments initialised with start = 0, stride = [ 1 112 12544 815360 ]</div><div>mrconvert [DEBUG]: mapping image "./CSD4_clsArray.mif"...</div><div>mrconvert [DEBUG]: file "./CSD4_clsArray.mif" mapped at 0x7feb2835e000, size 48921913 (read-write)</div>
<div>mrconvert [DEBUG]: data mapper for image "./CSD4_clsArray.mif" mapped with segment size = 12230400 (optimised)</div><div><br></div><div><br></div><div style>As well I have the output when I mrconvert the original CSD4.img back to .mif and the only difference is the line I have labeled as (********) related to the size of the file.</div>
<div style><br></div><div style><div>$ mrconvert -info -debug CSD4.img CSD42.mif</div><div>mrconvert [DEBUG]: reading key/value file "/etc/mrtrix.conf"...</div><div>mrconvert [INFO]: opening image "CSD4.img"...</div>
<div>mrconvert [DEBUG]: preparing file "./CSD4.hdr"</div><div>mrconvert [DEBUG]: file "./CSD4.hdr" mapped at 0x7f5bcdc81000, size 348 (read-only)</div><div>mrconvert [INFO]: assuming Analyse images are encoded left to right</div>
<div>mrconvert [DEBUG]: preparing file "./CSD4.img"</div><div>mrconvert [DEBUG]: unmapping file "./CSD4.hdr"</div><div>mrconvert [DEBUG]: setting up image "CSD4.img"...</div><div>mrconvert [DEBUG]: sanitising transformation matrix...</div>
<div>mrconvert [DEBUG]: setting up data increments for "CSD4.img"...</div><div>mrconvert [DEBUG]: data increments initialised with start = 0, stride = [ 1 112 12544 815360 ]</div><div>mrconvert [DEBUG]: mapping image "CSD4.img"...</div>
<div>(********) mrconvert [DEBUG]: file "./CSD4.img" mapped at 0x7f5bc8095000, size 48921600 (read-only)</div><div>mrconvert [DEBUG]: data mapper for image "CSD4.img" mapped with segment size = 12230400 (optimised)</div>
<div>mrconvert [INFO]: creating image "CSD42.mif"...</div><div>mrconvert [DEBUG]: preparing file "./CSD42.mif"</div><div>mrconvert [DEBUG]: setting up image "./CSD42.mif"...</div><div>mrconvert [DEBUG]: sanitising transformation matrix...</div>
<div>mrconvert [DEBUG]: setting up data increments for "./CSD42.mif"...</div><div>mrconvert [DEBUG]: data increments initialised with start = 0, stride = [ 1 112 12544 815360 ]</div><div>mrconvert [DEBUG]: mapping image "./CSD42.mif"...</div>
<div>mrconvert [DEBUG]: file "./CSD42.mif" mapped at 0x7f5bc51ed000, size 48921913 (read-write)</div><div>mrconvert [DEBUG]: data mapper for image "./CSD42.mif" mapped with segment size = 12230400 (optimised)</div>
<div>mrconvert: copying data... 100%</div><div>mrconvert [INFO]: closing image "CSD4.img"...</div><div>mrconvert [DEBUG]: unmapping file "./CSD4.img"</div><div>mrconvert [INFO]: closing image "./CSD42.mif"...</div>
<div>mrconvert [DEBUG]: unmapping file "./CSD42.mif"</div><div><br></div></div></div></div>