2 # ---------------------------------------------------------------------
4 # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
6 # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
7 # Previous Authors : Laurent Guigues, Jean-Pierre Roux
8 # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
10 # This software is governed by the CeCILL-B license under French law and
11 # abiding by the rules of distribution of free software. You can use,
12 # modify and/ or redistribute the software under the terms of the CeCILL-B
13 # license as circulated by CEA, CNRS and INRIA at the following URL
14 # http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
15 # or in the file LICENSE.txt.
17 # As a counterpart to the access to the source code and rights to copy,
18 # modify and redistribute granted by the license, users are provided only
19 # with a limited warranty and the software's author, the holder of the
20 # economic rights, and the successive licensors have only limited
23 # The fact that you are presently reading this means that you have had
24 # knowledge of the CeCILL-B license and that you accept its terms.
25 # ------------------------------------------------------------------------
28 #include <creaImageIOWxPACSConnectionPanel.h>
29 #include <creaImageIOPACSConnection.h>
30 #include <creaImageIOSystem.h>
31 #if defined (USE_GDCM2)
32 #include "gdcmCompositeNetworkFunctions.h"
37 WxPACSConnectionPanel::WxPACSConnectionPanel(wxWindow *parent, wxDialog* dial, WxGimmickView* view)
39 -1, wxDefaultPosition,
51 GimmickDebugMessage(1,"WxPACSConnectionPanel::WxPACSConnectionPanel"
53 /// \TODO fix warning: unused variable dicId aet pn adv1 ad
54 wxStaticText * dicId=new wxStaticText(this,-1,_T(" DICOM Identification: "), wxPoint(5,5));
55 wxStaticText * aet=new wxStaticText(this,-1,_T(" AETitle: "), wxPoint(5,25));
56 aeTitle=new wxTextCtrl(this, wxID_ANY, _T("MyAeTitle"), wxPoint(75,25), wxSize(220,20));
58 wxStaticText * pn=new wxStaticText(this,-1,_T(" Port Number: "), wxPoint(5,53));
59 pNumber=new wxTextCtrl(this, wxID_ANY, _T("3306"), wxPoint(75,50), wxSize(220,20));
60 wxStaticText * adv1=new wxStaticText(this,-1,_T(" (1 - 131072) "), wxPoint(300,53));
62 wxStaticText * ad=new wxStaticText(this,-1,_T(" Address: "), wxPoint(5,80));
63 address=new wxTextCtrl(this, wxID_ANY, _T("localhost"), wxPoint(75,75), wxSize(220,20));
65 wxButton *query = new wxButton(this,wxID_ANY,_T("Query PACS Server"), wxPoint(5,110) );
66 Connect( query->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &WxPACSConnectionPanel::OnQueryPACS );
72 WxPACSConnectionPanel::~WxPACSConnectionPanel()
74 GimmickDebugMessage(1,"WxPACSConnectionPanel::~WxPACSConnectionPanel"
78 void WxPACSConnectionPanel::OnQueryPACS(wxCommandEvent& event)
80 #if defined (USE_GDCM2)
81 bool didItWork = gdcm::CompositeNetworkFunctions::CEcho( crea::wx2std(address->GetValue()).c_str(), 3600,
82 "CREATIS", crea::wx2std(aeTitle->GetValue()).c_str() );
84 tag.ReadFromCommaSeparatedString("10,10");
87 std::vector< std::pair<gdcm::Tag, std::string> > keys;
89 std::pair<gdcm::Tag, std::string> pa;
92 keys.push_back(std::make_pair(tag, ""));
93 gdcm::EQueryLevel theLevel = gdcm::ePatient;
94 gdcm::ERootType theRoot = gdcm::ePatientRootType;
95 gdcm::SmartPointer<gdcm::BaseRootQuery> theQuery = gdcm::CompositeNetworkFunctions::ConstructQuery(theRoot, theLevel ,keys);
98 std::vector<gdcm::DataSet> theDataSet;
99 gdcm::CompositeNetworkFunctions::CFind(crea::wx2std(address->GetValue()).c_str(), 3600, theQuery, theDataSet,
100 "CREATIS", crea::wx2std(aeTitle->GetValue()).c_str());
104 //======================================================================
106 //======================================================================
108 } // EO namespace creaImageIO