23 #include <QMessageBox>
24 #include <QProgressDialog>
30 : QWidget(parent), m_LocalIndexer(new ctkDICOMIndexer(parent)), m_Controls(nullptr)
44 m_Controls =
new Ui::QmitkDicomLocalStorageWidgetControls;
51 SIGNAL(seriesSelectionChanged(
const QStringList &)),
55 SIGNAL(seriesSelectionChanged(
const QStringList &)),
63 m_Controls->ctkDicomBrowser->setTableOrientation(Qt::Vertical);
93 m_Controls->ctkDicomBrowser->updateTableViews();
98 auto selectedPatientUIDs =
m_Controls->ctkDicomBrowser->currentPatientsSelection();
100 if (!selectedPatientUIDs.empty())
102 QStringList studyUIDs;
104 for (
const auto &patientUID : selectedPatientUIDs)
107 QStringList seriesUIDs;
109 for (
const auto &studyUID : studyUIDs)
112 auto answer = QMessageBox::question(
nullptr,
114 QString(
"Do you really want to delete %1 %2, containing %3 series in %4 %5?")
115 .arg(selectedPatientUIDs.count())
116 .arg(selectedPatientUIDs.count() != 1 ?
"patients" :
"patient")
117 .arg(seriesUIDs.count())
118 .arg(studyUIDs.count())
119 .arg(studyUIDs.count() != 1 ?
"studies" :
"study"),
120 QMessageBox::Yes | QMessageBox::No,
123 if (answer == QMessageBox::Yes)
125 for (
const auto &patientUID : selectedPatientUIDs)
137 auto selectedStudyUIDs =
m_Controls->ctkDicomBrowser->currentStudiesSelection();
139 if (!selectedStudyUIDs.empty())
141 QStringList seriesUIDs;
143 for (
const auto &studyUID : selectedStudyUIDs)
146 auto answer = QMessageBox::question(
nullptr,
148 QString(
"Do you really want to delete %1 %2, containing %3 series?")
149 .arg(selectedStudyUIDs.count())
150 .arg(selectedStudyUIDs.count() != 1 ?
"studies" :
"study")
151 .arg(seriesUIDs.count()),
152 QMessageBox::Yes | QMessageBox::No,
155 if (answer == QMessageBox::Yes)
157 for (
const auto &studyUID : selectedStudyUIDs)
169 auto selectedSeriesUIDs =
m_Controls->ctkDicomBrowser->currentSeriesSelection();
171 if (!selectedSeriesUIDs.empty())
174 QMessageBox::question(
nullptr,
176 QString(
"Do you really want to delete %1 series?").arg(selectedSeriesUIDs.count()),
177 QMessageBox::Yes | QMessageBox::No,
180 if (answer == QMessageBox::Yes)
182 for (
const auto &seriesUID : selectedSeriesUIDs)
194 QStringList uids =
m_Controls->ctkDicomBrowser->currentSeriesSelection();
199 QHash<QString, QVariant> eventProperty;
200 eventProperty.insert(
"FilesForSeries", filesForSeries);
201 if (!filesForSeries.isEmpty())
203 QString modality =
m_LocalDatabase->fileValue(filesForSeries.at(0),
"0008,0060");
204 eventProperty.insert(
"Modality", modality);
212 QDir databaseDirecory = QDir(newDatatbaseDirectory);
213 if (!databaseDirecory.exists())
215 databaseDirecory.mkpath(databaseDirecory.absolutePath());
217 QString newDatatbaseFile = databaseDirecory.absolutePath() + QString(
"/ctkDICOM.sql");
230 m_Controls->viewInternalDataButton->setEnabled((s.size() != 0));