Skip to content

Commit

Permalink
MR Solutions (#642)
Browse files Browse the repository at this point in the history
  • Loading branch information
neurolabusc committed Oct 24, 2022
1 parent 1239897 commit 2a9fbe8
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
4 changes: 4 additions & 0 deletions console/nii_dicom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -885,6 +885,7 @@ struct TDICOMdata clear_dicom_data() {
d.isHasOverlay = false;
d.isPrivateCreatorRemap = false;
d.isRealIsPhaseMapHz = false;
d.isQuadruped = false;
d.numberOfImagesInGridUIH = 0;
d.phaseEncodingRC = '?';
d.patientSex = '?';
Expand Down Expand Up @@ -1211,6 +1212,8 @@ int dcmStrManufacturer(const int lByteLength, unsigned char lBuffer[]) { //read
ret = kMANUFACTURER_UIH;
if ((toupper(cString[0]) == 'B') && (toupper(cString[1]) == 'R'))
ret = kMANUFACTURER_BRUKER;
if ((toupper(cString[0]) == 'M') && (toupper(cString[1]) == 'R'))
ret = kMANUFACTURER_MRSOLUTIONS;
//if (ret == kMANUFACTURER_UNKNOWN) //reduce verbosity: single warning for series : Unable to determine manufacturer (0008,0070)
// printWarning("Unknown manufacturer %s\n", cString);
//#ifdef _MSC_VER
Expand Down Expand Up @@ -5417,6 +5420,7 @@ const uint32_t kEffectiveTE = 0x0018 + (0x9082 << 16);
int slen = (int)strlen(aotTxt);
if ((slen < 9) || (strstr(aotTxt, "QUADRUPED") == NULL))
break;
d.isQuadruped = true;
printError("Anatomical Orientation Type (0010,2210) is QUADRUPED: rotate coordinates accordingly\n");
break;
}
Expand Down
5 changes: 3 additions & 2 deletions 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.20221021"
#define kDCMdate "v1.0.20221024"
#define kDCMvers kDCMdate " " kJP2suf kLSsuf kCCsuf kCPUsuf

static const int kMaxEPI3D = 1024; //maximum number of EPI images in Siemens Mosaic
Expand All @@ -70,6 +70,7 @@ static const int kMaxDTI4D = kMaxSlice2D; //issue460: maximum number of DTI dire
#define kMANUFACTURER_HITACHI 7
#define kMANUFACTURER_CANON 8
#define kMANUFACTURER_MEDISO 9
#define kMANUFACTURER_MRSOLUTIONS 10

//note: note a complete modality list, e.g. XA,PX, etc
#define kMODALITY_UNKNOWN 0
Expand Down Expand Up @@ -241,7 +242,7 @@ static const uint8_t MAX_NUMBER_OF_DIMENSIONS = 8;
char scanOptions[kDICOMStrLarge], institutionAddress[kDICOMStrLarge], imageComments[kDICOMStrLarge];
uint32_t dimensionIndexValues[MAX_NUMBER_OF_DIMENSIONS];
struct TCSAdata CSA;
bool isRealIsPhaseMapHz, isPrivateCreatorRemap, isHasOverlay, isEPI, isIR, isPartialFourier, isDiffusion, isVectorFromBMatrix, isRawDataStorage, isGrayscaleSoftcopyPresentationState, isStackableSeries, isCoilVaries, isNonParallelSlices, isBVecWorldCoordinates, isSegamiOasis, isXA10A, isScaleOrTEVaries, isScaleVariesEnh, isDerived, isXRay, isMultiEcho, isValid, is3DAcq, is2DAcq, isExplicitVR, isLittleEndian, isPlanarRGB, isSigned, isHasPhase, isHasImaginary, isHasReal, isHasMagnitude,isHasMixed, isFloat, isResampled, isLocalizer;
bool isQuadruped, isRealIsPhaseMapHz, isPrivateCreatorRemap, isHasOverlay, isEPI, isIR, isPartialFourier, isDiffusion, isVectorFromBMatrix, isRawDataStorage, isGrayscaleSoftcopyPresentationState, isStackableSeries, isCoilVaries, isNonParallelSlices, isBVecWorldCoordinates, isSegamiOasis, isXA10A, isScaleOrTEVaries, isScaleVariesEnh, isDerived, isXRay, isMultiEcho, isValid, is3DAcq, is2DAcq, isExplicitVR, isLittleEndian, isPlanarRGB, isSigned, isHasPhase, isHasImaginary, isHasReal, isHasMagnitude,isHasMixed, isFloat, isResampled, isLocalizer;
char phaseEncodingRC, patientSex;
};
struct TDCMprefs {
Expand Down
12 changes: 12 additions & 0 deletions console/nii_dicom_batch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1244,6 +1244,9 @@ tse3d: T2*/
case kMANUFACTURER_UIH:
fprintf(fp, "\t\"Manufacturer\": \"UIH\",\n");
break;
case kMANUFACTURER_MRSOLUTIONS:
fprintf(fp, "\t\"Manufacturer\": \"MRSolutions\",\n");
break;
};
//if (d.epiVersionGE == 0)
// fprintf(fp, "\t\"PulseSequenceName\": \"epi\",\n");
Expand Down Expand Up @@ -1284,6 +1287,8 @@ tse3d: T2*/
//d.patientBirthDate //convert from DICOM YYYYMMDD to JSON
//d.patientAge //4-digit Age String: nnnD, nnnW, nnnM, nnnY;
}
if (d.isQuadruped)
json_Bool(fp, "\t\"Quadruped\": %s,\n", true); // BIDS suggests 0018,9020 but Siemens V-series do not populate this, alternatives are CSA or (0018,0021) CS [SK\MTC\SP]
json_Str(fp, "\t\"BodyPartExamined\": \"%s\",\n", d.bodyPartExamined);
json_Str(fp, "\t\"PatientPosition\": \"%s\",\n", d.patientOrient); // 0018,5100 = PatientPosition in DICOM
json_Str(fp, "\t\"ProcedureStepDescription\": \"%s\",\n", d.procedureStepDescription);
Expand Down Expand Up @@ -3140,6 +3145,10 @@ int nii_createFilename(struct TDICOMdata dcm, char *niiFilename, struct TDCMopts
strcat(outname, "Ph");
else if (dcm.manufacturer == kMANUFACTURER_SIEMENS)
strcat(outname, "Si");
else if (dcm.manufacturer == kMANUFACTURER_MEDISO)
strcat(outname, "Me");
else if (dcm.manufacturer == kMANUFACTURER_MRSOLUTIONS)
strcat(outname, "MR");
else
strcat(outname, "NA"); //manufacturer name not available
}
Expand Down Expand Up @@ -3636,6 +3645,9 @@ void nii_saveAttributes(struct TDICOMdata &data, struct nifti_1_header &header,
case kMANUFACTURER_CANON:
images->addAttribute("manufacturer", "Canon");
break;
case kMANUFACTURER_MRSOLUTIONS:
images->addAttribute("manufacturer", "MRSolutions");
break;
}
images->addAttribute("scannerModelName", data.manufacturersModelName);
images->addAttribute("imageType", data.imageType);
Expand Down

0 comments on commit 2a9fbe8

Please sign in to comment.