Brain Innovation

support portal

Navigation

BrainVoyager Diffusion Weighted Imaging DMR creation Concatenate multiple runs into one DMR

Concatenate multiple runs into one DMR

When you have acquired multiple runs of diffusion data, you might want to concatenate them into one DMR file. For DICOM data, this is done as described below. For other data types, it might be necessary to use the alternative method.

Procedure with DICOM data

  1. Rename the DICOM files (File > Rename DICOM Files) if you haven't done it yet. Put all the DICOM files from all runs into one directory.
  2. Start the Create Project Wizard for DMR creation
  3. Select the directory containing the data, and select the first file of the first run
  4. In the number of volumes dialog, enter the total number of volumes acquired (= nr of runs * volumes per run)
  5. Continue as usual. Do not attach a grb. We have to manually adapt it. Assuming you have the grb for one run, then continue to the section "Adaptation of the DMR" below.

Alternative procedure

As you know, the DMR and DWI belong together. The DMR describes the data in a text file, and a DWI file contains the data, so we need to concatenate the DWI files. This can be easily done on the command line. There are three steps to take:

1) DMR creation for each run

2) concatenate the DWI files

3) adapt the DMR file for the concatenated file.

First, create a DMR for each run you have, e.g. subjectA_run1.dmr, subjectA_run2.dmr, subjectA_run3.dmr etc and put them (DMR+DWI!) into one folder. In this example, we have 3 runs per subject, with 16 volumes (equal to the number of gradient directions) per run. You need this information (number of runs, number of volumes per run) for your own experiment.

After you've created the DMRs for each run, open a command window (cmd on Windows, Terminal on Mac/Linux). Navigate to the folder where you created the DMRs.

For Mac/Linux, do (add all filenames for all runs, this example uses 3 runs)
~$ cat subjectA_run1.dwi subjectA_run2.dwi subjectA_run3.dwi > subjectA_allruns.dwi
For Windows, do
> copy /b subjectA_run1.dwi + subjectA_run2.dwi + subjectA_run3.dwi subjectA_allruns.dwi

Adaptation of the DMR (all OS)

Open the DMR of one of the runs in a text editor.  You will see something like

FileVersion:                   3
NrOfVolumes:                  16
NrOfSlices:                    42
NrOfSkippedVolumes:            0
Prefix:                        "subjectA_run1"
DataStorageFormat:             3
DataType:                      2
TR:                            3725
InterSliceTime:                88
TimeResolutionVerified:        0
TE:                            0
SliceAcquisitionOrder:         0
SliceAcquisitionOrderVerified: 0
ResolutionX:                   256
ResolutionY:                   256
LoadAMRFile:                   ""
ShowAMRFile:                   1
ImageIndex:                    0
LayoutNColumns:                7
LayoutNRows:                   6
LayoutZoomLevel:               1
SegmentSize:                   10
SegmentOffset:                 0
DisplayVolume:                 0
ProtocolFile:                  ""
InplaneResolutionX:            0.898
InplaneResolutionY:            0.898
SliceThickness:                3
SliceGap:                      0
VoxelResolutionVerified:       1

PositionInformationFromImageHeaders

PosInfosVerified: 1
CoordinateSystem: 1
Slice1CenterX:    -0.92
Slice1CenterY:    -8.1
Slice1CenterZ:    -33.72
SliceNCenterX:    1.65
SliceNCenterY:    -22.01
SliceNCenterZ:    88.47
RowDirX:          0.999543
RowDirY:          0.0218149
RowDirZ:          -0.02092
ColDirX:          -0.019304
ColDirY:          0.993349
ColDirZ:          0.113511
NRows:            256
NCols:            256
FoVRows:          229.888
FoVCols:          229.888
SliceThickness:   3
GapThickness:     0

NrOfPastSpatialTransformations: 0

LeftRightConvention: Radiological

FirstDataSourceFile: "004_6_1.REC"

GradientDirectionsVerified:   NO
GradientXDirInterpretation:   3
GradientYDirInterpretation:   5
GradientZDirInterpretation:   1
GradientInformationAvailable: YES
-0.5    -0.707    -0.5    800    
-0.5    0.707    -0.5    800    
-0.707    0    0.707    800    
-0.707    -0.699    -0.11    800    
-0.7    -0.653    0.289    800    
-0.331    -0.705    0.627    800    
-0.273    -0.702    0.657    800    
-0.542    -0.504    -0.673    800    
-0.491    0.513    0.704    800    
-0.253    0.675    -0.693    800    
-0.707    0.028    -0.707    800    
-0.707    0.648    -0.282    800    
-0.702    0.651    0.289    800    
-0.706    0.054    0.706    800    
-0.205    0.683    0.701    800    
0    0    0    0


