Skip to content

Commit

Permalink
improve bids guess (#751)
Browse files Browse the repository at this point in the history
  • Loading branch information
neurolabusc committed Sep 7, 2023
1 parent 4ce4f94 commit 6c5f177
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
4 changes: 4 additions & 0 deletions console/nii_dicom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7921,6 +7921,8 @@ const uint32_t kEffectiveTE = 0x0018 + uint32_t(0x9082 << 16); //FD
//if (contentTime != 0.0) && (numDimensionIndexValues < (MAX_NUMBER_OF_DIMENSIONS - 1)){
// uint_32t timeCRC = mz_crc32X((unsigned char*) &contentTime, sizeof(double));
//}
if (numberOfFramesICEdims < 2) //issue751: icedims[20] frames for EPI only
numberOfFramesICEdims = 0;
if ((numberOfFramesICEdims > 0) && (d.xyzDim[3] != numberOfFramesICEdims)) {
printWarning("Series %ld includes partial volume (issue 742): %d slices acquired but ICE dims (0021,118e) specifies %d \n", d.seriesNum, d.xyzDim[3], numberOfFramesICEdims);
d.seriesNum += 1000;
Expand Down Expand Up @@ -8136,6 +8138,8 @@ const uint32_t kEffectiveTE = 0x0018 + uint32_t(0x9082 << 16); //FD
d.isValid = false;
}
//printf("%g\t%g\t%s\n", d.intenIntercept, d.intenScale, fname);
if ((d.isLocalizer) && (strstr(d.seriesDescription, "b1map"))) //issue751 b1map uses same base as scout
d.isLocalizer = false;
return d;
} // readDICOMx()

Expand Down
19 changes: 13 additions & 6 deletions console/nii_dicom_batch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6442,12 +6442,10 @@ void reportProtocolBlockGE(struct TDICOMdata *d, const char *filename, int isVer
#endif
} //bidsGE

void bidsStr() { //

}

void setBidsSiemens(struct TDICOMdata *d, int nConvert, int isVerbose, const char *filename) {
char seqDetails[kDICOMStrLarge] = "";
char acqStr[kDICOMStrLarge] = "";
char preAcqStr[kDICOMStrLarge] = "";
float inv1 = NAN;
float inv2 = NAN;
bool isDualTI = false;
Expand Down Expand Up @@ -6499,6 +6497,15 @@ void setBidsSiemens(struct TDICOMdata *d, int nConvert, int isVerbose, const cha
if (((d->xyzDim[3] < 2) && (nConvert < 1)) || (d->isLocalizer)) { //need nConvert or nifti header
strcpy(dataTypeBIDS, "discard");
strcpy(modalityBIDS, "localizer");
} else if (strstr(seqDetails,"b1map")) {
//issue 751 nb both T1 and b1map can use tfl base
//https://bids-specification.readthedocs.io/en/stable/appendices/qmri.html#tb1tfl-and-tb1rfm-specific-notes
strcpy(dataTypeBIDS, "fmap");
strcpy(modalityBIDS, "TB1TFL");
if ((strstr(d->imageType, "FLIP ANGLE MAP")) || (strstr(d->imageType, "FLIP ANGLE MAP")))
strcpy(preAcqStr, "famp");
else
strcpy(preAcqStr, "anat");
} else if ((strstr(seqDetails, "tfl") != NULL) || (strstr(seqDetails, "mp2rage") != NULL) || (strstr(seqDetails, "wip925") != NULL)) { //prog_mprage
strcpy(dataTypeBIDS, "anat");
if (isDualTI)
Expand Down Expand Up @@ -6615,8 +6622,8 @@ void setBidsSiemens(struct TDICOMdata *d, int nConvert, int isVerbose, const cha
strcpy(modalityBIDS, "epi");
isDirLabel = true;
}
char acqStr[kDICOMStrLarge] = "";
strcat(acqStr, "_acq-");
strcpy(acqStr, "_acq-");
strcat(acqStr, preAcqStr);
int len = strlen(seqName);
if (len > 0) {
for (int i = 0; i < len; i++) {
Expand Down

0 comments on commit 6c5f177

Please sign in to comment.