[MINC-users] mincconcat question

Peter NEELIN minc-users@bic.mni.mcgill.ca
Thu, 20 Feb 2003 22:15:05 -0500


On Wed, 19 Feb 2003, Ghassan Hamarneh wrote:

> $ mincconcat 0a.mnc 0b.mnc 0n.mnc -concat_dimension yspace
>
> to concatenate two volumes 0a.mnc (384x183x256) to 0b.mnc (384x68x256) along
> the second dimension and end up with 0n.mnc (384x[183+68]x256) volume, but I am
> getting the message: Don't use an image dimension as a loop dimension.

I'm afraid that you cannot directly concatenate the files in this way.
mincconcat was designed to concatenate stacks of images, but not to merge
images together. Because mincconcat was built around the voxel_loop
library, it is somewhat limited in its generality.

If you are willing to put up with a bit of inefficiency, you can re-order
the dimensions so that the dimension that you want to concatenate is the
slowest varying. You can use either mincreshape or mincresample for this.
I think that mincresample with the -nearest option is probably faster due
to inefficiencies in netcdf of which mincreshape takes disadvantage (!). I
think that the simplest set of commands would be

   mincresample -coronal -nearest 0a.mnc 0a_cor.mnc
   mincresample -coronal -nearest 0b.mnc 0b_cor.mnc
   mincconcat 0a_cor.mnc 0b_cor.mnc new.mnc

I have not tested this and my minc is getting rusty, so you might have to
adjust the options a bit.

            Peter
----
            Peter Neelin (neelin@bic.mni.mcgill.ca)