⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ava.bff

📁 toolbox of BVQX, This is the access between BV and matlab. It will help you to analysis data from BV
💻 BFF
字号:
# BinaryFileFormat (leave this tag as magic token!)

# BVQX file format for *.AVA files (Analysis of VAriance file)
# AVA FileVersions supported: 2
#
# Version:  v0.7a
# Build:    7072411
# Date:     Jul-24 2007, 11:22 AM CEST
# Author:   Jochen Weber, Brain Innovation, B.V., Maastricht, NL
# URL/Info: http://wiki.brainvoyager.com/BVQXtools

# FILE FORMAT
Description:General Linear Model files
EncodingSyntax:ieee-le
Extensions:ava

# FIELDS
ListOfFields:!
type  !cond                   !disktype!datatype!dim                      !default !varname

# basic header
FIELD !                       !uint16  !double  !1, 1                     !        !FileVersion
FIELD !                       !uint32  !double  !1, 1                     !        !ProjectType
FIELD !                       !uint32  !double  !1, 1                     !        !ModelType
EXPRE !$BFFREAD           !!!!!@NrOfBetweenFactors = 0; @NrOfWithinFactors = 0; @NrOfCovariates = 0; switch (@ModelType), case {1}, @NrOfWithinFactors = 1; case {2}, @NrOfWithinFactors = 2; case {3}, @NrOfBetweenFactors = 1; @NrOfWithinFactors = 1; case {4}, @NrOfCovariates = 1; case {5}, @NrOfWithinFactors = 3; otherwise, error('UnsupportedModelType'); end
FIELD !                       !uint32  !double  !1, @NrOfBetweenFactors   !        !NrOfBetweenFactorLevels
FIELD !                       !uint32  !double  !1, @NrOfWithinFactors    !        !NrOfWithinFactorLevels
FIELD !@NrOfCovariates > 0    !uint32  !double  !1, 1                     !        !NrOfCovariates
FIELD !                       !uint32  !double  !1, 1                     !        !NrOfSubjects
FIELD !@ModelType ~= 4        !uint32  !double  !1, 1                     !        !NrOfPredictors

# Initialize factor structs
EXPRE !$BFFREAD           !!!!!@BetweenFactor = cell2struct(cell(0, 0, 4), {'Type', 'Name', 'NrOfLevels', 'LevelNames'}, 3);
EXPRE !$BFFREAD           !!!!!@WithinFactor = cell2struct(cell(0, 0, 4), {'Type', 'Name', 'NrOfLevels', 'LevelNames'}, 3);

# Between factor Types
BLOOP !                       ! ! !@NrOfBetweenFactors ! !BFacNo1
FIELD !                       !uint32  !uint32  !1, 1                     !        !BetweenFactor($BFacNo1).Type
ELOOP !                       ! ! !  ! !BFacNo1

# Within factor Types
BLOOP !                       ! ! !@NrOfWithinFactors ! !WFacNo1
FIELD !                       !uint32  !uint32  !1, 1                     !        !WithinFactor($WFacNo1).Type
ELOOP !                       ! ! !  ! !WFacNo1

# Between factor names
BLOOP !                       ! ! !@NrOfBetweenFactors ! !BFacNo2
FIELD !                       !cstring !cstring !1, 1                     !        !BetweenFactor($BFacNo2).Name
ELOOP !                       ! ! !  ! !BFacNo2

# Within factor names
BLOOP !                       ! ! !@NrOfWithinFactors ! !WFacNo2
FIELD !                       !cstring !cstring !1, 1                     !        !WithinFactor($WFacNo2).Name
ELOOP !                       ! ! !  ! !WFacNo2

# Between factor levels
BLOOP !                       ! ! !@NrOfBetweenFactors ! !BFacNo3
EXPRE !                   !!!!!$NrOfLevels = @NrOfBetweenFactorLevels($BFacNo3); @BetweenFactor($BFacNo3).NrOfLevels = $NrOfLevels;
FIELD !                       !cstring !cstring !$NrOfLevels, 1           !        !BetweenFactor($BFacNo3).LevelNames
ELOOP !                       ! ! !  ! !BFacNo3

