]> Creatis software - creaImageIO.git/commitdiff
acces to DICOM infos from GIMMICK
authorFrederic Cervenansky <Frederic.Cervenansky@creatis.insa-lyon.fr>
Wed, 1 Jun 2011 09:03:05 +0000 (09:03 +0000)
committerFrederic Cervenansky <Frederic.Cervenansky@creatis.insa-lyon.fr>
Wed, 1 Jun 2011 09:03:05 +0000 (09:03 +0000)
src/creaImageIOExternalGimmick.cpp
src/creaImageIOWxSimpleDlg.cpp
src/creaImageIOWxSimpleDlg.h

index 7e56ab93827ca6189533914d92e9ccaf78e60338..34b0cb6114c35cf8d91b59b646b45ef42a2936dc 100644 (file)
@@ -29,6 +29,23 @@ vtkImageData* getImageDataDialog()
 }
 
 
+
+std::vector<creaImageIO::OutStrGimmick> getImagesInfoDialog()
+{
+    wxString infoImage;
+    std::vector<creaImageIO::OutStrGimmick> s;
+    creaImageIO::WxSimpleDlg w(0,_T("Select your image"),"creaContours_Descriptor.dscp","creatisContours DB");
+       w.setInfo(true);
+    w.ShowModal();
+    if(w.GetReturnCode() == wxID_OK)
+    {
+           s     = w.getMapInfos();
+    } 
+
+    return s;
+}
+
+
 /*EED Borrame
 vtkImageData* getImageDataDialog() {
        //      wxApp::OnInit();
index a9b1b4b9183fe398b111fa20209fce70e0de55e1..072e9e796a7a844a10e0a3bf9fbded8bdd559edb 100644 (file)
@@ -1,8 +1,5 @@
 #include "creaImageIOWxSimpleDlg.h"
-#include "creaImageIOWxGimmickReaderDialog.h"
-//#include <itkAnalyzeImageIO.h>
-//#include <itkImageFileReader.h>
-//#include <itkImage.h>
+
 
 namespace creaImageIO
 {
@@ -35,7 +32,7 @@ namespace creaImageIO
           Connect( gimmickBut->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &WxSimpleDlg::OnReadGimmick ); 
 
           /// \TODO  Button to select Bruker directory
-       
+          bInfo = false;
        Layout(); 
        
        }
@@ -54,8 +51,6 @@ namespace creaImageIO
                                fileDlg->GetPaths(wxArray);
                                if(wxArray.size() >0)
                                {
-                               /*      typedef itk::Image< float, 4 >         ImageType;
-                                       ReadImage<ImageType>(crea::wx2std(wxArray[0]).c_str());*/
 
                                        infoimage=_T("FILE(s):")+wxArray[0];
                                        std::vector<std::string> files;
@@ -120,28 +115,30 @@ namespace creaImageIO
                 dlg.ShowModal();
                 if (dlg.GetReturnCode() == wxID_OK)
             {
-       //              infoimage=_T("DICOM: ???_EED_???");
-//EED 07JUIN2010                       dlg.GetSelectedImages(m_results,3);
                        std::vector<creaImageIO::OutStrGimmick> out;
                        std::vector<std::string> attr;
-//                             attr.push_back("D0028_0010");
-//                             attr.push_back("D0008_0023");
-//                             attr.push_back("D0008_1070");
                                dlg.stopReading();
                                dlg.getSelected(out, attr,true,"");
-//                             crea::VtkBasicSlicer(out.front().img);
                        m_results.clear();
                        int size=out.size();
                        int ii;
-                       for (ii=0;ii<size;ii++)
+                       if(!bInfo)
                        {
-                               m_results.push_back(out[ii].img);
+                               for (ii=0;ii<size;ii++)
+                               {
+                                       m_results.push_back(out[ii].img);
+                               }
+                       }
+                       else
+                       {
+                               for (ii=0;ii<size;ii++)
+                               {
+                                       m_resultsInfo.push_back(out[ii]);
+                               }
                        }
-
                        dlg.OnExit();
                 }
                 SetReturnCode( dlg.GetReturnCode() );
-//              Close();
                 EndModal( dlg.GetReturnCode() );
           }
 
index 5c16190d83689e1a4bd553ef498cbce2efe784d7..dd258773cd256035fc3d347e0be579653c912475 100644 (file)
@@ -1,6 +1,6 @@
 #include "creaImageIOSimpleView.h"
 #include <creaWx.h>
-
+#include "creaImageIOWxGimmickReaderDialog.h"
 namespace creaImageIO
 {
  /**
@@ -34,8 +34,15 @@ namespace creaImageIO
                
                   wxString getInfoImage();
 
-       private:
+                  void setInfo(bool i_val){bInfo = i_val;}
+                  
+                  // OutStrGimmick:
+                  //   - vtkImageData *
+                  //   - std::map<std::string, std::string> mapDicomInfos (std::map<tag Dicom, Value>
+                  std::vector<creaImageIO::OutStrGimmick> getMapInfos(){return m_resultsInfo;}
 
+       private:
+               bool bInfo;
                std::string namedescp; 
                std::string namedb;
                wxString infoimage;
@@ -45,5 +52,9 @@ namespace creaImageIO
 
                /// vtkImageData vector
                std::vector<vtkImageData*> m_results;
+
+               std::vector<creaImageIO::OutStrGimmick> m_resultsInfo;
+               
+
        };
 }