Creation of Functional Documents

The following commands are exposed by the general object "BrainVoyager" that is made available to any Python script.

 

Document CreateDocumentFMR(str fileType, str firstFile, int nrOfVolumes, int nrOfVolumesToSkip, boolean createFirstVolAMR, int nrOfSlices, str prefixOfSTC, boolean bigEndianByteOrder, int nrOfSliceColumns, int nrOfSliceRows, int nrOfBytesPerPixel, str targetFolder)

Description
Creates a FMR document from specified data source, i.e. files containing a series of functional volumes. The returned document object can be used subsequently to call commands for e.g. preprocessing and statistics. Note that for Siemens mosaic files, the "CreateProjectMosaicFMR" command should be used (see below).
fileType (str):
Specifies the type of the raw data, including "DICOM" (default), "ANALYZE", "PHILIPS_REC" and various GE types.
firstFile (str):
Specifies the first file to use for project creation; in case that a document should be created from multiple files (usual case for Dicom files), this file is only the first of a sequence and subsequent files are found on disk by incrementing a corresponding file number. For Dicom files it is recommended to run the "RenameDicom" command in a data source folder so that the file numbers are interpretable by BrainVoyager. If the provided filename does not include a full path, make sure that the current directory is set appropriately.
nrOfVolumes (int):
Specifies the number of functional volumes to read (usually the full number of volumes scanned in the respective scanning run).
nrOfSkipVolumes (int):
Specifies the number of volumes at the begin of the data that will not be included (usually 0); the number of functional volumes in the created FMR file will be: nrOfVolumes - nrOfVolumesToSkip.
createFirstVolAMR (boolean):
Specifies whether a AMR file should be created from the first functional volume (true) or not (false). The created AMR file will be used as the default display of slices when a created (or loaded) FMR document is shown. This is especially useful in case that first volumes have been scanned with T1 saturation providing better grey/white matter contrast. These T1 saturated volumes are usually skipped using the nrOfSkipVolumes parameter. Note that in recent years, scanners remove T1 saturated volumes during preparation of functional scanning so first volumes are usually not T1 saturated and no initial volumes need to be skipped.
nrOfSlices (int):
Specifies the expected number of slices comprising each functional volume.
prefixOfSTC (str):
Name of the prefix used for the stored .stc file (e.g. "exp_run-1") containing the image data; note that the FMR file itself contains only meta information referring to the .stc file (and other auxiliary files).
bigEndianByteOrder (boolean):
Specifies whether the imported data has little endian byte order (false, recommended as default) or big endian byte order (true). In case that imported images look like salt and pepper noise, try switching this flag. If this value can be retrieved from the file header (e.g. for DICOM data), the provided value will be ignored.
nrOfSliceRows (int):
Specifies the number of rows of a single slice. If this value can be retrieved from the file header (e.g. for DICOM data), the provided value will be ignored.
nrOfSliceColumns (int):
Specifies the number of columns of a single slice. If this value can be retrieved from the file header (e.g. for DICOM data), the provided value will be ignored.
nrOfBytesPerPixel (int):
Specifies how many bytes represent the intensity value of a pixel (usually 2). If this value can be retrieved from the file header (e.g. for DICOM data), the provided value will be ignored.
targetFolder (str):
Specifies the directory where the created FMR project and associated files (e.g. .stc, .amr files) will be stored.

 

Document CreateDocumentMosaicFMR(str fileType, str firstFile, int nrOfVolumes, int nrOfVolumesToSkip, boolean createFirstVolAMR, int nrOfSlices, str prefixOfSTC, boolean bigEndianByteOrder, int nrOfSliceColumns, int nrOfSliceRows, int nrOfBytesPerPixel, str targetFolder, int nrOfVolsInFile, int nrOfSliceRows, int nrOfSliceColumns)

Description
Creates a FMR document from a series of Siemens mosaic files, each containing usually one functional volume. This special Siemens format "pretends" each file to be a single image allowing to store all slices of a functional volume in a single "big" DICOM file instead of a set of standard DICOM files; the mosaic arrangement of the individual slices leads to a correct display if displayed as an image, which can be checked in BrainVoyager by creating an AMR document from a mosaic file or by creating a "single slice per file" FMR project (see above). For further processing, the mosaic images need to be decomposed into separate slice images, which is performed by this special FMR document creation function. The returned document object can be used subsequently to call commands for e.g. preprocessing and statistics
fileType: (str)
Specifies the type of the raw data, including "DICOM" (default), "ANALYZE", "PHILIPS_REC" and various GE types.
firstFile (str):
Specifies the first file to use for project creation; in case that a document should be created from multiple files (usual case for Dicom files), this file is only the first of a sequence and subsequent files are found on disk by incrementing a corresponding file number. For Dicom files it is recommended to run the "RenameDicom" command in a data source folder so that the file numbers are interpretable by BrainVoyager. If the provided filename does not include a full path, make sure that the current directory is set appropriately.
nrOfVolumes (int):
Specifies the number of functional volumes to read (usually the full number of volumes scanned in the respective scanning run).
nrOfSkipVolumes (int):
Specifies the number of volumes at the begin of the data that will not be included (usually 0); the number of functional volumes in the created FMR file will be: nrOfVolumes - nrOfVolumesToSkip.
createFirstVolAMR (boolean):
Specifies whether a AMR file should be created from the first functional volume (true) or not (false). The created AMR file will be used as the default display of slices when a created (or loaded) FMR document is shown. This is especially useful in case that first volumes have been scanned with T1 saturation providing better grey/white matter contrast. These T1 saturated volumes are usually skipped using the nrOfSkipVolumes parameter. Note that in recent years, scanners remove T1 saturated volumes during preparation of functional scanning so first volumes are usually not T1 saturated and no initial volumes need to be skipped.
nrOfSlices (int):
Specifies the expected number of slices comprising each functional volume.
prefixOfSTC (str):
Name of the prefix used for the stored .stc file (e.g. "myexp_run1") containing the image data; note that the FMR file itself contains only meta information referring to the .stc file (and other auxiliary files).
bigEndianByteOrder (boolean):
Specifies whether the imported data has little endian byte order (false, recommended as default) or big endian byte order (true). In case that imported images look like salt and pepper noise, try switching this flag. If this value can be retrieved from the file header (e.g. for DICOM data), the provided value will be ignored.
nrOfMosaicRows (int):
Specifies the number of rows of a mosaic image, which is a multiple of the rows of a single slice. If this value can be retrieved from the file header (e.g. for DICOM data), the provided value will be ignored.
nrOfMosaicColumns (int):
Specifies the number of columns of a mosaic image, which is a multiple of the columns of a single slice. If this value can be retrieved from the file header (e.g. for DICOM data), the provided value will be ignored.
nrOfBytesPerPixel (int):
Specifies how many bytes represent the intensity value of a pixel (usually 2). If this value can be retrieved from the file header (e.g. for DICOM data), the provided value will be ignored.
targetFolder (str):
Specifies the directory where the created FMR project and associated files (e.g. .stc, .amr files) will be stored.
nrOfVolsInFile (int):
Specifies the square root of the number of volumes in a single mosaic file. This value is usually "1" (exceptions were only observed in the early years of the mosaic file format)..
nrOfSliceRows (int):
Specifies the number of rows of a single slice. If this value can be retrieved from the file header (e.g. for DICOM data), the provided value will be ignored.
nrOfSliceColumns (int):
Specifies the number of columns of a single slice. If this value can be retrieved from the file header (e.g. for DICOM data), the provided value will be ignored.