]> Creatis software - creaBruker.git/commitdiff
Series Nb
authorjean-pierre roux <jean-pierre.roux@creatis.insa-lyon.fr>
Wed, 27 May 2009 16:27:29 +0000 (16:27 +0000)
committerjean-pierre roux <jean-pierre.roux@creatis.insa-lyon.fr>
Wed, 27 May 2009 16:27:29 +0000 (16:27 +0000)
lib/src1/bruker2dicom.cxx
lib/src1/bruker2dicom.h

index 94f235e078dea98d1bdc23c4d5f5091a93e0faab..aca5d1c9235cc46d74d300a699e9dbed94c6ef2d 100644 (file)
@@ -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");
index 85e821252476af894436ae6b1f2d79990ba55f57..0199ec02cc804e9c4515f70b49d5b9c0ad79c3f8 100644 (file)
@@ -118,7 +118,8 @@ private :
    std::string strStudyTimeDate;
    std::string strPatientName;
    
-   int serieNumber;      
+   int serieNumber;
+   int instanceNumber;      
 };