# Within factor levels
BLOOP !                       ! ! !@NrOfWithinFactors ! !WFacNo3
EXPRE !                   !!!!!$NrOfLevels = @NrOfWithinFactorLevels($WFacNo3); @WithinFactor($WFacNo3).NrOfLevels = $NrOfLevels;
FIELD !                       !cstring !cstring !$NrOfLevels, 1           !        !WithinFactor($WFacNo3).LevelNames
ELOOP !                       ! ! !  ! !WFacNo3
EXPRE !                  !!!!!$NrOfCells = prod([@NrOfBetweenFactorLevels, @NrOfWithinFactorLevels]);

# Covariates
EXPRE !$BFFREAD           !!!!!@ContrastName = ''; @CovariateNames = {};
FIELD !@ModelType == 4        !cstring !cstring !1, 1                     !        !ContrastName
FIELD !@ModelType == 4        !cstring !cstring !@NrOfCovariates, 1       !        !CovariateNames

# GLM link
FIELD !                       !cstring !cstring !1, 1                     !        !OriginatingGLM
FIELD !                       !uint32  !uint32  !1, 1                     !        !NrOfStudies
FIELD !                       !cstring !cstring !@NrOfStudies, 1          !        !TimeCourseFiles
FIELD !                       !uint16  !double  !1, 1                     !        !Resolution

# ProjectType split -> VTC
BLOOP !@ProjectType == 2      ! ! !1 ! !IsVTC
FIELD !                       !uint16  !double  !1, 1                     !        !XStart
FIELD !                       !uint16  !double  !1, 1                     !        !XEnd
FIELD !                       !uint16  !double  !1, 1                     !        !YStart
FIELD !                       !uint16  !double  !1, 1                     !        !YEnd
FIELD !                       !uint16  !double  !1, 1                     !        !ZStart
FIELD !                       !uint16  !double  !1, 1                     !        !ZEnd
EXPRE !                   !!!!!$XDim = (@XEnd - @XStart) / @Resolution;
EXPRE !                   !!!!!$YDim = (@YEnd - @YStart) / @Resolution;
EXPRE !                   !!!!!$ZDim = (@ZEnd - @ZStart) / @Resolution;
EXPRE !                   !!!!!$MapDim = [$XDim, $YDim, $ZDim];
ELOOP !                       ! ! !  ! !IsVTC

# ProjectType split -> MTC
BLOOP !@ProjectType == 3      ! ! !1 ! !IsMTC
FIELD !                       !uint32  !double  !1, 1                     !        !NrOfVertices
EXPRE !                   !!!!!$MapDim = [@NrOfVertices];
ELOOP !                       ! ! !  ! !IsMTC

# Maps, ModelType 1
BLOOP !@ModelType == 1        ! ! !1 ! !IsModel1
FIELD !                       !single  !single  !$MapDim, 1               !        !Maps.MS_A
FIELD !                       !single  !single  !$MapDim, 1               !        !Maps.MS_ErrorA
FIELD !                       !single  !single  !$MapDim, $NrOfCells      !        !Maps.CellMeans
ELOOP !                       ! ! !  ! !IsModel1

# Maps, ModelType 2
BLOOP !@ModelType == 2        ! ! !1 ! !IsModel2
FIELD !                       !single  !single  !$MapDim, 1               !        !Maps.MS_A
FIELD !                       !single  !single  !$MapDim, 1               !        !Maps.MS_B
FIELD !                       !single  !single  !$MapDim, 1               !        !Maps.MS_AxB
FIELD !                       !single  !single  !$MapDim, 1               !        !Maps.MS_AxS
FIELD !                       !single  !single  !$MapDim, 1               !        !Maps.MS_BxS
FIELD !                       !single  !single  !$MapDim, 1               !        !Maps.MS_AxBxS
FIELD !                       !single  !single  !$MapDim, $NrOfCells      !        !Maps.CellMeans
ELOOP !                       ! ! !  ! !IsModel2

# Maps, ModelType 3
BLOOP !@ModelType == 3        ! ! !1 ! !IsModel3
FIELD !                       !single  !single  !$MapDim, 1               !        !Maps.MS_A
FIELD !                       !single  !single  !$MapDim, 1               !        !Maps.MS_ErrorB
FIELD !                       !single  !single  !$MapDim, 1               !        !Maps.MS_B
FIELD !                       !single  !single  !$MapDim, 1               !        !Maps.MS_AxB
FIELD !                       !single  !single  !$MapDim, 1               !        !Maps.MS_ErrorAxB
FIELD !                       !single  !single  !$MapDim, $NrOfCells      !        !Maps.CellMeans
ELOOP !                       ! ! !  ! !IsModel3

