next up previous
Next: unmask_volume() Up: Brain Volume I/O Handling Previous: resize_volume()

mask_volume()  

Mask and reallocate volume from binary mask



Synopsis


int 
mask_volume(header *hdr, void** data, char *mask) {


Description
Call this function to reallocate the memory for the volume described in hdr and data.

The new volume is smaller and consists of the volume data points sampled where the mask volume is non-zero.

The header is changed into a 1-dimensional vector with the correct n.o. elements.

Usage

Fill in required size and data type into a header struct (obtained from new_header(). Allocate data using

							  
  read_volume( "myvolume", hdr1, &data );  // A big volume
  read_volume( "mymask", hdr2, &mask );   // A binary mask
  mask_volume(hdr1, &data, mask);  // Now the volume is smaller..

Revision


1.0  20/7-98   Ulrik Kjems


Program listing






Ulrik Kjems
6/3/1998