7 #include "fwDicomIOFilterQt/splitter/TagValueInstanceRemoveConfigurableSplitter.hpp" 8 #include "fwDicomIOFilterQt/widget/QTagSelectorWidget.hpp" 10 #include <fwDicomIOFilter/registry/macros.hpp> 12 #include <QApplication> 14 #include <QDialogButtonBox> 15 #include <QHBoxLayout> 17 #include <QPushButton> 18 #include <QVBoxLayout> 21 #include <dcmtk/dcmdata/dcdeftag.h> 31 "Tag value instance remove configurable splitter";
33 "Remove instances if a tag has a certain value.";
82 QDialog* dialog =
new QDialog(qApp->activeWindow());
83 dialog->setWindowTitle(QString(
"Configure"));
84 QVBoxLayout* mainLayout =
new QVBoxLayout();
85 dialog->setLayout(mainLayout);
86 dialog->setMinimumWidth(500);
90 new ::fwDicomIOFilterQt::widget::QTagSelectorWidget();
92 mainLayout->addWidget(tagSelector);
95 QWidget* tagValueWidget =
new QWidget();
96 mainLayout->addWidget(tagValueWidget);
97 QHBoxLayout* tagValueLayout =
new QHBoxLayout();
98 tagValueWidget->setLayout(tagValueLayout);
99 tagValueLayout->addWidget(
new QLabel(
"<b>Value:</b> "));
100 QLineEdit* tagValuelineEdit =
new QLineEdit(
m_tagValue.c_str());
101 tagValueLayout->addWidget(tagValuelineEdit, 1);
102 tagValueLayout->setContentsMargins(QMargins(0,0,0,0));
105 QDialogButtonBox* buttonBox =
new QDialogButtonBox(dialog);
106 mainLayout->addWidget(buttonBox);
107 QPushButton* okButton = buttonBox->addButton(QDialogButtonBox::Ok);
108 QPushButton* cancelButton = buttonBox->addButton(QDialogButtonBox::Cancel);
110 QObject::connect(okButton, SIGNAL(clicked(
void)), dialog, SLOT(accept(
void)));
111 QObject::connect(cancelButton, SIGNAL(clicked(
void)), dialog, SLOT(reject(
void)));
114 int result = dialog->exec();
115 if(result == QDialog::Accepted)
118 m_tagValue = tagValuelineEdit->text().toStdString();
FWDICOMIOFILTERQT_API TagValueInstanceRemoveConfigurableSplitter(::fwDicomIOFilter::IFilter::Key key)
Constructor.
Filter that remove instances if a tag has a certain value.
static FWDICOMIOFILTERQT_API const std::string s_FILTER_NAME
Filter name.
virtual FWDICOMIOFILTERQT_API std::string getDescription() const override
Return the description of the filter.
virtual FWDICOMIOFILTERQT_API bool isConfigurationRequired() const override
Return true if a configuration is required.
virtual FWDICOMIOFILTERQT_API std::string getName() const override
Return the name of the filter.
fwDicomIOFilter contains filters used to pre-process images before reading.
virtual FWDICOMIOFILTERQT_API bool isConfigurableWithGUI() const override
Return true if the filter is configurable using GUI.
Key class used to restrict access to Filter construction. See http://www.drdobbs.com/184402053.
virtual FWDICOMIOFILTERQT_API void configureWithGUI() override
Configure the filter using GUI dialog.
DcmTagKey m_tag
Tag used to sort instances.
virtual FWDICOMIOFILTERQT_API ~TagValueInstanceRemoveConfigurableSplitter()
Destructor.
static FWDICOMIOFILTERQT_API const std::string s_FILTER_DESCRIPTION
Filter description.
fwDicomIOFilterQt contains filters used to pre-process images before reading.
std::string m_tagValue
Tag value used to determine if an instance must be removed.