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

alloc_volume()  

Allocate volume corresponding to header



Synopsis


void * 
alloc_volume( header *hdr )


Description
Call this function to allocate the memory for the volume described in hdr.

This function is called by read_volume(). The volume is 0 filled.

Use this function when your program generates new data.

Usage

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

  data = alloc_volume( hdr );
  if (!data)
    exit(1);

Revision


1.0  29/10-96   Ulrik Kjems
1.1  19/11-86   UK  Return NULL/data pointer in stead of OK/ERR


Program listing






Ulrik Kjems
6/3/1998