[MINC-users] How to write header information with the MINC2 API

Soren Christensen sorench at gmail.com
Tue Jan 3 06:44:07 EST 2012


Hi,
 Just to reiterate, what I am looking for is a way to enter
variables+attributes into a MINC2 file so that they will get listed
using the usual mincinto -attvalue [VAR:ATT] file.mnc
I have not been able to accomplish this using the MINC2 API function
miset_attr_values

Using minc_modify_header on a MINC2 file I achieve what I want so I
looked at the sources and it seems to me that this is achieve through
some of the hdf_convenience function in hdf_conveinience.c. So this
implementation is activated through the minc_compat.h mechanism
originating in a ncvardef call.

In contrast, the implementation used by the MINC2 API does make use of
the hdf convenience functions and writes the variable "in a different
way" that is not read by mincinfo nor mincheader.

When I run an h5dump on a variable I added using minc_modify_header
the variable is also labelled a "DATASET" - not exactly sure what this
means, but when using miset_attr_values that is not the case.

Am I missing an obvious way to create a variable using the MINC2 API
or should I just do it via the hdf convenience functions?


Cheers
Soren




On Sun, Jan 1, 2012 at 6:25 PM, Soren Christensen <sorench at gmail.com> wrote:
> Happy New Years first of all!
>
> I am trying to write some attributes to a MINC2 file using the C API (using
> miset_attr_values).
> The problem is I am not able to get my variable at the correct position in
> the hierarchy.
>
> I would like to write a variable, attribute pair so that it appears as such
> when I use mincheader. My understanding is that I should put the variables
> in this path:
> miset_attr_values( volume , MI_TYPE_STRING, "/minc-2.0/info", "myvar",
> 1,"L");
> but this gives me an error.
>
> I can create an arbitrary group and put the variable there, but that wont be
> listed as a standard variable using mincheader or mincinfo.
>
> How do I put in a variable so that it can be queried using the usual
> mincinfo -attvalue [varname]:[attname] ?
>
>
> Cheers
> Soren
>


More information about the MINC-users mailing list