Next: Volume Manipulation Up: Volumes Previous: Volume Input

Volume Output

Volume output is accomplished by one of two routines, depending on whether or not the volume is treated as a modified version of another volume or is an independent volume on its own.


public  Status  output_volume(
    char                  filename[],
    nc_type               file_nc_data_type,
    BOOLEAN               file_signed_flag,
    Real                  file_voxel_min,
    Real                  file_voxel_max,
    Volume                volume,
    char                  history[],
    minc_output_options   *options )

Outputs the specified volume to the specified filename. If the argument file_nc_data_type is NC_UNSPECIFIED then the volume is stored in the MINC file in the same type as in the volume variable. Otherwise, the four arguments, file_nc_data_type, file_signed_flag, file_voxel_min, and file_voxel_max, specify the type and valid voxel range to store the volume in the file. If the history argument is non-null, then it represents a description of the volume, and will be placed in the MINC volume. If the options argument is NULL, then the default options will be used. Otherwise, some specific output options can be set through this parameter, and the following functions:


public  void  set_default_minc_output_options(
    minc_output_options  *options )

Sets the options structure to the default values. The user can then override the default values and pass the structure to the output_volume() function. Currently, there is only one output option:


public  void  set_minc_output_dimensions_order(
    minc_output_options  *options,
    int                  n_dimensions,
    STRING               dimension_names[] )

Defines the output order of the file. Each dimension name string must have a matching dimension name in the volume, which defines the order of the dimensions in the output file. For instance, one may have input the volume in (x, y, z) order. To get it output in (z, y, x) order, set dimension_names to the three strings MIzspace, MIyspace, and MIxspace.


public  void  set_minc_output_real_range(
    minc_output_options  *options,
    Real                 real_min,
    Real                 real_max )

Defines the image range that will appear in the file. By default, none is specified, and output_volume uses the real minimum and maximum of the volume. To set the real range of the volume, see the relevant documentation for set_volume_real_range().

If the volume is a modification of another volume currently stored in a file, then it is more appropriate to use the following function to output the volume:


public  Status  output_modified_volume(
    char                  filename[],
    nc_type               file_nc_data_type,
    BOOLEAN               file_signed_flag,
    Real                  file_voxel_min,
    Real                  file_voxel_max,
    Volume                volume,
    char                  original_filename[],
    char                  history[],
    minc_output_options   *options )

The only difference between this function and the other method of volume output (output_volume()), is that this function copies auxiliary data from the original file (original_filename) to the new file. This auxiliary data includes such items as patient name and other scanning data, and is not read into a volume, so the only way to correctly pass it along to a new MINC file is to use this function.



Next: Volume Manipulation Up: Volumes Previous: Volume Input


david@pet.mni.mcgill.ca
Fri Feb 17 15:37:42 EST 1995