Next: Some Basic Examples: Up: EMMA: Extensible MATLAB Medical Previous: Basic Concepts

Basic EMMA MATLAB Functions

The basic MATLAB interface to EMMA is performed through the following MATLAB functions (.m files). This section is only meant to provide a brief introduction to the most important functions. See section 5.3 for full help on every EMMA function.

openimage - Prepares a MINC file for reading. openimage determines the image size, reads in the frame start times and lengths if applicable, and returns a handle which can be used to access the MINC file with getimages, getimageinfo, getblooddata, etc.

     handle = openimage (filename)

getimages - Gets images from a MINC file. If the file has no frame dimension, the parameter frames should be empty or not provided. For files with no slices (only frames), the slices parameter should be made empty (a matrix of the form []). Also, getimages can read several frames from a single slice or several slices from a single frame-but it can not read multiple slices and multiple frames simultaneously. (This restriction is also imposed for writing images, mainly to avoid complications and reduce the software's ability to easily read in far more data than can be handled by MATLAB.)

Two important features of getimages are the ability to re-use memory, and the ability to read partial images. Both of these features are intended to reduce the amount of memory used by MATLAB when processing images.

     Images = getimages (handle [, slices [, frames [, old_matrix ...
                         [, start_row [, num_rows]]]]])

newimage - Creates a MINC file for a new set of images. Returns a handle to the newly created data set that is used in calls to other functions (such as putimages and closeimage). newimage has a number of optional parameters, the most important of which is the ``parent file.'' If this is supplied, newimage will copy a number of important attributes (such as the patient, study, and acquisition data) from the parent to the new file, as well as using the parent file to provide the default image size and type.

     handle = newimage (filename, dim_sizes [, parent_file [, image_type ...
                        [, valid_range [, orientation]]]]);

putimages - Writes entire images to a file created with newimage. (Warning: there are currently no provisions made to deny the user from writing to a MINC file opened with openimage.) The syntax is similar to getimages, except that the image data is of course an input argument to putimages rather than an output argument.

     putimages (handle, images [, slices [, frames]])

getimageinfo - Gets information about an open image. Currently, getimageinfo will return the filename, number of frames or slices, image height, width, or size, the dimension sizes, frame start times, lengths, and mid-frame times. The desired information is specified as a character string, eg. 'NumFrames', 'ImageHeight', etc.

     info = getimageinfo (handle, info_descriptor)

viewimage - Displays an image on the workstation screen. On a monochrome display, the gray colourmap will be used; otherwise, the spectral will be used. The image will be scaled such that the highest point in the image is always the last colour in the colourmap, and the lowest image point will be the first element of the colourmap. Also, a colourbar relating colours in the image to the values will be displayed, unless the optional colourbar_flag argument is set to zero.

     viewimage (image [, colourbar_flag])

closeimage - Destroys the appropriate variables in the workspace.

     closeimage (IMhandle)

Next: Some Basic Examples: Up: EMMA: Extensible MATLAB Medical Previous: Basic Concepts