17 #include <QFileDialog> 18 #include <QHBoxLayout> 19 #include <QMessageBox> 32 m_PointListView(nullptr),
33 m_PointSetNode(nullptr),
35 m_MovePointUpBtn(nullptr),
36 m_MovePointDownBtn(nullptr),
37 m_RemovePointBtn(nullptr),
38 m_SavePointsBtn(nullptr),
39 m_LoadPointsBtn(nullptr),
40 m_ToggleAddPoint(nullptr),
42 m_TimeStepDisplay(nullptr),
43 m_DataInteractor(nullptr),
97 m_ToggleAddPoint->setToolTip(
"Toggle point editing (use SHIFT + Left Mouse Button to add Points)");
128 m_LoadPointsBtn->setToolTip(
"Load list of points from file (REPLACES current content)");
139 lay1 =
new QVBoxLayout(
this);
140 lay2 =
new QHBoxLayout();
145 lay1 =
new QHBoxLayout(
this);
146 lay2 =
new QVBoxLayout();
151 lay1 =
new QHBoxLayout(
this);
152 lay2 =
new QVBoxLayout();
157 lay1 =
new QVBoxLayout(
this);
158 lay2 =
new QHBoxLayout();
165 this->setLayout(lay1);
178 lay3 =
new QHBoxLayout;
183 lay3->setAlignment(Qt::AlignLeft);
195 this->setLayout(lay1);
196 lay1->addLayout(lay2);
197 lay1->addLayout(lay3);
202 if (newPs ==
nullptr)
221 if ((dynamic_cast<mitk::PointSet *>(
m_PointSetNode->GetData())) ==
nullptr)
223 if ((dynamic_cast<mitk::PointSet *>(
m_PointSetNode->GetData()))->GetSize() == 0)
228 nodeName =
"/" + nodeName +
".mps";
229 QString fileNameProposal = QString();
230 fileNameProposal.append(nodeName.c_str());
232 QString aFilename = QFileDialog::getSaveFileName(
233 nullptr,
"Save point set", QDir::currentPath() + fileNameProposal,
"MITK Pointset (*.mps)");
234 if (aFilename.isEmpty())
243 QMessageBox::warning(
this,
245 QString(
"File writer reported problems writing %1\n\n" 246 "PLEASE CHECK output file!")
254 QString filename = QFileDialog::getOpenFileName(
nullptr,
"Open MITK Pointset",
"",
"MITK Point Sets (*.mps)");
255 if (filename.isEmpty())
262 if (pointSet.IsNull())
264 QMessageBox::warning(
this,
"Load point set", QString(
"File reader could not read %1").arg(filename));
274 QMessageBox::warning(
this,
"Load point set", QString(
"File reader collapsed while reading %1").arg(filename));
386 editPointDialog.exec();
406 if (enabled ==
false)
435 itk::ReceptorMemberCommand<QmitkPointListWidget>::Pointer command =
436 itk::ReceptorMemberCommand<QmitkPointListWidget>::New();
DataType::PointsContainerIterator PointsIterator
PointsIterator GetMaxId(int t=0)
Get an iterator to the max ID element if existent. Return End() otherwise.
A dialog for editing points directly (coordinates) via TextEdits.
void SetMultiWidget(QmitkStdMultiWidget *multiWidget)
If Multiwidget is set, the crosshair is automatically centering to the selected point As an alternati...
void AddSliceNavigationController(mitk::SliceNavigationController *snc)
Add a mitk::SliceNavigationController instance.
void RemoveSelectedPoint()
void MoveSelectedPointUp()
GUI widget for handling mitk::PointSet.
Controls the selection of the slice the associated BaseRenderer will display.
DataType::PointIdentifier PointIdentifier
virtual int GetSize(unsigned int t=0) const
returns the current size of the point-list
Data structure which stores a set of points. Superclass of mitk::Mesh.
static RenderingManager * GetInstance()
void MoveSelectedPointDown()
static void Save(const mitk::BaseData *data, const std::string &path, bool setPathProperty=false)
Save a mitk::BaseData instance.
static QIcon ThemeIcon(const QByteArray &originalSVG)
void RequestUpdateAll(RequestType type=REQUEST_UPDATE_ALL)
void SetPointSetNode(mitk::DataNode *pointSetNode)
assign a point set for observation
Class for nodes of the DataTree.
void RemoveSliceNavigationController(mitk::SliceNavigationController *snc)
Remove a mitk::SliceNavigationController instance.
void SetPoint(mitk::PointSet *_PointSet, mitk::PointSet::PointIdentifier _PointId, int timestep=0)