Slicer  4.11
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
qSlicerCLIModule.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 __qSlicerCLIModule_h
22 #define __qSlicerCLIModule_h
23 
24 // CTK includes
25 #include <ctkPimpl.h>
26 
27 // Slicer includes
28 #include "qSlicerAbstractModule.h"
29 
30 // SlicerExecutionModel includes
31 #include <ModuleDescription.h>
32 
33 #include "qSlicerBaseQTCLIExport.h"
34 
35 class ModuleLogo;
38 
39 class qSlicerCLIModulePrivate;
40 class Q_SLICER_BASE_QTCLI_EXPORT qSlicerCLIModule : public qSlicerAbstractModule
41 {
42  Q_OBJECT
43 public:
44 
46  qSlicerCLIModule(QWidget *parent=nullptr);
47  ~qSlicerCLIModule() override;
48 
52  void setXmlModuleDescription(const QString& xmlModuleDescription);
53 
55  int index() const override;
56 
59  QString helpText() const override;
60  QString acknowledgementText() const override;
61 
63  void setTempDirectory(const QString& tempDirectory);
64  QString tempDirectory() const;
65 
68  void setEntryPoint(const QString& entryPoint);
69  QString entryPoint() const;
70 
73  void setModuleType(const QString& type);
74  QString moduleType() const;
75 
79  Q_INVOKABLE vtkSlicerCLIModuleLogic* cliModuleLogic();
80 
81  QString title() const override;
82 
84  QStringList categories() const override;
85 
87  QStringList contributors() const override;
88 
90  QStringList associatedNodeTypes()const override;
91 
92  QImage logo() const override;
93  void setLogo(const ModuleLogo& logo);
94 
97  static QImage moduleLogoToImage(const ModuleLogo& logo);
98 
101  ModuleDescription& moduleDescription();
102 
103 protected:
105  void setup() override;
106 
110 
113  vtkMRMLAbstractLogic* createLogic() override;
114 
115 protected:
116  QScopedPointer<qSlicerCLIModulePrivate> d_ptr;
117 
118 private:
119  Q_DECLARE_PRIVATE(qSlicerCLIModule);
120  Q_DISABLE_COPY(qSlicerCLIModule);
121 };
122 
123 #endif
virtual QStringList contributors() const
Return the contributors of the module.
Logic for running CLI.
Superclass for MRML logic classes.
virtual qSlicerAbstractModuleRepresentation * createWidgetRepresentation()=0
Create and return a widget representation for the module.
virtual int index() const
Return the category index of the module.
virtual QImage logo() const
The logo of the module, the credits given by the grants or instution.
virtual vtkMRMLAbstractLogic * createLogic()=0
virtual QString acknowledgementText() const
virtual QStringList associatedNodeTypes() const
Return node types associated with this module (e.g., node types this module can edit) ...
virtual QString helpText() const
virtual QStringList categories() const
virtual QString title() const =0
QScopedPointer< qSlicerCLIModulePrivate > d_ptr
virtual void setup()=0
All initialization code should be done in the setup.
MRML node for representing the parameters allowing to run a command line interface module (CLI)...
qSlicerAbstractModule Superclass