]> Creatis software - bbtk.git/blobdiff - packages/gdcmvtk/src/bbgdcmvtkGetXCoherentInfoGdcmReader.cxx
#3212 BBTK Feature New Normal - vtk8itk4wx3-mingw64
[bbtk.git] / packages / gdcmvtk / src / bbgdcmvtkGetXCoherentInfoGdcmReader.cxx
index c1d16ba58fb15afc84ccce9badb0f3705362fa51..39ff153e69dc68fc743921f10c94b4f4f0f2ba66 100644 (file)
@@ -146,9 +146,7 @@ void GetXCoherentInfoGdcmReader::Process()
    // Should only contain one!
    l = sh->GetFirstSingleSerieUIDFileSet();
 
-   int nbFiles;
-   double zspacing     = 0.;
-   nbFiles                     = l->size() ;
+   double zspacing = 0.;
    sh->OrderFileList(l); // this one should compute the *actual* Z Spacing!
    zspacing            = sh->GetZSpacing();
    std::vector<double> v_pixelspacing;
@@ -159,6 +157,35 @@ void GetXCoherentInfoGdcmReader::Process()
 //      v_pixelspacing.push_back(f->GetZSpacing());
 //   }
    bbSetOutputPixelSpacing(v_pixelspacing);
+
+       VectorMapInfoDicom vectormapinfodicom;
+       uint16_t group;
+       uint16_t elem;
+       std::string key;
+       std::string strTagValue;  // read on disc
+       int iTag,sizeDicomTagsVector=bbGetInputDicomTags().size();
+       GDCM_NAME_SPACE::FileList::const_iterator iitt = l->begin();
+       //iitt ++;
+       for ( ; iitt != l->end(); ++iitt)
+       {
+               MapInfoDicom mapinfodicom;
+
+               for (iTag=0; iTag<sizeDicomTagsVector; iTag++)
+               {
+                       key = bbGetInputDicomTags()[iTag];
+                       group = elem = 0;
+                       if ( (key.size()==10) && (key[0] == 'D') && (key[5] == '_') )
+                       {
+                               sscanf(key.c_str(),"D%04hx_%04hx ",&group,&elem);  
+                       }// if key
+                       strTagValue = (*iitt)->GetEntryString(group,elem);
+                       mapinfodicom.insert ( std::pair<std::string,std::string>(key,strTagValue) );
+               } // for iTag
+
+               vectormapinfodicom.push_back( mapinfodicom );
+   } // for iitt
+   bbSetOutputDicomInfo( vectormapinfodicom );
+
    if (reader!=NULL)
    { 
       reader->Delete();
@@ -172,7 +199,6 @@ void GetXCoherentInfoGdcmReader::Process()
    reader->Update();
    reader->GetOutput();
 
-printf("EED GetXCoherentInfoGdcmReader::Process \n");
    bbSetOutputOut( reader->GetOutput() );
 }
 #endif