next up previous contents
Next: miset_apparent_dimension_order Up: DIMENSION FUNCTIONS (39) Previous: mifree_dimension_handle   Contents



miget_volume_dimensions - retrieve the list of dimensions defined in a MINC 
volume, according to their class and attribute.


#include <minc2.h>

int miget_volume_dimensions ( mihandle_t        volume, 
                              midimclass_t      class, 
                              midimattr_t       attr, 
                              miorder_t         order,
                              int               array_length,
                              midimhandle_t     dimensions[]);


This function is used to retrieve an array of dimension handles for a
MINC volume.  It will place the handles of the first "array_length"
dimensions into the "dimensions[]" array, returning only those dimension
whose characteristics match the "class" and "attr" parameters. 
The miorder_t is an enumerated type flag which determines whether the
dimension order is determined by the file or by the apparent order set by 
the user. This function will FAIL if the user has not set the apparent 
dimension order by calling either of 
miset_apparent_dimension_order() or miset_apparent_dimension_order_by_name()
before calling this function with MI_DIMORDER_APPARENT flag

The following example will return up to 3 spatial dimensions:

    int result;
    midimhandle_t dimensions[3];
    mihandle_t volume;

    result = miget_vol_dimensions (volume, MI_DIMCLASS_SPATIAL, 
                                   MI_DIMATTR_ALL, MI_DIMORDER_FILE, 
                                   3, dimensions);


miget_volume_dimensions returns the number of dimension handles copied 
to the array, or MI_ERROR on failure.


miset_apparent_dimension_order, miset_apparent_dimension_order_by_name

Robert VINCENT 2005-03-09