Changes

save the DMR first! e.g. "subjectA_allruns.dmr"

FileVersion:                   3
NrOfVolumes:                  48 <-- 3 runs, 16 volumes per run makes 48 volumes
NrOfSlices:                    42
NrOfSkippedVolumes:            0
Prefix:                        "subjectA_allruns" <-- change the name between quotes to the name of the concatenated DWI (not needed if you created a DMR from DICOM data). 
DataStorageFormat:             3
DataType:                      2
TR:                            3725
InterSliceTime:                88
TimeResolutionVerified:        0
TE:                            0
SliceAcquisitionOrder:         0
SliceAcquisitionOrderVerified: 0
ResolutionX:                   256
ResolutionY:                   256
LoadAMRFile:                   ""
ShowAMRFile:                   1
ImageIndex:                    0
LayoutNColumns:                7
LayoutNRows:                   6
LayoutZoomLevel:               1
SegmentSize:                   10
SegmentOffset:                 0
DisplayVolume:                 0
ProtocolFile:                  ""
InplaneResolutionX:            0.898
InplaneResolutionY:            0.898
SliceThickness:                3
SliceGap:                      0
VoxelResolutionVerified:       1

PositionInformationFromImageHeaders

PosInfosVerified: 1
CoordinateSystem: 1
Slice1CenterX:    -0.92
Slice1CenterY:    -8.1
Slice1CenterZ:    -33.72
SliceNCenterX:    1.65
SliceNCenterY:    -22.01
SliceNCenterZ:    88.47
RowDirX:          0.999543
RowDirY:          0.0218149
RowDirZ:          -0.02092
ColDirX:          -0.019304
ColDirY:          0.993349
ColDirZ:          0.113511
NRows:            256
NCols:            256
FoVRows:          229.888
FoVCols:          229.888
SliceThickness:   3
GapThickness:     0

NrOfPastSpatialTransformations: 0

LeftRightConvention: Radiological

FirstDataSourceFile: "004_6_1.REC"

GradientDirectionsVerified:   NO
GradientXDirInterpretation:   3
GradientYDirInterpretation:   5
GradientZDirInterpretation:   1
GradientInformationAvailable: YES
-0.5    -0.707    -0.5    800   <-- gradient 1 of run 1. Copy all gradients and paste them below. In total you need 3*number of volumes = 3*16 = 48 gradients in this example.
-0.5    0.707    -0.5    800    
-0.707    0    0.707    800    
-0.707    -0.699    -0.11    800    
-0.7    -0.653    0.289    800    
-0.331    -0.705    0.627    800    
-0.273    -0.702    0.657    800    
-0.542    -0.504    -0.673    800    
-0.491    0.513    0.704    800    
-0.253    0.675    -0.693    800    
-0.707    0.028    -0.707    800    
-0.707    0.648    -0.282    800    
-0.702    0.651    0.289    800    
-0.706    0.054    0.706    800    
-0.205    0.683    0.701    800    
0    0    0    0
-0.5    -0.707    -0.5    800     <-- gradient 1 of run 2
-0.5    0.707    -0.5    800    
-0.707    0    0.707    800    
-0.707    -0.699    -0.11    800    
-0.7    -0.653    0.289    800    
-0.331    -0.705    0.627    800    
-0.273    -0.702    0.657    800    
-0.542    -0.504    -0.673    800    
-0.491    0.513    0.704    800    
-0.253    0.675    -0.693    800    
-0.707    0.028    -0.707    800    
-0.707    0.648    -0.282    800    
-0.702    0.651    0.289    800    
-0.706    0.054    0.706    800    
-0.205    0.683    0.701    800    
0    0    0    0
-0.5    -0.707    -0.5    800    
<-- gradient 1 of run 3
-0.5    0.707    -0.5    800    
-0.707    0    0.707    800    
-0.707    -0.699    -0.11    800    
-0.7    -0.653    0.289    800    
-0.331    -0.705    0.627    800    
-0.273    -0.702    0.657    800    
-0.542    -0.504    -0.673    800    
-0.491    0.513    0.704    800    
-0.253    0.675    -0.693    800    
-0.707    0.028    -0.707    800    
-0.707    0.648    -0.282    800    
-0.702    0.651    0.289    800    
-0.706    0.054    0.706    800    
-0.205    0.683    0.701    800    
0    0    0    0

You are here: HomeBrainVoyagerDiffusion Weighted ImagingDMR creation ≫ Concatenate multiple runs into one DMR