Skip to content

Commit

Permalink
Detect GE multi-band (#163 (comment))
Browse files Browse the repository at this point in the history
  • Loading branch information
neurolabusc committed Sep 24, 2018
1 parent 0b950b5 commit 6a7a573
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
8 changes: 4 additions & 4 deletions console/nii_dicom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,7 @@ int headerDcm2Nii2(struct TDICOMdata d, struct TDICOMdata d2, struct nifti_1_hea
// snprintf(h->descrip,80, "%s",txt);
strncpy(h->descrip, txt, 79);
h->descrip[79] = '\0';

if (strlen(d.imageComments) > 0)
snprintf(h->aux_file,24,"%.23s",d.imageComments);
return headerDcm2NiiSForm(d,d2, h, isVerbose);
Expand Down Expand Up @@ -3893,9 +3893,9 @@ const uint32_t kEffectiveTE = 0x0018+ (0x9082 << 16);
#define kNumberOfImagesInMosaic 0x0019+(0x100A<< 16 ) //US NumberOfImagesInMosaic
#define kDwellTime 0x0019+(0x1018<< 16 ) //IS in NSec, see https://github.com/rordenlab/dcm2niix/issues/127
#define kLastScanLoc 0x0019+(0x101B<< 16 )
#define kDiffusionDirectionGEX 0x0019+(0x10BB<< 16 ) //DS
#define kDiffusionDirectionGEY 0x0019+(0x10BC<< 16 ) //DS
#define kDiffusionDirectionGEZ 0x0019+(0x10BD<< 16 ) //DS
#define kDiffusionDirectionGEX 0x0019+(0x10BB<< 16 ) //DS phase diffusion direction
#define kDiffusionDirectionGEY 0x0019+(0x10BC<< 16 ) //DS frequency diffusion direction
#define kDiffusionDirectionGEZ 0x0019+(0x10BD<< 16 ) //DS slice diffusion direction
#define kSharedFunctionalGroupsSequence 0x5200+uint32_t(0x9229<< 16 ) // SQ
#define kPerFrameFunctionalGroupsSequence 0x5200+uint32_t(0x9230<< 16 ) // SQ
#define kBandwidthPerPixelPhaseEncode 0x0019+(0x1028<< 16 ) //FD
Expand Down
8 changes: 8 additions & 0 deletions console/nii_dicom_batch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2964,6 +2964,14 @@ int saveDcm2NiiCore(int nConvert, struct TDCMsort dcmSort[],struct TDICOMdata dc
for (int v = 0; v < hdr0.dim[3]; v++)
dcmList[dcmSort[0].indx].CSA.sliceTiming[v] = dcmList[dcmSort[v+j].indx].rtia_timerGE - minTime;
dcmList[dcmSort[0].indx].CSA.sliceTiming[hdr0.dim[3]] = -1;
//detect multi-band
int nZero = 0;
for (int v = 0; v < hdr0.dim[3]; v++)
if (isSameFloatGE(dcmList[dcmSort[0].indx].CSA.sliceTiming[hdr0.dim[3]], 0.0))
nZero ++;
if ((nZero > 1) && (nZero < hdr0.dim[3]) && ((hdr0.dim[3] % nZero) == 0))
dcmList[dcmSort[0].indx].CSA.multiBandFactor = nZero;
//report timines
if (opts.isVerbose > 1) {
printf("GE slice timing\n");
printf("\tTime\tX\tY\tZ\tInstance\n");
Expand Down

0 comments on commit 6a7a573

Please sign in to comment.