[MINC-users] mincaverage -avgdim result header

Peter Neelin peter.neelin at gmail.com
Sat Mar 24 00:35:42 EDT 2012


Hi Alex,

On Mar 23, 2012 11:16 AM, "Alex Zijdenbos" <zijdenbos at gmail.com> wrote:
> I just noticed that 'mincaverage -avgdim' leaves lots of header
> information in the resulting average for the dimension it averaged
> out; which then causes trouble with mincinfo and the like. To me this
> looks like a bug in mincaverage, in that when using -avgdim <dim> it
> doesn't properly clean up the <dim>-related header attributes.

Minc and netcdf allow for any number of dimensions to exist in the file.
They are only relevant to the image data if they index the "image" variable
in minc. mincaverage is removing the time dimension from the image
variable, but it leaves the dimension itself alone. If other variables
exist in the file, then they may be indexed by the time dimension. It might
be argued that mincaverage should do something magical to all variables
indexed by one of the dimensions (time in this case), but it would be
rather arbitrary to average any variable in the file along that dimension.
The contract of mincaverage is simply to average image data. Other data is
left untouched.

> So that looks right; we seem to have lost the time dimension. However,
> using this mincinfo call:
>
> $ mincinfo -dimnames -dimlength time test_pet_avg.mnc
> time xspace yspace zspace

I don't think that this is what you want - this asks for all the dimensions
in the file, which is what you are given. You should be using the -vardims
option with "image" as the argument instead. This will tell you which
dimensions are indexing the image variable. This is what mincinfo
-image_info does.

So bottom-line: I don't think that it is a bug - I think that it is doing
the most appropriate thing. (Of course, I wrote it, so I would think that -
you are free to disagree and change the contract/requirements if it suits
you, but please bear in mind that minc is designed around a general file
format and is intended to be extensible - I think that general-purpose
tools like mincaverage should honour that intent and not mess up non-image
data in the file.)

Hope this helps.

Peter
--
Peter Neelin
peter.neelin at gmail.com


More information about the MINC-users mailing list