This topic describes technical details of files' formats used in VOI Tool utility and assumes knowledge of the MATLAB structures as well as SPM internal details. VOI Tool utility uses three types of files:
VOI data file is the result of saving VOI structure variable Voi with MATLAB command:
save(filename, 'Voi', '-mat');
VOI data structure has the following fields:
| xVoxSize | voxel size in X direction |
| yVoxSize | voxel size in Y direction |
| zVoxSize | voxel size in Z direction |
| xMin | min X value in mm |
| yMin | min Y value in mm |
| zMin | min Z value in mm |
| xVoxNum | number of voxels in X direction |
| yVoxNum | number of voxels in Y direction |
| zVoxNum | number of voxels in Z direction |
| thr | threshold to define voxels in VOI |
| data | 3D array of data |
| type | VOI type (string) |
| info | cell array of type specific information |
| voiName | VOI name (string) |
Bounding box (in mm) for the VOI is
| X | xMin; xMin + (xVoxNum - 1)*xVoxSize |
| Y | yMin; yMin + (yVoxNum - 1)*yVoxSize |
| Z | zMin; zMin + (zVoxNum - 1)*zVoxSize |
voxel [ix, iy, iz] has coordinates in mm
| X | xMin + (ix - 1)*xVoxSize |
| Y | yMin + (iy - 1)*yVoxSize |
| Z | zMin + (iz - 1)*zVoxSize |
and belongs to VOI if and only if data(ix, iy, iz) >= thr
More details may be found in Readme.m file.
save(filename, 'VoiData', '-mat');
This structure used to store signal intensity data extracted for set of VOIs and has the following fields:
| SPMmatPath | full path to SPM analysis folder (with SPMcfg.mat, xCon.mat, SPM.mat, etc) |
| Dcfg | design matrix structure (see SPM99 spm_spm_ui.m), as saved in SPMcfg.mat |
| Dmat | design matrix structure (see SPM99 spm_spm.m) as saved in SPM.mat |
| voiFileNames | character matrix of full VOI names (number of VOI equal tonumber of rows) |
| Yr | the raw scaled data (as saved in SPM99 Y.mad) |
| Yc | the fitted data (as returned by spm_FcUtil('Yc', ...)) |
| Ya | the adjusted data == Yc + error |
Yr, Yc, and Ya are NxM matrix where N is number of scans (number of row in design matrix); M is number of VOI's
Signal intensity data extracted for set of VOIs and stored in *.vda file may be saved into plain ASCII text files. To save all data 5 separate files:
| nameCas.txt | contains list of scan file names |
| nameVoi.txt | contains list of VOI names |
| nameRaw.txt | contains matrix of raw data |
| nameAdj.txt | contains matrix of adjusted data |
| NameFit.txt | contains matrix of fitted data |
Output file format for matrix is
| Dmat.sF(1) | Dmat.sF(2) | Dmat.sF(3) | Dmat.sF(4) | ... | Dcfg.xC.rcname(i) | ... | V001 | ... | Vnnn | |
| C001 | ||||||||||
| C002 | ||||||||||
| ... | ||||||||||
| Cmmm |