Skip to content

Commit

Permalink
Ignore non-spatial physio data (#606)
Browse files Browse the repository at this point in the history
  • Loading branch information
neurolabusc committed May 12, 2022
1 parent 6e51368 commit dea3fb9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions console/nii_dicom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6607,6 +6607,7 @@ const uint32_t kEffectiveTE = 0x0018 + (0x9082 << 16);
break;
case kSpectroscopyData: //kSpectroscopyDataPointColumns
printMessage("Skipping Spectroscopy DICOM '%s'\n", fname);
d.xyzDim[1] = 0; //issue606
d.imageStart = (int)lPos + (int)lFileOffset;
break;
case kCSAImageHeaderInfo:
Expand Down
8 changes: 5 additions & 3 deletions console/nii_dicom_batch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1229,7 +1229,6 @@ tse3d: T2*/
fprintf(fp, "\t\"Manufacturer\": \"UIH\",\n");
break;
};
json_Str(fp, "\t\"PulseSequenceName\": \"%s\",\n", d.pulseSequenceName);
//if (d.epiVersionGE == 0)
// fprintf(fp, "\t\"PulseSequenceName\": \"epi\",\n");
//if (d.epiVersionGE == 1)
Expand Down Expand Up @@ -1284,6 +1283,7 @@ tse3d: T2*/
json_Str(fp, "\t\"SequenceVariant\": \"%s\",\n", d.sequenceVariant);
json_Str(fp, "\t\"ScanOptions\": \"%s\",\n", d.scanOptions);
json_Str(fp, "\t\"SequenceName\": \"%s\",\n", d.sequenceName);
json_Str(fp, "\t\"PulseSequenceName\": \"%s\",\n", d.pulseSequenceName);
if (strlen(d.imageType) > 0) {
fprintf(fp, "\t\"ImageType\": [\"");
bool isSep = false;
Expand Down Expand Up @@ -2125,6 +2125,8 @@ int *nii_saveDTI(char pathoutname[], int nConvert, struct TDCMsort dcmSort[], st
if (opts.isOnlyBIDS)
return NULL;
uint64_t indx0 = dcmSort[0].indx; //first volume
if (isnan(dcmList[indx0].patientPosition[0]))
return NULL; //issue606 do not save bvec for non-spatial data (e.g. physio)
int numDti = dcmList[indx0].CSA.numDti;
#ifdef USING_R
ImageList *images = (ImageList *)opts.imageList;
Expand Down Expand Up @@ -6999,8 +7001,8 @@ int saveDcm2NiiCore(int nConvert, struct TDCMsort dcmSort[], struct TDICOMdata d
//~ if (!dcmList[dcmSort[0].indx].isSlicesSpatiallySequentialPhilips)
//~ nii_reorderSlices(imgM, &hdr0, dti4D);
//hdr0.pixdim[3] = dxNoTilt;
if (hdr0.dim[3] < 2)
printWarning("Check that 2D images are not mirrored.\n");
if ((hdr0.dim[3] < 2) && (!isnan(dcmList[dcmSort[0].indx].patientPosition[0])))
printWarning("Check that 2D images are not mirrored.\n"); // isnan does not warn for non-spatial images (physio)
#ifndef USING_R
else
fflush(stdout); //GUI buffers printf, display all results
Expand Down

0 comments on commit dea3fb9

Please sign in to comment.