[MINC-development] mincfft. was: [geeks] vector_diemsion and rawtominc

Andrew Janke minc-development@bic.mni.mcgill.ca
Thu, 21 Nov 2002 11:58:01 +1000


On Sun, 3 Nov 2002, Peter NEELIN wrote:

> > Now of course the simple fix might be to modify mincfft to use
> > MIvector_dimension but It did seem nice at the time to use complex_vector.
>
> Hmmm... I had not realized this. Your image dimensions, according to the
> minc convention (which is pretty loose, but not on this point), are
> "xspace" and "complex_vector". I suspect that you really want them to be
> "yspace", "xspace" and "vector_dimension". The magic of three image
> dimensions only happens when the last (fastest varying) dimension is
> called "vector_dimension". In other words, mincfft is not minc compliant.
> Although there is currently no mechanism in minc to identify how vector
> data should be interpreted (rgb colour, complex values, displacements,
> etc.), it is at the very least guaranteed to be identifiable in compliant
> minc files by the existence of a dimension named "vector_dimension". Any
> other name means that the data is scalar and the dimension is a parameter-
> space dimension.

OK, I have bowwed under the pressure and have fixed the version of mincfft in
cvs (/s/s/minc_dev/mincfft) to now use MIvector_dimension.  I have also updated
the 2D fft option to the point that it now should be correct and a whole lot
less memory hungry.  At some stage I should re-write large slabs of it and
remove the dependance on volume_io (there is no real need for it) but that's a
job for another day....:)

But now I have a question: I know volume_io handles vector volumes differently
but is this to the point where it thinks a 3spatial + vector file has 3
dimensions only?  try this:

   $ mincfft -2D -centre <3D_minc_file.mnc> fft.mnc

All is fine, fft.mnc is a 4D file. (-centre shifts the fft result to the middle
of the volume to make it more easily human grokkable)

   $ mincfft -2D -inverse fft.mnc -magnitude mag.mnc -phase phase.mnc
   Error: MINC file has only 3 dims, volume requires 4.
   Error: MINC file has only 3 dims, volume requires 4.

Hrm, the output works though.  So do I have to create a vector volume as such
with volume_io?

   char    *freq_dimorder[] = {MIzspace,MIyspace,MIxspace,MIvector_dimension};

   *out_vol = create_volume(3, freq_dimorder, NC_FLOAT, TRUE, 0.0, 0.0);

Currently I have it as such:

   *out_vol = create_volume(4, freq_dimorder, NC_FLOAT, TRUE, 0.0, 0.0)


Hrm...

--
Andrew Janke   ( rotor@cmr.uq.edu.au || www.cmr.uq.edu.au/~rotor )
Australia->University of Queensland->Centre for Magnetic Resonance
Work: +61 7 3365 4100 || Home: +61 7 3800 4042