MINC provides a number of convenience functions that have nothing to do with medical imaging, but that make the use of NetCDF files a little easier. One of the drawbacks of the NetCDF format is that data can come in any form (byte, short, int, float, double) and the calling program must handle the general case. Rather than restrict this, MINC provides functions to convert types.
The first set of convenience functions are for type conversion. A list follows :
miattget
- reads an attribute vector, specifying
the numeric type desired and the maximum number of values to read.
miattget1
- reads one attribute value of the
specified type.
miattgetstr
- read a character attribute of a specified
maximum length.
miattputdbl
- write a double precision attribute.
miattputstr
- write a string attribute.
mivarget
- get a hyperslab of values of the
specified type.
mivarget1
- get a single value of the specified type.
mivarput
- put a hyperslab of values of the
specified type.
mivarput1
- put a single value of the specified type.
Next we have some functions for handling coordinate vectors :
miset_coords
- set a vector of coordinates to a
single value.
mitranslate_coords
- translate the coordinates for one
variable to a vector for subscripting another variable.
Finally, there are functions for dealing with variables as groups of attributes, making it easier to modify a file while keeping ancillary information :
micopy_all_atts
- copy all of the attributes of
one variable to another (possibly across files).
micopy_var_def
- copy a variable definition (including
attributes) from one file to another.
micopy_var_vals
- copy a variable's values from
one variable to another (possibly across files).
micopy_all_var_defs
- copy all variable
definitions from one file to another, excluding a list of variables.
micopy_all_var_vals
- copy all variable values
from one file to another, excluding a list of variables.