[MINC-users] negative zstep causes trouble

Marc Schoenwiesner marc.schoenwiesner at mcgill.ca
Thu Sep 29 19:58:34 EDT 2005


Hi,

I am struggling with the conversion/analysis of fMRI data from outside
BIC, but have located the problem more or less. Maybe someone knows about this.

Problem: fmr_preprocess crashes with a dynamic minc file.
The trouble maker is the positive zstep:
>>
file: run1.mncimage: signed__ short 0 to 4095
image dimensions: time zspace yspace xspace dimension name
length step start
    --------------         ------         ----        -----
    time                       71            9            0
    zspace                     19            4     -3.29857
    yspace                     64     -3.12497      95.4729
    xspace                     64     -3.12497      97.9577
>>

fmr_preprocess crashed when resampling the volume, because $nelem_z (resampling
steps in z direction) gets negative. I copied fmr_preprocess and added an abs()
to the 238 to make the calculation robust against positive zsteps:
    $nelem_z = abs (int ((($z_sp - 1) * $z_step ) / $resampling_step));

This step works now. The next hang is when minctracc is called. I found that
this is because the center of gravity of the volume seems to be either
incorrectly calculated by volume_cog, or minctracc cannot handle centroids in
certain quadrants.

center with zstep=4   0.912580 -4.248807  35.571903 (minctracc crashes)
center with zstep=-4 -0.077238 -9.411657 -41.277493 (works fine)

I can work around this problem by setting zstep to -4:
% minc_modify_header -dinsert zspace:step=4 run1.mnc
then run fmr_preprocess and setting it back, but this is ugly and I might mess
up my file orientations (this is a left-brain right-brain thing, so I really
don't want to risk anything of that sort. By the way, mincreshape +/-zdirection
doesn't seem to do anything at all with this file.)

volume_cog and mictracc are binary, so I am stuck here.
I'd be very grateful if anyone could clarify the centroid issue! I am new to the
BIC and MINC (had my first look at the software this week) and don't seem to be
able to get this straightened out myself.

Cheers
Marc


More information about the MINC-users mailing list