next up previous contents
Next: miget_dimension_sampling_flag/miset_dimension_sampling_flag Up: DIMENSION FUNCTIONS (39) Previous: miget_dimension_name/miset_dimension_name   Contents

miget_dimension_offsets/miset_dimension_offsets

NAME

miget_dimension_offsets, miset_dimension_offsets - get or set the absolute
world coordinates of points along a MINC dimension

SYNOPSIS

#include <minc2.h>

int miget_dimension_offsets ( midimhandle_t     dimension, double       offsets[],
                              unsigned long     array_length, 
                              unsigned long     start_position);

int miset_dimension_offsets ( midimhandle_t     dimension, const double offsets[],
                              unsigned long     array_length, 
                              unsigned long     start_position);

DESCRIPTION

These functions get or set the dimension offsets, that is, the
absolute world coordinates of each sampled point along the dimension.

The caller may retrieve up to "array_length" values, starting at the
integer index "start_position".  Thus an arbitrary contiguous subset
of the dimension's offsets may be retrieved or stored.  An error is
returned if the "start_position" exceeds the total size of the
dimension.  If the value of "start_position" is legal, but the sum of
"start_position" and "array_length" exceeds the size of the dimension,
the function will get or set offsets up to the size of the dimension.
Any extra positions in the offsets[] array will be ignored.

It is explicitly legal to call this function for a regularly sampled
dimension.  The result will be a list of values calculated from the
"start" and "separation" values of the dimension.  However, it is 
not possible to set offsets on a regularly sampled dimension.

RETURN VALUE

Returns the number of offset values read or written , or MI_ERROR if
an error is detected.



Robert VINCENT 2005-03-09