Importing Data and Saving Studies

Importation of Data Sets

AMIDE uses its own format (described below: the section called “XIF Files”) for saving data between session. To get new data into AMIDE, it needs to be imported (located under the file menu). You can either let AMIDE try to guess the file format (which works for most data types) or tell AMIDE explicitly which format the file to be imported is suppose to be in. Importing of all data types except for raw data is done using Erik Nolf's (X)medcon medical imaging conversion library.

Raw Data Files

AMIDE will generally attempt to load any file ending in ".dat" or ".raw" as a raw data file. The user will be prompted for the dimensions of the study, the offset of the data in the file, and the data format of the data in the file. Both big endian, little endian, and PDP endian files can be loaded (endian refers to the order in which bytes are arranged in memory).

The following data formats are supported: 8 bit signed or unsigned integer, 16 bit signed or unsigned integer, 32 bit signed or unsigned integer, 32 bit IEEE floating point, 64 bit IEEE floating point, and ASCII data.

ECAT Files

Static and dynamic ECAT 6.4 and 7.2 files are supported through (X)MedCon. AMIDE will generally try to load any file ending in ".img" as ECAT 6.4, and any file ending in ".v" as ECAT 7. Please note that ECAT 6.4 files are very difficult to autodetect, so if the file does not end in .img, you will probably have to tell AMIDE explicitly to import the file as ECAT 6.4.

Although not compiled in by default, AMIDE can be configured to use the z_matrix_7/libecat library for handling ECAT files instead of (X)MedCon.

DICOM Files

DICOM 3.0 is supported through (X)MedCon, which actually uses a slightly modified version of Tony Voet's VT-DICOM library. The level of support for DICOM 3.0 is entirely determined by (X)MedCon/VT-DICOM.

DICOM data is often distributed as a series of single slice data files. To read these into AMIDE as a single data set, you will need to stack these slices into a single, volumetric file. Notes on how to do this can be found at the (X)medcon website.

Concorde microPET files

Concorde format files are generated by the Concorde company's series of microPET scanners. It's a two file format (a data file and a header file), with the header in easily read ASCII format. Please note that you will need to tell AMIDE to open the header file (.img.hdr), not the raw data file (.img).

Acr/Nema 2.0, Analyze (SPM), InterFile3.3, Gif87a/89a

A variety of additional file formats are supported through (X)MedCon, including: Acr/Nema 2.0, Analyze (SPM), InterFile3.3, and Gif87a/89a. For more information, please see the (X)MedCon documentation, or the corresponding webpage (http://xmedcon.sf.net) .

XIF Files

AMIDE saves studies in an extensible XML based format called XIF (Xml Image Format). This format can be stored as either a single file (flat file format XIF) or as a XIF directory. The flat file format is the default, and simplifies file moving and handling.

The directory format on the other hand allows easy access to the raw study data external to the AMIDE program, and will be of interest to developers. The directory format can be utilized via the "Save as XIF Directory" and "Open XIF Directory" menu items under the File menu.

In any case, these files or directories will characteristically end with ".xif", and are treated identically within the AMIDE program.

Opening Studies

From the main window, select "File->Open", and a file selection widget will open up. Select an XIF filename in the right column, and then hit the "OK" button (or double click on the filename).

Saving Studies

To save a study, from the study window select "File->Save As" and a file selection dialog will appear. Look at the "selection:" line near the bottom of the window, if this is the desired XIF filename, hit "OK" and the file will be saved. If this is not the desired XIF filename, select or enter in the correct XIF study, and hit the "OK" button.

Note that the original data set files are no longer needed by AMIDE, as all the information AMIDE needs is saved inside the .XIF file. You should however still archive the original data files, as AMIDE only reads in and stores the information from the header that it needs (which is generally not all the information enclosed within the header).

XIF Directory Format

Although admittedly annoying from a data transfer standpoint, using a directory structure for saving study information has the decisive advantage of making the saved information easily accessible using standard command-line utilities and text-based tools.

Each XIF directory contains a file called "study_*.xml" which contains the basic study parameters. Additional files can also be found in the XIF directory, such as ROI_*.xml files which contain ROI's, and data-set_*.xml files and their corresponding data-set_*_raw-data files, which contain the image data set parameters and the raw data respectively. The raw data file format is arbitrary (double/float/int, 64/32/16/8 bit, little or big endian, per plane/per frame/single scale factor), and is determined by the format of the originally imported data.

XIF Flat File Format

The flat file format is basically a concatenation of the information enclosed within the directory format. It is not meant to be editable or developer friendly. Instead, it allows easy management of studies for casual users. If you wish to access the information in a XIF flat file external to AMIDE, you'll be much better off resaving the data as in XIF directory format.

The format is as follows: The first 64 bytes of the file contain a magic string for format identification. The next 16 bytes contain 2 64bit unsigned little endian integers, the first one being the location of the study xml data within the file, and the second integer being the size of this xml data. Within the study xml data, is encased the information as to where in the file the children's xml data is. And within the children's xml data, is enclosed the location information of the raw data and subchildren.

Exporting a View to JPEG/PNG

To export one of the views (transverse/coronal/sagittal) to an external image file, select "File->Export View->[view]" from the menu. The saved data format by default is jpeg. If the saved filename ends in ".png", the saved data format will be PNG.