19 #include <QMessageBox> 22 : QWidget(parent), m_ToolManager(nullptr),
m_DataStorage(nullptr)
24 m_Controls.setupUi(
this);
25 m_Controls.m_InformationWidget->hide();
28 assert(m_ToolManager);
37 maskPredicate->AddPredicate(isMask);
40 m_Controls.m_cbMaskNodeSelector->SetPredicate(maskPredicate);
42 connect(m_Controls.m_pbStamp, SIGNAL(clicked()),
this, SLOT(
OnStamp()));
43 connect(m_Controls.m_cbShowInformation, SIGNAL(toggled(
bool)),
this, SLOT(
OnShowInformation(
bool)));
44 m_Controls.m_InformationWidget->hide();
53 m_DataStorage = storage;
54 m_Controls.m_cbMaskNodeSelector->SetDataStorage(m_DataStorage);
59 mitk::DataNode *maskNode = m_Controls.m_cbMaskNodeSelector->GetSelectedNode();
63 QMessageBox::information(
this,
"Mask Stamp",
"Please load and select a mask before starting some action.");
70 QMessageBox::information(
this,
"Mask Stamp",
"Please load and select a mask before starting some action.");
78 QMessageBox::information(
this,
"Mask Stamp",
"Please load and select a segmentation before starting some action.");
86 QMessageBox::information(
this,
"Mask Stamp",
"Please load and select a segmentation before starting some action.");
90 QApplication::setOverrideCursor(QCursor(Qt::BusyCursor));
93 workingImage->
MaskStamp(mask, m_Controls.m_chkOverwrite->isChecked());
97 QApplication::restoreOverrideCursor();
98 MITK_ERROR <<
"Exception caught: " << e.GetDescription();
99 QMessageBox::information(
this,
"Mask Stamp",
"Could not stamp the selected mask.\n See error log for details.\n");
103 QApplication::restoreOverrideCursor();
113 m_Controls.m_InformationWidget->show();
115 m_Controls.m_InformationWidget->hide();
Data management class that handles 'was created by' relations.
void SetVisibility(bool visible, const mitk::BaseRenderer *renderer=nullptr, const char *propertyKey="visible")
Convenience method for setting visibility properties (instances of BoolProperty)
BaseData * GetData() const
Get the data object (instance of BaseData, e.g., an Image) managed by this DataNode.
mitk::DataStorage::Pointer m_DataStorage
An object of this class represents an exception of MITK. Please don't instantiate exceptions manually...
static RenderingManager * GetInstance()
static Pointer New(const mitk::NodePredicateBase *_arg)
Image class for storing images.
static Pointer New(const char *_arg)
LabelSetImage class for handling labels and layers in a segmentation session.
void MaskStamp(mitk::Image *mask, bool forceOverwrite)
mitk::Image::Pointer mask
void RequestUpdateAll(RequestType type=REQUEST_UPDATE_ALL)
Class for nodes of the DataTree.