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

📄 dwi.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 *.DWI files (Diffusion Weighted Image data)
# DWI FileVersions supported: (no versioning information yet)
#
# DWI files currently contain only data, no header fields at all!
#
# Version:  v0.7a
# Build:    7082720
# Date:     Aug-27 2007, 8:15 PM CEST
# Author:   Jochen Weber, Brain Innovation, B.V., Maastricht, NL
# URL/Info: http://wiki.brainvoyager.com/BVQXtools

# FILE FORMAT
Description:Diffusion weighted image
EncodingSyntax:ieee-le
Extensions:dwi

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

# Layout information from DMR file, otherwise error
BLOOP !$BFFREAD               ! ! !1 ! !RR
EXPRE !!!!!![t_file{1:3}] = fileparts($FILENAME); if isempty(t_file{1}), t_file{1} = '.'; end, try, t_dmr = BVQXfile([t_file{1} filesep t_file{2} '.dmr']); catch, error('Missing required information from DMR.'); end
EXPRE !!!!!!try, @DataStorageFormat = t_dmr.DataStorageFormat; @NrOfVolumes = t_dmr.NrOfVolumes; @NrOfSlices = t_dmr.NrOfSlices; @ResolutionX = t_dmr.ResolutionX; @ResolutionY = t_dmr.ResolutionY; catch, t_dmr.ClearObject; error('Missing fields in DMR.'); end, t_dmr.ClearObject;
ELOOP !                       ! ! !  ! !RR
EXPRE !!!!!!$DataDims = []; switch (@DataStorageFormat), case {3}, $DataDims = [@ResolutionX, @ResolutionY, @NrOfSlices, @NrOfVolumes]; case {4}, $DataDims = [@NrOfVolumes, @ResolutionX, @ResolutionY, @NrOfSlices]; otherwise, error('Invalid DataStorageFormat in DMR.'); end

# Data
FIELD !                       !uint16  !uint16  !$DataDims                !        !DWIData

# 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

# new file code snippet
NewFileCode:!
@DataStorageFormat = 3;
@NrOfVolumes = 1;
@NrOfSlices = 64;
@ResolutionX = 128;
@ResolutionY = 128;
@DWIData = uint16(0); @DWIData(@ResolutionX, @ResolutionY, @NrOfSlices, @NrOfVolumes) = @DWIData(1);
EndNewFileCode

⌨️ 快捷键说明

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