From 4862f585cb0e956a5833230884ef354002b8b47d Mon Sep 17 00:00:00 2001 From: Chris Rorden Date: Wed, 19 Dec 2018 07:40:24 -0500 Subject: [PATCH] Use ucReadOutMode to detect monopolar/bipolar diffusion (https://github.com/poldracklab/fmriprep/pull/1359#issuecomment-448379329) --- console/nii_dicom_batch.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/console/nii_dicom_batch.cpp b/console/nii_dicom_batch.cpp index 62e81fc4..1a062667 100644 --- a/console/nii_dicom_batch.cpp +++ b/console/nii_dicom_batch.cpp @@ -557,6 +557,13 @@ void siemensCsaAscii(const char * filename, int csaOffset, int csaLength, float #endif char keyStrDS[] = "sDiffusion.dsScheme"; *difBipolar = readKey(keyStrDS, keyPos, csaLengthTrim); + if (*difBipolar == 0) { + char keyStrROM[] = "ucReadOutMode"; + *difBipolar = readKey(keyStrROM, keyPos, csaLengthTrim); + if ((*difBipolar >= 1) && (*difBipolar <= 2)) { //E11C Siemens/CMRR dsScheme: 1=bipolar, 2=unipolar, B17 CMRR ucReadOutMode 0x1=monopolar, 0x2=bipolar + *difBipolar = 3 - *difBipolar; + } //https://github.com/poldracklab/fmriprep/pull/1359#issuecomment-448379329 + } char keyStrES[] = "sFastImaging.lEchoSpacing"; *echoSpacing = readKey(keyStrES, keyPos, csaLengthTrim); char keyStrBase[] = "sKSpace.lBaseResolution";