Skip to content

Commit

Permalink
change MoCo naming and derived detection (#243)
Browse files Browse the repository at this point in the history
  • Loading branch information
neurolabusc committed Oct 30, 2018
1 parent 80b2a53 commit dd7c7f6
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
1 change: 1 addition & 0 deletions FILENAMING.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ In general dcm2niix creates images with 3D dimensions, or 4 dimensions when the
- _ADC Philips specific case. A DWI image where derived isotropic, ADC or trace volume was appended to the series. Since this image will disrupt subsequent processing, and because subsequent processing (dwidenoise, topup, eddy) will yield better derived images, dcm2niix will also create an additional image without this volume. Therefore, the _ADC file should typically be discarded. If you want dcm2niix to discard these useless derived images, use the ignore feature ('-i y').
- _Eq is specific to [CT scans](https://www.nitrc.org/plugins/mwiki/index.php/dcm2nii:MainPage#Computed_Tomography_.28CT.2C_CAT.29). These scans can be acquired with variable distance between the slices of a 3D volume. NIfTI asumes all 2D slices that form a 3D stack are equidistant. Therefore, dcm2niix reslices the input data to generate an equidistant volume.
- _Tilt is specific to [CT scans](https://www.nitrc.org/plugins/mwiki/index.php/dcm2nii:MainPage#Computed_Tomography_.28CT.2C_CAT.29). These scans can be acquired with a gantry tilt that causes a skew that can not be stored in a NIfTI qForm. Therefore, the slices are resampled to remove the effect of tilt.
- _MoCo is appended to the ProtocolName if Image Type (0008,0008) includes the term 'MOCO'. This helps disambiguate Siemens fMRI runs where both motion corrected and raw data is stored for a single session.

## Special Characters

Expand Down
15 changes: 15 additions & 0 deletions console/nii_dicom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4066,6 +4066,7 @@ double TE = 0.0; //most recent echo time recorded
int encapsulatedDataImageStart = 0; //position of 7FE0,0010 for compressed images (where actual image start should be start of first fragment)
bool isOrient = false;
bool isDcm4Che = false;
bool isMoCo = false;
bool isIconImageSequence = false;
bool isSwitchToImplicitVR = false;
bool isSwitchToBigEndian = false;
Expand Down Expand Up @@ -4471,6 +4472,18 @@ double TE = 0.0; //most recent echo time recorded
dcmStr (lLength, &buffer[lPos], d.imageType);
int slen;
slen = (int) strlen(d.imageType);
if((slen > 5) && strstr(d.imageType, "_MOCO_") ) {
//d.isDerived = true; //this would have 'i- y' skip MoCo images
isMoCo = true;
}
if((slen > 5) && strstr(d.imageType, "_ADC_") )
d.isDerived = true;
if((slen > 5) && strstr(d.imageType, "_TRACEW_") )
d.isDerived = true;
if((slen > 5) && strstr(d.imageType, "_TRACE_") )
d.isDerived = true;
if((slen > 5) && strstr(d.imageType, "_FA_") )
d.isDerived = true;
//if (strcmp(transferSyntax, "ORIGINAL_PRIMARY_M_ND_MOSAIC") == 0)
if((slen > 5) && !strcmp(d.imageType + slen - 6, "MOSAIC") )
isMosaic = true;
Expand Down Expand Up @@ -5707,6 +5720,8 @@ double TE = 0.0; //most recent echo time recorded
strcpy(d.protocolName, d.seriesDescription);
if ((strlen(d.protocolName) < 1) && (strlen(d.seriesDescription) > 1))
strcpy(d.protocolName, d.seriesDescription);
if ((strlen(d.protocolName) > 1) && (isMoCo))
strcat (d.protocolName,"_MoCo"); //disambiguate MoCo https://github.com/neurolabusc/MRIcroGL/issues/31
if ((strlen(d.protocolName) < 1) && (strlen(d.sequenceName) > 1) && (d.manufacturer != kMANUFACTURER_SIEMENS))
strcpy(d.protocolName, d.sequenceName); //protocolName (0018,1030) optional, sequence name (0018,0024) is not a good substitute for Siemens as it can vary per volume: *ep_b0 *ep_b1000#1, *ep_b1000#2, etc https://www.nitrc.org/forum/forum.php?thread_id=8771&forum_id=4703
// if (!isOrient) {
Expand Down
2 changes: 1 addition & 1 deletion console/nii_dicom.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ extern "C" {
#define kCCsuf " CompilerNA" //unknown compiler!
#endif

#define kDCMvers "v1.0.20181027 " kJP2suf kLSsuf kCCsuf
#define kDCMvers "v1.0.20181030 " kJP2suf kLSsuf kCCsuf

static const int kMaxEPI3D = 1024; //maximum number of EPI images in Siemens Mosaic
static const int kMaxDTI4D = 18000; //maximum number of DTI directions for 4D (Philips) images, also maximum number of 3D slices for Philips 3D and 4D images
Expand Down

0 comments on commit dd7c7f6

Please sign in to comment.