Skip to content

Commit

Permalink
Philips renaming (#795)
Browse files Browse the repository at this point in the history
  • Loading branch information
neurolabusc committed Mar 1, 2024
1 parent bca228c commit cb60b43
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 16 deletions.
44 changes: 30 additions & 14 deletions console/nii_dicom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5166,6 +5166,10 @@ const uint32_t kEffectiveTE = 0x0018 + uint32_t(0x9082 << 16); //FD
privateCreatorRemap = 0;
char privateCreator[kDICOMStr];
dcmStr(lLength, &buffer[lPos], privateCreator);
//
int s_len = strlen(privateCreator);
for (int i = 0; i < s_len; i++)
privateCreator[i] = toupper(privateCreator[i]);
//next lines determine remapping, append as needed
//Siemens https://github.com/dcm4che/dcm4che/blob/master/dcm4che-dict/src/main/dicom3tools/libsrc/standard/elmdict/siemens.tpl
if (strstr(privateCreator, "SIEMENS MR HEADER") != NULL)
Expand Down Expand Up @@ -5194,18 +5198,30 @@ const uint32_t kEffectiveTE = 0x0018 + uint32_t(0x9082 << 16); //FD
if ((grp == 0x07a3) && (strstr(privateCreator, "ELSCINT1") != NULL))
privateCreatorRemap = 0x07a3 + (0x1000 << 16);
//Philips https://github.com/dcm4che/dcm4che/blob/master/dcm4che-dict/src/main/dicom3tools/libsrc/standard/elmdict/philips.tpl
if (strstr(privateCreator, "PHILIPS IMAGING DD 001") != NULL)
privateCreatorRemap = 0x2001 + (0x1000 << 16);
if (strstr(privateCreator, "Philips Imaging DD 001") != NULL)
privateCreatorRemap = 0x2001 + (0x1000 << 16);
if (strstr(privateCreator, "PHILIPS MR IMAGING DD 001") != NULL)
privateCreatorRemap = 0x2005 + (0x1000 << 16);
if (strstr(privateCreator, "Philips MR Imaging DD 001") != NULL)
privateCreatorRemap = 0x2005 + (0x1000 << 16);
if (strstr(privateCreator, "PHILIPS MR IMAGING DD 005") != NULL)
privateCreatorRemap = 0x2005 + (0x1400 << 16);
if (strstr(privateCreator, "Philips MR Imaging DD 005") != NULL)
privateCreatorRemap = 0x2005 + (0x1400 << 16);
if (strstr(privateCreator, "PHILIPS IMAGING") != NULL) {
if (strstr(privateCreator, "DD 001") != NULL)
privateCreatorRemap = 0x2001 + (0x1000 << 16);
if (strstr(privateCreator, "DD 002") != NULL)
privateCreatorRemap = 0x2001 + (0x1100 << 16);
if (strstr(privateCreator, "DD 003") != NULL)
privateCreatorRemap = 0x2001 + (0x1200 << 16);
if (strstr(privateCreator, "DD 004") != NULL)
privateCreatorRemap = 0x2001 + (0x1300 << 16);
if (strstr(privateCreator, "DD 005") != NULL)
privateCreatorRemap = 0x2001 + (0x1400 << 16);
}
if (strstr(privateCreator, "PHILIPS MR IMAGING") != NULL) {
if (strstr(privateCreator, "DD 001") != NULL)
privateCreatorRemap = 0x2005 + (0x1000 << 16);
if (strstr(privateCreator, "DD 002") != NULL)
privateCreatorRemap = 0x2005 + (0x1100 << 16);
if (strstr(privateCreator, "DD 003") != NULL)
privateCreatorRemap = 0x2005 + (0x1200 << 16);
if (strstr(privateCreator, "DD 004") != NULL)
privateCreatorRemap = 0x2005 + (0x1300 << 16);
if (strstr(privateCreator, "DD 005") != NULL)
privateCreatorRemap = 0x2005 + (0x1400 << 16);
}
//UIH https://github.com/neurolabusc/dcm_qa_uih
if (strstr(privateCreator, "Image Private Header") != NULL)
privateCreatorRemap = 0x0065 + (0x1000 << 16);
Expand Down Expand Up @@ -6392,8 +6408,8 @@ const uint32_t kEffectiveTE = 0x0018 + uint32_t(0x9082 << 16); //FD
break;
case kTE:
TE = dcmStrFloat(lLength, &buffer[lPos]);
if (d.TE <= 0.0)
d.TE = TE;
//20240229 if (d.TE <= 0.0)
d.TE = TE;
break;
case kNumberOfAverages:
d.numberOfAverages = dcmStrFloat(lLength, &buffer[lPos]);
Expand Down
2 changes: 1 addition & 1 deletion console/nii_dicom.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ extern "C" {
#define kCPUsuf " " //unknown CPU
#endif

#define kDCMdate "v1.0.20240222"
#define kDCMdate "v1.0.20240229"
#define kDCMvers kDCMdate " " kJP2suf kLSsuf kCCsuf kCPUsuf

static const int kMaxEPI3D = 1024; //maximum number of EPI images in Siemens Mosaic
Expand Down
2 changes: 1 addition & 1 deletion console/nii_dicom_batch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6859,7 +6859,7 @@ void setBidsPhilips(struct TDICOMdata *d, int nConvert, int isVerbose) {
strcat(suffixBIDS,modalityBIDS);
}
//if ((isVerbose > 0) || (strlen(dataTypeBIDS) < 1))
//if (isVerbose > 0)
if (isVerbose > 0)
printf("::autoBids:Philips pulseSeq:'%s' scanSeq:'%s' seqVariant:'%s'\n",
d->pulseSequenceName, d->scanningSequence, d->sequenceVariant);
if (isDerived)
Expand Down

0 comments on commit cb60b43

Please sign in to comment.