Rather than using the input_volume() function to input a volume
in one shot, there is another method which will allow interspersing volume input
with other processing tasks. The following is the set of routines which the
input_volume() function calls in order to input a volume.
public Status start_volume_input(
STRING filename,
int n_dimensions,
STRING dim_names[],
nc_type volume_nc_data_type,
BOOLEAN volume_signed_flag,
Real volume_voxel_min,
Real volume_voxel_max,
BOOLEAN create_volume_flag,
Volume *volume,
minc_input_options *options,
volume_input_struct *input_info ) |
This initializes a filename for inputting the volume incrementally. The arguments
to this are identical to those for the input_volume() function,
with the addition of the input_info structure which is
initialized for use in the remaining functions. The volume is created if necessary,
but not allocated, and no part of the volume is read in.
public void delete_volume_input(
volume_input_struct *input_info ) |
Closes the file and terminates the input of the volume. By calling the
start_volume_input() function followed by the
delete_volume_input() function, a volume can be created that
has all the information about the file volume, without the voxels being allocated.
public void cancel_volume_input(
Volume volume,
volume_input_struct *input_info ) |
Closes the file, terminates the input of the volume, and deletes the volume. Simply
calls delete_volume_input() followed by
delete_volume().
public BOOLEAN input_more_of_volume(
Volume volume,
volume_input_struct *input_info,
Real *fraction_done ) |
Inputs a small chunk of the volume, calculated to be efficient, yet not be so large
that one cannot usably intersperse calls to do other processing with calls to this
function. Returns TRUE if there is more to do, i.e., this
function should be called again. The fraction done is passed back as a number
between 0 and 1.
public Minc_file get_volume_input_minc_file(
volume_input_struct *volume_input ) |
The Minc_file structure from the volume input is passed back,
to allow use of this in routines that require this type.