[Mrtrix-discussion] Inputing own SH coefficents .img file

Evan Schwab eschwab3 at jhu.edu
Tue Sep 10 15:00:05 PDT 2013


Hi,

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.

Thanks so much,

Evan


To debug I did the following:

1) I first generate a CSD4.mif file properly by csdeconv.
2) I mrconvert the CSD4.mif to CSD4.img
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.
4) Then I write this new matrix as a analyze file with the same header
information as before.
5) I mrconvert my .img file to a new .mif file (using the -debug flag)

I get the following output:

$ mrconvert -info -debug CSD4_clsArray.img CSD4_clsArray.mif
mrconvert [DEBUG]: reading key/value file "/etc/mrtrix.conf"...
mrconvert [INFO]: opening image "CSD4_clsArray.img"...
mrconvert [DEBUG]: preparing file "./CSD4_clsArray.hdr"
mrconvert [DEBUG]: file "./CSD4_clsArray.hdr" mapped at 0x7feb2e267000,
size 348 (read-only)
mrconvert [INFO]: assuming Analyse images are encoded left to right
mrconvert [DEBUG]: preparing file "./CSD4_clsArray.img"
mrconvert [DEBUG]: unmapping file "./CSD4_clsArray.hdr"
mrconvert [DEBUG]: setting up image "CSD4_clsArray.img"...
mrconvert [DEBUG]: sanitising transformation matrix...
mrconvert [DEBUG]: setting up data increments for "CSD4_clsArray.img"...
mrconvert [DEBUG]: data increments initialised with start = 0, stride = [ 1
112 12544 815360 ]
mrconvert [DEBUG]: mapping image "CSD4_clsArray.img"...
mrconvert [DEBUG]: file "./CSD4_clsArray.img" mapped at 0x7feb2b206000,
size 3261440 (read-only)
mrconvert [DEBUG]: data mapper for image "CSD4_clsArray.img" mapped with
segment size = 12230400 (optimised)
mrconvert [INFO]: creating image "CSD4_clsArray.mif"...
mrconvert [DEBUG]: preparing file "./CSD4_clsArray.mif"
mrconvert [DEBUG]: setting up image "./CSD4_clsArray.mif"...
mrconvert [DEBUG]: sanitising transformation matrix...
mrconvert [DEBUG]: setting up data increments for "./CSD4_clsArray.mif"...
mrconvert [DEBUG]: data increments initialised with start = 0, stride = [ 1
112 12544 815360 ]
mrconvert [DEBUG]: mapping image "./CSD4_clsArray.mif"...
mrconvert [DEBUG]: file "./CSD4_clsArray.mif" mapped at 0x7feb2835e000,
size 48921913 (read-write)
mrconvert [DEBUG]: data mapper for image "./CSD4_clsArray.mif" mapped with
segment size = 12230400 (optimised)


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.

$ mrconvert -info -debug CSD4.img CSD42.mif
mrconvert [DEBUG]: reading key/value file "/etc/mrtrix.conf"...
mrconvert [INFO]: opening image "CSD4.img"...
mrconvert [DEBUG]: preparing file "./CSD4.hdr"
mrconvert [DEBUG]: file "./CSD4.hdr" mapped at 0x7f5bcdc81000, size 348
(read-only)
mrconvert [INFO]: assuming Analyse images are encoded left to right
mrconvert [DEBUG]: preparing file "./CSD4.img"
mrconvert [DEBUG]: unmapping file "./CSD4.hdr"
mrconvert [DEBUG]: setting up image "CSD4.img"...
mrconvert [DEBUG]: sanitising transformation matrix...
mrconvert [DEBUG]: setting up data increments for "CSD4.img"...
mrconvert [DEBUG]: data increments initialised with start = 0, stride = [ 1
112 12544 815360 ]
mrconvert [DEBUG]: mapping image "CSD4.img"...
(********) mrconvert [DEBUG]: file "./CSD4.img" mapped at 0x7f5bc8095000,
size 48921600 (read-only)
mrconvert [DEBUG]: data mapper for image "CSD4.img" mapped with segment
size = 12230400 (optimised)
mrconvert [INFO]: creating image "CSD42.mif"...
mrconvert [DEBUG]: preparing file "./CSD42.mif"
mrconvert [DEBUG]: setting up image "./CSD42.mif"...
mrconvert [DEBUG]: sanitising transformation matrix...
mrconvert [DEBUG]: setting up data increments for "./CSD42.mif"...
mrconvert [DEBUG]: data increments initialised with start = 0, stride = [ 1
112 12544 815360 ]
mrconvert [DEBUG]: mapping image "./CSD42.mif"...
mrconvert [DEBUG]: file "./CSD42.mif" mapped at 0x7f5bc51ed000, size
48921913 (read-write)
mrconvert [DEBUG]: data mapper for image "./CSD42.mif" mapped with segment
size = 12230400 (optimised)
mrconvert: copying data... 100%
mrconvert [INFO]: closing image "CSD4.img"...
mrconvert [DEBUG]: unmapping file "./CSD4.img"
mrconvert [INFO]: closing image "./CSD42.mif"...
mrconvert [DEBUG]: unmapping file "./CSD42.mif"
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.nitrc.org/pipermail/mrtrix-discussion/attachments/20130910/502a7846/attachment.html


More information about the Mrtrix-discussion mailing list