Home > brede > brede_air.m



brede_air - Roger Woods AIR file


function varargout = brede_air(varargin)


 brede_air            - Roger Woods AIR file

       function M = brede_air(filename)
       function brede_air(filename)
       function brede_air(M)
       Input:  filename  - Filename of AIR file   
               M         - 'Mat' structure with transformation matrix 

       Output: M         - 'Mat' structure with transformation matrix 
       This function will presently open a AIR file and read the
       information if called with a filename. The transformation
       matrix in the AIR file can be returned in a 'mat' structure or
       shown in a graphical user interface. The additional
       information in the AIR file is setup in a 'Air' structure that
       is a substructure of the 'mat' structure. 

       Other AIR functions:
         brede_ui_mat     - Graphical userinterface for 'mat'
         brede_read_air   - Read AIR 
         brede_write_air  - Write AIR file

       'Air' Structure:
         sFile              Standard filename (s_file)
         SKeyInfo           Structure with info for standard file
         SKeyInfo.xDim      Number of voxels in x-coordinate
         SKeyInfo.yDim      Number of voxels in y-coordinate
         SKeyInfo.zDim      Number of voxels in z-coordinate
         SKeyInfo.tDim      Time dimension (only Svarer version)
         SKeyInfo.xSize     Voxel size in millimeters, x-coordinate 
         SKeyInfo.ySize     Voxel size in millimeters, y-coordinate
         SKeyInfo.zSize     Voxel size in millimeters, z-coordinate
         SKeyInfo.scale     Voxel value scaling factor (Svarer version)
         SKeyInfo.offset    Voxel value offset (Svarer version)
         rFile              Reslice filename (r_file)
         RKeyInfo           (Same as SKeyInfo but for reslice file)
         sHash              ? (=0)
         rHash              ? (=0)
         sVolume            ? (=0)
         rVolume            ? (=0)
         reserved           ''

       AIR file format: 
         The AIR file is a binary file with the extension 'air' and
         there are different version of it. 

       From Roger Woods' AIR.h file in AIR version 5.2.5
         struct AIR_Key_info{
           unsigned int bits;
           unsigned int x_dim;
           unsigned int y_dim;
           unsigned int z_dim;
           double x_size;
           double y_size;
           double z_size;

         #define AIR_CONFIG_MAX_PATH_LENGTH 128    
         #define AIR_CONFIG_MAX_COMMENT_LENGTH 128      
         #define AIR_CONFIG_RESERVED_LENGTH 116       

         struct AIR_Air16{
           double              e[4][4];
           char                s_file[AIR_CONFIG_MAX_PATH_LENGTH];
           struct AIR_Key_info s;
           char                r_file[AIR_CONFIG_MAX_PATH_LENGTH];
           struct AIR_Key_info r;
           char                comment[AIR_CONFIG_MAX_COMMENT_LENGTH];
           unsigned long int   s_hash;
           unsigned long int   r_hash;
           unsigned short      s_volume;     
           unsigned short      r_volume;     
           char                reserved[AIR_CONFIG_RESERVED_LENGTH];

       Claus Svarer, Neurobiology Research Unit, Denmark, has
       redefined some of the Key_info structure:  

         struct key_info{
           long int bits;
           long int x_dim;
           long int y_dim;
           long int z_dim;
           long int t_dim;    /* time dimension */
           double x_size;
           double y_size;
           double z_size;
           double scale;      /* scale */
           double offset;     /* offset */

       Actual written version is with "long int t_dim; long int
       separator" since this fits with the files written by the
       Svarer-modified Matlab software!!! 


 $Id: brede_air.m,v 1.2 2007/06/07 17:21:49 fn Exp $


This function calls: This function is called by:
Generated on Fri 27-Nov-2009 18:11:22 by m2html © 2005