Slicer 5.4
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
Loading...
Searching...
No Matches
qSlicerCLIModuleWidget.h
Go to the documentation of this file.
1/*==============================================================================
2
3 Program: 3D Slicer
4
5 Copyright (c) Kitware Inc.
6
7 See COPYRIGHT.txt
8 or http://www.slicer.org/copyright/copyright.txt for details.
9
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
15
16 This file was originally developed by Jean-Christophe Fillion-Robin, Kitware Inc.
17 and was partially funded by NIH grant 3P41RR013218-12S1
18
19==============================================================================*/
20
21#ifndef __qSlicerCLIModuleWidget_h
22#define __qSlicerCLIModuleWidget_h
23
24// CTK includes
25#include <ctkPimpl.h>
26#include <ctkVTKObject.h>
27
28// Slicer includes
30
31#include "qSlicerBaseQTCLIExport.h"
32
33class ModuleDescription;
34class vtkMRMLNode;
36class qSlicerCLIModuleWidgetPrivate;
37
38class Q_SLICER_BASE_QTCLI_EXPORT qSlicerCLIModuleWidget : public qSlicerAbstractModuleWidget
39{
40 Q_OBJECT
41 QVTK_OBJECT
42public:
43
45 qSlicerCLIModuleWidget(QWidget *parent=nullptr);
47
50
51 // Node editing
52 bool setEditedNode(vtkMRMLNode* node, QString role = QString(), QString context = QString()) override;
53 double nodeEditable(vtkMRMLNode* node) override;
54
56 QString translate(const std::string& sourceText)const;
57
58public slots:
60 void setCurrentCommandLineModuleNode(vtkMRMLNode* commandLineModuleNode);
61
62 void apply(bool wait = false);
63 void cancel();
64 void reset();
65
66 void setAutoRun(bool enable);
68 void setAutoRunWhenInputModified(bool enable);
71protected:
73 void setup() override;
74
76 void enter() override;
77
81 void run(vtkMRMLCommandLineModuleNode* parameterNode, bool waitForCompletion = false);
82
85protected:
86 QScopedPointer<qSlicerCLIModuleWidgetPrivate> d_ptr;
87
88private:
89 Q_DECLARE_PRIVATE(qSlicerCLIModuleWidget);
90 Q_DISABLE_COPY(qSlicerCLIModuleWidget);
91};
92
93#endif
Q_INVOKABLE vtkMRMLCommandLineModuleNode * currentCommandLineModuleNode() const
Get the current commandLineModuleNode.
void setAutoRunWhenParameterChanged(bool enable)
void setCurrentCommandLineModuleNode(vtkMRMLNode *commandLineModuleNode)
Set the current commandLineModuleNode.
~qSlicerCLIModuleWidget() override
void setup() override
void run(vtkMRMLCommandLineModuleNode *parameterNode, bool waitForCompletion=false)
QScopedPointer< qSlicerCLIModuleWidgetPrivate > d_ptr
double nodeEditable(vtkMRMLNode *node) override
void apply(bool wait=false)
void cancel(vtkMRMLCommandLineModuleNode *node)
Abort the execution of the module associated with node.
qSlicerCLIModuleWidget(QWidget *parent=nullptr)
bool setEditedNode(vtkMRMLNode *node, QString role=QString(), QString context=QString()) override
Node editing.
void setAutoRunCancelsRunningProcess(bool enable)
void setAutoRunWhenInputModified(bool enable)
qSlicerAbstractModuleWidget Superclass
void setAutoRun(bool enable)
QString translate(const std::string &sourceText) const
Translate string from source language to current application language.
void enter() override
Set up the GUI from mrml when entering.
void setAutoRunOnOtherInputEvents(bool enable)
MRML node for representing the parameters allowing to run a command line interface module (CLI)....
Abstract Superclass for all specific types of MRML nodes.