22 #include <QFileDialog> 47 QTextCodec::setCodecForLocale( QTextCodec::codecForName (
"iso" ) );
52 treeWidgetPatients->setColumnWidth ( 0, 400 );
53 treeWidgetPatients->setColumnWidth ( 1, 100 );
54 treeWidgetPatients->setColumnWidth ( 2, 100 );
55 const QStringList labelsPatients = QStringList()
61 treeWidgetPatients->setHeaderLabels ( labelsPatients );
62 treeWidgetPatients->setContextMenuPolicy ( Qt::CustomContextMenu );
65 treeWidgetStudies->setColumnWidth ( 0, 200 );
66 treeWidgetStudies->setColumnWidth ( 1, 100 );
67 const QStringList labelsStudies = QStringList()
68 <<
"Studies description" 72 treeWidgetStudies->setHeaderLabels ( labelsStudies );
73 treeWidgetStudies->setContextMenuPolicy ( Qt::CustomContextMenu );
76 treeWidgetSeries->setColumnWidth ( 0, 230 );
77 treeWidgetSeries->setColumnWidth ( 1, 100 );
78 treeWidgetSeries->setColumnWidth ( 2, 100 );
79 const QStringList labelsSeries = QStringList()
80 <<
"Series description" 85 treeWidgetSeries->setHeaderLabels ( labelsSeries );
86 treeWidgetSeries->setContextMenuPolicy ( Qt::CustomContextMenu );
89 QDate currentDate = QDate::currentDate();
90 startDateEdit->setDate ( currentDate.addYears(-100) );
91 endDateEdit->setDate ( currentDate );
111 connect ( treeWidgetPatients, &QTreeWidget::currentItemChanged,
113 connect ( treeWidgetStudies, &QTreeWidget::currentItemChanged,
115 connect ( treeWidgetSeries, &QTreeWidget::currentItemChanged,
117 connect ( treeWidgetSeries, &QTreeWidget::itemClicked,
119 connect ( nameEdit, &QLineEdit::textChanged,
121 connect ( serieDescriptionEdit, &QLineEdit::textChanged,
123 connect ( studyDescriptionEdit, &QLineEdit::textChanged,
125 connect ( searchButton, &QPushButton::clicked,
127 connect ( cdromButton, &QPushButton::clicked,
129 connect ( patientSexComboBox,
static_cast<void (QComboBox::*)(
int)
>(&QComboBox::currentIndexChanged),
131 connect ( serieModalityComboBox,
static_cast<void (QComboBox::*)(
int)
>(&QComboBox::currentIndexChanged),
133 connect ( pacsComboBox,
static_cast<void (QComboBox::*)(
int)
>(&QComboBox::currentIndexChanged),
135 connect ( startDateEdit, &QDateEdit::dateChanged,
137 connect ( endDateEdit, &QDateEdit::dateChanged,
143 pacsComboBox->blockSignals (
true );
144 pacsComboBox->clear();
150 pacsComboBox->blockSignals (
false );
156 treeWidgetPatients->clear();
157 treeWidgetStudies->clear();
158 treeWidgetSeries->clear();
165 treeWidgetPatients->clear();
166 treeWidgetStudies->clear();
167 treeWidgetSeries->clear();
179 treeWidgetStudies->clear();
197 treeWidgetSeries->clear();
226 QString institution = current->data ( 5, 0 ).toString();
227 QString opName = current->data ( 6, 0 ).toString();
236 if ( item->checkState ( 0 ) == Qt::Checked ) {
280 qWarning() <<
"Modality not supported: " << serieModalityComboBox->currentText();
284 treeWidgetSeries->clear();
286 if ( treeWidgetPatients->currentItem() && treeWidgetStudies->currentItem() ) {
315 qWarning() <<
"Gender not supported: " << patientSexComboBox->currentText();
328 if ( startdate > endDateEdit->date() ) {
329 startDateEdit->blockSignals(
true);
330 startDateEdit->setDate ( endDateEdit->date() );
331 startDateEdit->blockSignals(
false);
336 treeWidgetStudies->clear();
337 treeWidgetSeries->clear();
339 if ( treeWidgetPatients->currentItem() ) {
344 qDebug() <<
"Date filtering not available in CD-Rom mode";
351 if ( enddate < startDateEdit->date() ) {
352 endDateEdit->blockSignals(
true);
353 endDateEdit->setDate(startDateEdit->date() );
354 endDateEdit->blockSignals(
false);
359 treeWidgetStudies->clear();
360 treeWidgetSeries->clear();
362 if ( treeWidgetPatients->currentItem() ) {
367 qDebug() <<
"Date filtering not available in CD-Rom mode";
377 if ( dialog.exec() ) {
387 QFileDialog dialog(
this);
388 dialog.setWindowTitle ( tr (
"Open dicomdir" ) );
389 dialog.setNameFilters(QStringList() <<
"Dicomdir files (dicomdir* DICOMDIR*)");
392 if (!QDir::drives().isEmpty()) {
393 dialog.setDirectory ( QDir::drives().first().absoluteDir() );
397 if ( dialog.exec() ) {
398 fileName = dialog.selectedFiles() [0];
401 if ( !fileName.isEmpty() ) {
402 if (QString::compare(fileName,
"dicomdir", Qt::CaseInsensitive)) {
411 if (pName.isEmpty() ) {
425 if ( description.isEmpty() ) {
433 treeWidgetStudies->clear();
434 treeWidgetSeries->clear();
444 if ( description.isEmpty() ) {
452 treeWidgetSeries->clear();
455 if ( treeWidgetPatients->currentItem() && treeWidgetStudies->currentItem() && d->
mode ==
QtDcm::PACS_MODE) {
void findPatientsScu()
Find SCU with Dcmtk code.
void loadDicomdir()
This method read the dicomdir file and populate the patient treewidget.
void setSeriesTreeWidget(QTreeWidget *widget)
static QtDcmPreferences * instance()
void setPatientsTreeWidget(QTreeWidget *widget)
void onStartDateChanged(const QDate &startdate)
void setSerieDescription(const QString &serieDescription)
Serie description setter.
void findImagesDicomdir(const QString &serieUID)
void removeSerieToImport(const QString &uid)
void onPatientItemSelected(QTreeWidgetItem *current, QTreeWidgetItem *previous)
void editPreferences()
Opens the PACS preferences dialog.
void getPreviewFromSelectedSerie(const QString &uid, int elementCount)
void onSerieItemSelected(QTreeWidgetItem *current, QTreeWidgetItem *previous)
void onCurrentModalityChanged(int index)
void setCurrentPacs(int index)
void findSeriesScu(const QString &patientName, const QString &studyUID)
static QtDcmManager * instance()
QList< QtDcmServer > servers() const
QtDcm server list getter.
void findSeriesDicomdir(const QString &patientName, const QString &studyDescription)
void setStudiesTreeWidget(QTreeWidget *widget)
void onStudyDescriptionTextChanged(const QString &description)
void updatePacsComboBox()
Updates the PACS list in combo box.
QList< QString > imagesList
void setPatientGender(const QString &sex)
void updateSerieInfo(const QString &eltCount, const QString &institution, const QString &name)
QMap< QString, QList< QString > > selectedSeries
Begin and end for Q/R retrieve parameters.
QList< QString > listOfImages() const
void setPatientName(const QString &patientName)
Patient name setter.
void addSerieToImport(const QString &uid)
void findImagesScu(const QString &uid)
void onEndDateChanged(const QDate &enddate)
void findStudiesScu(const QString &patientName)
void setEndDate(const QDate &date)
Study date setter.
void loadPatientsFromDicomdir()
void setStudyDescription(const QString &studyDescription)
Study description setter.
void setStartDate(const QDate &date)
Study date setter.
void onSerieDescriptionTextChanged(const QString &description)
void onCurrentGenderChanged(int index)
virtual ~QtDcm()
constructor
void onDicomMediaButtonClicked()
void openDicomdir()
Opens the dicomdir selectiondialog.
void onPacsSearchButtonClicked()
QDate beginDate
Id of the current selected serie.
void setDicomdir(const QString &dicomdir)
Set the dicomdir file name.
void onStudyItemSelected(QTreeWidgetItem *current, QTreeWidgetItem *previous)
void onCurrentPacsChanged(int index)
void setModality(const QString &modality)
Study modality setter.
QString currentSerieId
Contains the images filenames of the current serie (i.e selected in the treewidget) ...
void onPatientNameTextChanged(const QString &pName)
void findStudiesDicomdir(const QString &patientName)
void onSerieItemClicked(QTreeWidgetItem *current, int index)