INCLUDE(${CLITK_SOURCE_DIR}/cmake/build_opt.cmake)
#=========================================================
#=========================================================
-
+SET(vvPacsConnection true)
# Select what is compiled
ADD_SUBDIRECTORY(${CLITK_SOURCE_DIR}/common ${PROJECT_BINARY_DIR}/common)
ADD_SUBDIRECTORY(${CLITK_SOURCE_DIR}/tools ${PROJECT_BINARY_DIR}/tools)
vvSlicerManager.cxx
vvSlicerManagerCommand.cxx
vvUtils.cxx
-# vvMaximumIntensityProjection.cxx vvMesh.cxx
+# vvMaximumIntensityProjection.cxx
+ vvMesh.cxx
vvMeshActor.cxx
vvMeshReader.cxx
vvMidPosition.cxx
qt_ui/vvHelpDialog.ui
qt_ui/vvDocumentation.ui
qt_ui/vvDicomSeriesSelector.ui
-qt_ui/vvDummyWindow.ui #For testing )
+qt_ui/vvDummyWindow.ui #For testing
+qt_ui/vvPacsConnection.ui
+ qt_ui/vvPacsSettingsDialog.ui
+)
QT4_ADD_RESOURCES(vv_SRCS vvIcons.qrc)
# Add DICOM SERVER gui selector if the adequate GDCM is available
#IF(CLITK_USE_SYSTEM_GDCM)
-message("ololoa")
SET(vv_SRCS ${vv_SRCS}
vvQPacsConnection.cxx
vvPacsSettingsDialog.cxx)
- QT4_WRAP_CPP(vv_SRCS vvQPacsConnection.cxx
- vvPacsSettingsDialog.cxx)
- QT4_WRAP_UI(vv_UI_CXX qt_ui/vvPacsConnection.ui
- qt_ui/vvPacsSettingsDialog.ui)
+ QT4_WRAP_CPP(vv_SRCS vvQPacsConnection.h
+ vvPacsSettingsDialog.h)
+ #QT4_WRAP_UI(vv_UI_CXX qt_ui/vvPacsConnection.ui
+ # qt_ui/vvPacsSettingsDialog.ui)
#ENDIF(CLITK_USE_SYSTEM_GDCM)
# Add the autotools in the header vvToolsList.h for initialization of the dummy
<addaction name="separator"/>
<addaction name="actionOpen_Dicom"/>
<addaction name="actionOpen_VTK_contour"/>
+ <addaction name="actionConnect_Pacs"/>
<addaction name="separator"/>
<addaction name="actionSave_As"/>
<addaction name="separator"/>
<addaction name="actionExit"/>
<addaction name="separator"/>
<addaction name="separator"/>
- <addaction name="actionConnect_Pacs"/>
</widget>
<addaction name="menuFile"/>
<addaction name="menuOverlay"/>
<rect>
<x>0</x>
<y>0</y>
- <width>923</width>
- <height>783</height>
+ <width>933</width>
+ <height>802</height>
</rect>
</property>
<property name="font">
<string notr="true">...</string>
</property>
<property name="icon">
- <iconset>
- <normaloff>../icons/basket_download.png</normaloff>../icons/basket_download.png</iconset>
+ <iconset resource="../vvIcons.qrc">
+ <normaloff>:/common/icons/basket_download.png</normaloff>:/common/icons/basket_download.png</iconset>
</property>
<property name="iconSize">
<size>
<widget class="QGroupBox" name="groupBox">
<property name="geometry">
<rect>
- <x>70</x>
- <y>130</y>
+ <x>90</x>
+ <y>140</y>
<width>311</width>
<height>271</height>
</rect>
<widget class="QGroupBox" name="groupBox_2">
<property name="geometry">
<rect>
- <x>390</x>
- <y>130</y>
+ <x>410</x>
+ <y>150</y>
<width>451</width>
<height>271</height>
</rect>
<widget class="QTreeView" name="seriesTreeView">
<property name="geometry">
<rect>
- <x>90</x>
- <y>440</y>
+ <x>110</x>
+ <y>450</y>
<width>281</width>
<height>311</height>
</rect>
<widget class="QTreeView" name="imagesTreeView">
<property name="geometry">
<rect>
- <x>410</x>
- <y>440</y>
+ <x>450</x>
+ <y>450</y>
<width>411</width>
<height>311</height>
</rect>
<widget class="QGroupBox" name="groupBox_3">
<property name="geometry">
<rect>
- <x>70</x>
- <y>420</y>
+ <x>90</x>
+ <y>430</y>
<width>321</width>
<height>341</height>
</rect>
<widget class="QGroupBox" name="groupBox_4">
<property name="geometry">
<rect>
- <x>380</x>
- <y>420</y>
+ <x>420</x>
+ <y>430</y>
<width>451</width>
<height>341</height>
</rect>
</rect>
</property>
<property name="currentIndex">
- <number>0</number>
+ <number>1</number>
</property>
<widget class="QWidget" name="modalityTab">
<property name="enabled">
<rect>
<x>680</x>
<y>0</y>
- <width>231</width>
- <height>131</height>
+ <width>251</width>
+ <height>151</height>
</rect>
</property>
<property name="currentIndex">
- <number>0</number>
+ <number>1</number>
</property>
<widget class="QWidget" name="networkSelect">
<attribute name="title">
<property name="geometry">
<rect>
<x>180</x>
- <y>40</y>
- <width>41</width>
+ <y>90</y>
+ <width>61</width>
<height>23</height>
</rect>
</property>
<property name="text">
- <string>OK</string>
+ <string>Save</string>
</property>
</widget>
<widget class="QWidget" name="layoutWidget">
</item>
</layout>
</widget>
+ <widget class="QPushButton" name="removeNetworkButton">
+ <property name="geometry">
+ <rect>
+ <x>180</x>
+ <y>10</y>
+ <width>61</width>
+ <height>23</height>
+ </rect>
+ </property>
+ <property name="text">
+ <string>Remove</string>
+ </property>
+ </widget>
</widget>
</widget>
<widget class="QLabel" name="label_2">
<string notr="true">...</string>
</property>
<property name="icon">
- <iconset>
- <normaloff>bullet_info.png</normaloff>bullet_info.png</iconset>
+ <iconset resource="../vvIcons.qrc">
+ <normaloff>:/common/icons/bullet_info.png</normaloff>:/common/icons/bullet_info.png</iconset>
</property>
<property name="iconSize">
<size>
</rect>
</property>
<property name="text">
- <string notr="true">...</string>
+ <string notr="true"/>
</property>
<property name="icon">
- <iconset>
- <normaloff>../icons/edit.png</normaloff>../icons/edit.png</iconset>
+ <iconset resource="../vvIcons.qrc">
+ <normaloff>:/common/icons/edit.png</normaloff>:/common/icons/edit.png</iconset>
</property>
<property name="iconSize">
<size>
<zorder>optionsButton</zorder>
<zorder>label_email_2</zorder>
</widget>
+ <tabstops>
+ <tabstop>scanButton</tabstop>
+ <tabstop>text_ID</tabstop>
+ <tabstop>clearButton</tabstop>
+ <tabstop>text_NAME</tabstop>
+ <tabstop>importButton</tabstop>
+ <tabstop>seriesTreeView</tabstop>
+ <tabstop>imagesTreeView</tabstop>
+ <tabstop>text_PHYS</tabstop>
+ <tabstop>text_SDESC</tabstop>
+ <tabstop>tabFilter</tabstop>
+ <tabstop>tabNetwork</tabstop>
+ <tabstop>helpButton</tabstop>
+ <tabstop>optionsButton</tabstop>
+ <tabstop>patientTreeView</tabstop>
+ <tabstop>studyTreeView</tabstop>
+ <tabstop>check_MR</tabstop>
+ <tabstop>check_CR</tabstop>
+ <tabstop>check_OT</tabstop>
+ <tabstop>check_RF</tabstop>
+ <tabstop>check_SC</tabstop>
+ <tabstop>check_CT</tabstop>
+ <tabstop>check_US</tabstop>
+ <tabstop>check_NM</tabstop>
+ <tabstop>check_DR</tabstop>
+ <tabstop>check_SR</tabstop>
+ <tabstop>check_XA</tabstop>
+ <tabstop>check_MG</tabstop>
+ <tabstop>check_ModAll</tabstop>
+ <tabstop>comboDate</tabstop>
+ <tabstop>dateEdit</tabstop>
+ <tabstop>dateBetweenEdit</tabstop>
+ <tabstop>networkCombo</tabstop>
+ <tabstop>NetworkButton</tabstop>
+ <tabstop>NameEdit</tabstop>
+ <tabstop>AETitleEdit</tabstop>
+ <tabstop>AdressEdit</tabstop>
+ <tabstop>PortEdit</tabstop>
+ <tabstop>removeNetworkButton</tabstop>
+ </tabstops>
<resources>
<include location="../vvIcons.qrc"/>
</resources>
<file>icons/standardbutton-cancel-16.png</file>
<file>icons/identity.png</file>
<file>icons/basket_download.png</file>
- <file>icons/bullet_info.png</file>
+ <file>icons/edit.png</file>
<file>icons/bullet_info.png</file>
</qresource>
</RCC>
ui. tabNetwork->setTabText(1,QString(tr("Configuration")));
//ui.setChecked(true);
//ui.on_check_ModAll_clicked(true);
- QIcon icon;
- icon.addFile("basket_download.png",QSize(),QIcon::Normal,QIcon::Off);
- ui.importButton->setIcon(icon);
- icon.addFile("file_upload.png",QSize(),QIcon::Normal,QIcon::Off);
- // exportButton->setIcon(icon);
- icon.addFile("email_forward.png",QSize(),QIcon::Normal,QIcon::Off);
- icon.addFile("edit.png",QSize(),QIcon::Normal,QIcon::Off);
- ui.optionsButton->setIcon(icon);
- icon.addFile("bullet_info.png",QSize(),QIcon::Normal,QIcon::Off);
- ui.helpButton->setIcon(icon);
-
+
+
+ ui.networkCombo->addItem("");
ui.networkCombo->addItems(getDicomServers());
- connect(ui.networkCombo,SIGNAL(currentIndexChanged(int)),this,SLOT(connectServer(int)));
+
+ connect(ui.networkCombo,SIGNAL(currentIndexChanged(int)),this,SLOT(chooseServer(int)));
connect(ui.scanButton,SIGNAL(clicked()),this,SLOT(on_scanButton_clicked()));
+ connect(ui.importButton, SIGNAL(clicked()), this, SLOT(on_importButton_clicked()));
+ connect(ui.removeNetworkButton,SIGNAL(clicked()),this,SLOT(removeServer()));
+ connect(ui.NetworkButton,SIGNAL(clicked()),this,SLOT(modifyServer()));
update();
}
+void vvQPacsConnection::removeServer()
+{
+ removeDicomServer(m_nickname);
+ ui.networkCombo->removeItem(ui.networkCombo->findText(QString(m_nickname.c_str())));
+ m_nickname="";
+ refreshNetworks();
+}
+
+void vvQPacsConnection::modifyServer()
+{
+ AddDicomServer(ui.NameEdit->text().toStdString(),ui.AETitleEdit->text().toStdString(),ui.AdressEdit->text().toStdString(),ui.PortEdit->text().toStdString());
+ removeServer();
+}
+
+
void vvQPacsConnection::refreshNetworks()
{
ui.networkCombo->clear();
+ ui.networkCombo->addItem(QString());
ui.networkCombo->addItems(getDicomServers());
- //ui.networkCombo->show();
+ ui.NameEdit->setText(QString());
+ ui.AETitleEdit->setText(QString());
+ ui.AdressEdit->setText(QString());
+ ui.PortEdit->setText(QString());
+ ui.tabNetwork->setCurrentIndex(0);
}
void vvQPacsConnection::on_clearButton_clicked()
manageStudiesFilter(true);
bool didItWork = gdcm::CompositeNetworkFunctions::CEcho(m_adress.c_str(), atoi(m_port.c_str()), "CREATIS", m_nickname.c_str() );
- std::vector< std::pair<gdcm::Tag, std::string> > keys = getKeys();
+ if (didItWork)
+ {
+ std::vector< std::pair<gdcm::Tag, std::string> > keys = getKeys();
- gdcm::EQueryLevel theLevel = gdcm::eStudy;
- gdcm::ERootType theRoot = gdcm::eStudyRootType;//ePatientRootType;
+ gdcm::EQueryLevel theLevel = gdcm::eStudy;
+ gdcm::ERootType theRoot = gdcm::eStudyRootType;//ePatientRootType;
- std::vector<gdcm::DataSet> theDataSet;
- theLevel = gdcm::ePatient;
- theRoot = gdcm::ePatientRootType;//ePatientRootType;
- gdcm::SmartPointer<gdcm::BaseRootQuery> theQuery = gdcm::CompositeNetworkFunctions::ConstructQuery(theRoot, theLevel ,getPatientKeys(""));
- gdcm::CompositeNetworkFunctions::CFind(m_adress.c_str(), atoi(m_port.c_str()), theQuery, theDataSet, "CREATIS", m_nickname.c_str());
- std::vector<gdcm::DataSet>::iterator it_ds = theDataSet.begin();
+ std::vector<gdcm::DataSet> theDataSet;
+ theLevel = gdcm::ePatient;
+ theRoot = gdcm::ePatientRootType;//ePatientRootType;
+ gdcm::SmartPointer<gdcm::BaseRootQuery> theQuery = gdcm::CompositeNetworkFunctions::ConstructQuery(theRoot, theLevel ,getPatientKeys(""));
+ gdcm::CompositeNetworkFunctions::CFind(m_adress.c_str(), atoi(m_port.c_str()), theQuery, theDataSet, "CREATIS", m_nickname.c_str());
+ std::vector<gdcm::DataSet>::iterator it_ds = theDataSet.begin();
- for(; it_ds != theDataSet.end(); it_ds++)
- {
- QList<QStandardItem *> items;
- const gdcm::DataSet ds = (*it_ds);
- std::vector< std::pair<gdcm::Tag, std::string> >::iterator it_key = keys.begin();
- int ind = 0;
- for(; it_key != keys.end(); it_key++, ind++)
+ for(; it_ds != theDataSet.end(); it_ds++)
{
- gdcm::DataElement de = ds.GetDataElement((*it_key).first);
- QStandardItem *item = new QStandardItem;
- const gdcm::ByteValue *bv = (de).GetByteValue();
- if( !de.IsEmpty() )
- {
- std::string buffer = std::string( bv->GetPointer(), bv->GetLength() );
- item->setText(tr(buffer.c_str()));
- }
- else
- {
- item->setText(tr(""));
- }
- if(ind ==0)
+ QList<QStandardItem *> items;
+ const gdcm::DataSet ds = (*it_ds);
+ std::vector< std::pair<gdcm::Tag, std::string> >::iterator it_key = keys.begin();
+ int ind = 0;
+ for(; it_key != keys.end(); it_key++, ind++)
{
- item->setCheckable(true);
+ gdcm::DataElement de = ds.GetDataElement((*it_key).first);
+ QStandardItem *item = new QStandardItem;
+ const gdcm::ByteValue *bv = (de).GetByteValue();
+ if( !de.IsEmpty() )
+ {
+ std::string buffer = std::string( bv->GetPointer(), bv->GetLength() );
+ item->setText(tr(buffer.c_str()));
+ }
+ else
+ {
+ item->setText(tr(""));
+ }
+ if(ind ==0)
+ {
+ item->setCheckable(true);
+ }
+ items.push_back(item);
}
- items.push_back(item);
+ Patientmodel->appendRow(items);
}
- Patientmodel->appendRow(items);
}
}
}
-
+// TreeViews creation
void vvQPacsConnection::createTreeView()
{
// Patient Tree View
}
-void vvQPacsConnection::connectServer(int index)
+void vvQPacsConnection::chooseServer(int index)
{
std::map < std::string, std:: string> values = getDicomServer(ui.networkCombo->currentText());
m_port = values["PORT"];
void vvQPacsConnection::on_importButton_clicked()
{
+
QModelIndex index;
QVariant elt= Patientmodel->data(index.sibling(ui.patientTreeView->selectionModel()->selectedRows().first().row(),1));
// gdcm::CompositeNetworkFunctions::CFind("127.0.0.1", 5678, theQuery, theDataSet, "CREATIS", "CONQUESTSRV1");
bool didItWork = gdcm::CompositeNetworkFunctions::CMove(m_adress.c_str(),atoi(m_port.c_str()), theQuery, 0,
- "CREATIS", m_nickname.c_str(), "d:\\temp_pacs_import\\" );
+ "CREATIS", m_nickname.c_str() );
}
\ No newline at end of file
void on_optionsButton_clicked();
void on_check_ModAll_clicked(bool state);
void on_importButton_clicked();
- void connectServer(int index);
+ void chooseServer(int index);
+ void removeServer();
+ void modifyServer();
private :
Ui::vvPacsConnection ui;
return result;
}
-/// Add new Dicom Server
+/// Add a new Dicom Server
void AddDicomServer(std::string nickname, std::string aetitle, std::string adress, std::string port)
{
QSettings settings(getVVSettingsPath(), getSettingsOptionFormat());
settings.endGroup();
}
+/// Remove a Dicom Server
+void removeDicomServer(std::string nickname)
+{
+ QSettings settings(getVVSettingsPath(), getSettingsOptionFormat());
+ settings.beginGroup(QString::fromStdString("DICOMSERVER"));
+ std::string temp = nickname + "//";
+ settings.remove(QString::fromStdString(temp + "nickname"));
+ settings.remove(QString::fromStdString(temp + "AETITLE"));
+ settings.remove(QString::fromStdString(temp + "ADRESS"));
+ settings.remove(QString::fromStdString(temp + "PORT"));
+ settings.endGroup();
+}
+
+
+
-//std::map <std::string, std::vector<std::string> > getDicomServers()
+/// get the list of a Dicom Server
QStringList getDicomServers()
{
return list;
}
+/// get needed Infos for a Dicom Server
std::map <std::string,std::string > getDicomServer(QString nickname)
{
std::map< std::string, std::string >results;
/// Add a Dicom Server to settings
void AddDicomServer(std::string nickname, std::string aetitle, std::string adress, std::string port);
+/// Remove a Dicom Server to settings
+void removeDicomServer(std::string nickname);
+
// get List of Dicom Servers
QStringList getDicomServers();