Home > bioelectromagnetism > ge_hdr2avw.m

ge_hdr2avw

PURPOSE ^

ge_hdr2avw - extract Analyze header from ge struct

SYNOPSIS ^

function [ avw ] = ge_hdr2avw(ge)

DESCRIPTION ^

 ge_hdr2avw - extract Analyze header from ge struct
 
 [avw] = ge_hdr2avw(ge)
 
 ge is a struct obtained from ge_hdr_read
 
 avw.hdr contains the Analyze header fields.
 
 There is no reorientation of the volume dimensions 
 in this function, whereas ge_series2avw does 
 reorient the data and corresponding header 
 fields.
 
 see also ge_series2avw, ge_series_read, ge_hdr_read,
          avw_hdr_write, avw_hdr_read

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [ avw ] = ge_hdr2avw(ge)
0002 
0003 % ge_hdr2avw - extract Analyze header from ge struct
0004 %
0005 % [avw] = ge_hdr2avw(ge)
0006 %
0007 % ge is a struct obtained from ge_hdr_read
0008 %
0009 % avw.hdr contains the Analyze header fields.
0010 %
0011 % There is no reorientation of the volume dimensions
0012 % in this function, whereas ge_series2avw does
0013 % reorient the data and corresponding header
0014 % fields.
0015 %
0016 % see also ge_series2avw, ge_series_read, ge_hdr_read,
0017 %          avw_hdr_write, avw_hdr_read
0018 %
0019 
0020 
0021 % $Revision: 1.1 $ $Date: 2004/11/12 01:32:35 $
0022 
0023 % Souheil J. Inati  <souheil.inati@nyu.edu> at 03/2003
0024 % Dartmouth College, May 2000
0025 %
0026 % Darren.Weber@flinders.edu.au, March 2003
0027 % - Substantially redesigned file handling and function
0028 %   call structures for integration with mri_toolbox at
0029 %   http://eeg.sf.net
0030 % - Requested permission to distribute code under GPL licence
0031 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0032 
0033 % Initialize the ANALYZE header
0034 avw = avw_hdr_make;
0035 
0036 version = '[$Revision: 1.1 $]';
0037 fprintf('\nGE_HDR2AVW [v%s]\n',version(12:16)); tic
0038 
0039 % Assign the GE image parameters
0040 avw.hdr.dime.datatype = 4;
0041 avw.hdr.dime.bitpix = ge.hdr.image.screenformat; % usually 16 bits
0042 avw.hdr.dime.glmax = 65535;
0043 avw.hdr.dime.dim(1) =  4;                   % Dimensions (always 4?)
0044 avw.hdr.dime.dim(2) =  ge.hdr.image.imatrix_X; % X Voxels
0045 avw.hdr.dime.dim(3) =  ge.hdr.image.imatrix_Y; % Y Voxels
0046 avw.hdr.dime.dim(4) =  ge.hdr.image.slquant;   % Z Voxels
0047 avw.hdr.dime.dim(5) =  1;                   % Time Points
0048 avw.hdr.dime.pixdim(2) = ge.hdr.image.pixsize_X;                       % X Voxel Size
0049 avw.hdr.dime.pixdim(3) = ge.hdr.image.pixsize_Y;                       % Y Voxel Size
0050 avw.hdr.dime.pixdim(4) = ge.hdr.image.slthick + ge.hdr.image.scanspacing; % Z Voxel Size
0051 
0052 t=toc; fprintf('...done (%5.2f sec).\n',t);
0053 
0054 return

Generated on Mon 15-Aug-2005 15:36:19 by m2html © 2003