[MINC-users] negative zstep causes trouble

Andrew Janke a.janke at gmail.com
Tue Oct 4 23:22:03 EDT 2005


Hi Marc,

Looks like an "amusing" bug you have found...  Out of interest, what
does mincstats return on this file as the CoM?

As for +dimension not working, have a read of the man page for
mincreshape, there is some functionality left in mincreshape that
treats slice dimensions differently to image dimensions. I think this
should now be deprecated myself, but then that is just me.

The safest thing to do would be to reshape your data to have all
positive steps as such:  (note that this will not in any way cause
flips of the volume)

   mincreshape +direction \
      -dimsize zspace=-1 \
      -dimsize zspace=-1 \
      -dimsize zspace=-1 \
     <infile.mnc> <outfile.mnc>

Do this before any other processing.

the -1's indicate to flip the dimensions specified irrespective of
their position in the file. Still the minctracc bug should be fixed! 
Can I have a copy of the file you are using?  And which version of
minctracc are you using?


Andrew

On 29/09/05, Marc Schoenwiesner <marc.schoenwiesner at mcgill.ca> wrote:
> 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
> _______________________________________________
> MINC-users at bic.mni.mcgill.ca
> http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users
>


--
Andrew Janke      (a.janke at gmail.com || www.cmr.uq.edu.au/~rotor)
Canada->Montreal                                   Cell: +1 (514) 924 2012



More information about the MINC-users mailing list