From: jean-pierre roux Date: Wed, 27 May 2009 16:27:29 +0000 (+0000) Subject: Series Nb X-Git-Tag: CREATOOLS.2-0-3~42 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=fb90261cac445da2301d351d17ab66dd24eb8fec;hp=41a88194c6cf13ffd489408b05fa48d27fd774dc;p=creaBruker.git Series Nb --- diff --git a/lib/src1/bruker2dicom.cxx b/lib/src1/bruker2dicom.cxx index 94f235e..aca5d1c 100644 --- a/lib/src1/bruker2dicom.cxx +++ b/lib/src1/bruker2dicom.cxx @@ -116,6 +116,7 @@ bool Bruker2Dicom::Execute() 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) @@ -827,7 +828,7 @@ void Bruker2Dicom::dealWithCarto(GDCM_NAME_SPACE::DirListType &fileNames, int NX // 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]; @@ -1207,14 +1208,27 @@ void Bruker2Dicom::MakeDicomImage(unsigned char *tabPixels, // 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] @@ -1230,10 +1244,10 @@ void Bruker2Dicom::MakeDicomImage(unsigned char *tabPixels, /// \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"); diff --git a/lib/src1/bruker2dicom.h b/lib/src1/bruker2dicom.h index 85e8212..0199ec0 100644 --- a/lib/src1/bruker2dicom.h +++ b/lib/src1/bruker2dicom.h @@ -118,7 +118,8 @@ private : std::string strStudyTimeDate; std::string strPatientName; - int serieNumber; + int serieNumber; + int instanceNumber; };