strStudyUID = GDCM_NAME_SPACE::Util::CreateUniqueUID();
serieNumber = 0;
+ instanceNumber = 0;
// -----------------------------------------------------
// Iterate to ALL the objets(files/directories) found in the input directory
// (this is level ZERO)
// deal with MatLab-generated Carto file.
// -----------------------------------------------------
- char *code[] ={ "ADC", "adc", "TTP", "ttp", "PEAK", "peak" , ""}; // add more carto file name identifiers if necessary; end with ""
+ char *code[] ={ "ADC", "adc", "TTP", "ttp", "PEAK", "peak", "" }; // add more carto file name identifiers if necessary; end with ""
int icode;
GDCM_NAME_SPACE::DirListType::iterator it;
char file_name_ident[500];
// 0018 0050 DS 1 Slice Thickness
str.str("");
str << sliceDistance;
- file->InsertEntryString(str.str(),0x0018,0x0050, "DS");
-
+ file->InsertEntryString(str.str(),0x0018,0x0050, "DS");
+
+// 0020 0011 IS 1 Series Number
+ str.str("");
+ str << serieNumber;
+ file->InsertEntryString(str.str(),0x0020,0x0011, "IS");
+
+// 0020|0013 [IS] [Instance Number]
+ instanceNumber++;
+ str.str("");
+ str << instanceNumber;
+ file->InsertEntryString(str.str(),0x0020,0x0013, "IS");
+
+
// 1.2.840.10008.5.1.4.1.1.4.1 : Enhanced MR Image Storage
// file->InsertEntryString("1.2.840.10008.5.1.4.1.1.4.1" , 0x0002, 0x0002, "UI"); // [Media Storage SOP Class UID]
// file->InsertEntryString("1.2.840.10008.5.1.4.1.1.4.1" , 0x0008, 0x0016, "UI"); // [SOP Class UID]
// OK : MR is NOT multiframe, but I want just a quick an dirty solution
+
// 1.2.840.10008.5.1.4.1.1.4 MR Image Storage
file->InsertEntryString("1.2.840.10008.5.1.4.1.1.4" , 0x0002, 0x0002, "UI"); // [Media Storage SOP Class UID]
file->InsertEntryString("1.2.840.10008.5.1.4.1.1.4" , 0x0008, 0x0016, "UI"); // [SOP Class UID]
/// \TODO split into 2 strings!
file->InsertEntryString(strStudyTimeDate.substr(10,11).c_str(),0x0008,0x0020, "DA");
- file->InsertEntryString(strStudyTimeDate.substr(1,8).c_str(),0x0008,0x0030, "TM");
+ file->InsertEntryString(strStudyTimeDate.substr(1,8).c_str(), 0x0008,0x0030, "TM");
- file->InsertEntryString(studyDescr,0x0008,0x1030, "LO"); // Study Description
- file->InsertEntryString(serieDescr,0x0008,0x103e, "LO"); // Series Description
+ file->InsertEntryString(studyDescr, 0x0008,0x1030, "LO"); // Study Description
+ file->InsertEntryString(serieDescr, 0x0008,0x103e, "LO"); // Series Description
//0008|0060 [CS] [Modality]
file->InsertEntryString("MR",0x0008,0x0060, "CS");