Next: Multiple Volume Output Up: Volumes Previous: Source Code Example

Multiple Volume Input

The input_volume function described previously is intended to be a simple single-function interface for reading volumes for most applications. Occasionally, however, an application may not want to read the whole volume at once, or may need to break the input file into several volumes, for instance, the slices of a 3D volume. This can be facilitated by the following functions:


public  Minc_file  initialize_minc_input(
    char                 filename[],
    Volume               volume,
    minc_input_options   *options )

This functions opens a MINC file for input to the specified volume. The number of dimensions in the file must be greater than or equal to the number of dimensions in the volume, and each dimension name in the volume must have a matching dimension name in the file. A file handle is returned, for use in the following routines.


public  Minc_file  initialize_minc_input_from_minc_id(
    int                  minc_id,
    Volume               volume,
    minc_input_options   *options )

This performs the same task as initialize_minc_input, except it takes a previously opened MINC file as an argument, rather than a filename.


public  int  get_minc_file_id(
    Minc_file  file )

Returns the MINC id of the file, a handle which can be used to perform MINC functions on the file.


public  int  get_n_input_volumes(
    Minc_file  file )

Determines the total number of volumes in the opened MINC file. For instance, if the file contains x, y, z data of size 100 by 200 by 300 and the file was opened with a two dimensional x-z volume, then the number of volumes returned will be 200, the number of y slices.


public  BOOLEAN  input_more_minc_file(
    Minc_file   file,
    Real        *fraction_done )

Reads part of the MINC file to the volume specified in initialize_minc_input. This function must be called until it returns FALSE, at which point the volume has been fully read in. In order to read the next volume in the file, if any, the following function must be called.


public  BOOLEAN  advance_input_volume(
    Minc_file   file )

Advances the input file to the next volume.


public  BOOLEAN  reset_input_volume(
    Minc_file   file )

Resets the input to the beginning of the first volume in the file.


public  Status  close_minc_input(
    Minc_file   file )

Closes the MINC file.



Next: Multiple Volume Output Up: Volumes Previous: Source Code Example


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