# Maps, ModelType 4
BLOOP !@ModelType == 4        ! ! !1 ! !IsModel4
FIELD !                       !single  !single  !$MapDim, @NrOfCovariates !        !Maps.Covariate
ELOOP !                       ! ! !  ! !IsModel4

# Maps, ModelType 5
BLOOP !@ModelType == 5        ! ! !1 ! !IsModel5
FIELD !                       !single  !single  !$MapDim, 1               !        !Maps.MS_A
FIELD !                       !single  !single  !$MapDim, 1               !        !Maps.MS_B
FIELD !                       !single  !single  !$MapDim, 1               !        !Maps.MS_C
FIELD !                       !single  !single  !$MapDim, 1               !        !Maps.MS_AxB
FIELD !                       !single  !single  !$MapDim, 1               !        !Maps.MS_AxC
FIELD !                       !single  !single  !$MapDim, 1               !        !Maps.MS_BxC
FIELD !                       !single  !single  !$MapDim, 1               !        !Maps.MS_AxBxC
FIELD !                       !single  !single  !$MapDim, 1               !        !Maps.MS_AxS
FIELD !                       !single  !single  !$MapDim, 1               !        !Maps.MS_BxS
FIELD !                       !single  !single  !$MapDim, 1               !        !Maps.MS_CxS
FIELD !                       !single  !single  !$MapDim, 1               !        !Maps.MS_AxBxS
FIELD !                       !single  !single  !$MapDim, 1               !        !Maps.MS_AxCxS
FIELD !                       !single  !single  !$MapDim, 1               !        !Maps.MS_BxCxS
FIELD !                       !single  !single  !$MapDim, 1               !        !Maps.MS_AxBxCxS
FIELD !                       !single  !single  !$MapDim, $NrOfCells      !        !Maps.CellMeans
ELOOP !                       ! ! !  ! !IsModel5

# Read rest of File into REMAININGCONTENT
EXPRE !$BFFREAD   !  !  !  !  !$RemSize = $FILESIZE - ftell(fid);
EXPRE !$BFFWRITE  !  !  !  !  !$RemSize = 0; try, if isfield(@@, 'REMAININGCONTENT'), $RemSize = prod(size(@REMAININGCONTENT)); end, end
FIELD !$RemSize > 0           !uint8   !uint8   !1, $RemSize              !        !REMAININGCONTENT

EndListOfFields

NewFileCode:!
@FileVersion = 2;
@ProjectType = 2;
@ModelType = 1;
@NrOfBetweenFactors = 0;
@NrOfWithinFactors = 1;
@NrOfCovariates = 0;
@NrOfBetweenFactorLevels = zeros(1, 0);
@NrOfWithinFactorLevels = 2;
@NrOfSubjects = 12;
@NrOfPredictors = 3;
@BetweenFactor = cell2struct(cell(0, 0, 4), {'Type', 'Name', 'NrOfLevels', 'LevelNames'}, 3);
@WithinFactor.Type = 1;
@WithinFactor.Name = 'Task';
@WithinFactor.NrOfLevels = 2;
@WithinFactor.LevelNames = {'Task A'; 'Task B'};
@ContrastName = '';
@CovariateNames = {};
@OriginatingGLM = 'unknown.glm';
@NrOfStudies = 12;
@TimeCourseFiles = repmat({'unknown.vtc'}, [@NrOfStudies, 1]);
@Resolution = 3;
@XStart = 57;
@XEnd = 231;
@YStart = 52;
@YEnd = 172;
@ZStart = 59;
@ZEnd = 197;
t_xdim = round((@XEnd - @XStart) / @Resolution);
t_ydim = round((@YEnd - @YStart) / @Resolution);
t_zdim = round((@ZEnd - @ZStart) / @Resolution);
@Maps.MS_A = single(zeros(t_xdim, t_ydim, t_zdim));
@Maps.MS_ErrorA = single(ones(t_xdim, t_ydim, t_zdim));
@Maps.CellMeans = single(100 * ones(t_xdim, t_ydim, t_zdim, prod([@NrOfBetweenFactorLevels, @NrOfWithinFactorLevels])));
EndNewFileCode

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -