Slicer  5.3
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
qSlicerSequencesModuleWidget.h
Go to the documentation of this file.
1 /*==============================================================================
2 
3  Program: 3D Slicer
4 
5  Portions (c) Copyright Brigham and Women's Hospital (BWH) All Rights Reserved.
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 ==============================================================================*/
17 
18 #ifndef __qSlicerSequencesModuleWidget_h
19 #define __qSlicerSequencesModuleWidget_h
20 
21 // Slicer includes
23 
24 #include "qSlicerSequencesModuleExport.h"
25 
26 #include <QtGui>
27 
28 class qSlicerSequencesModuleWidgetPrivate;
29 class vtkMRMLNode;
32 
34 class Q_SLICER_QTMODULES_SEQUENCES_EXPORT qSlicerSequencesModuleWidget :
36 {
37  Q_OBJECT
38 
39 public:
40 
42  qSlicerSequencesModuleWidget(QWidget *parent=0);
43  ~qSlicerSequencesModuleWidget() override;
44 
46  void enter() override;
48  void exit() override;
49 
50  Q_INVOKABLE void setActiveBrowserNode(vtkMRMLSequenceBrowserNode* browserNode);
51  Q_INVOKABLE void setMasterSequenceNode(vtkMRMLSequenceNode* sequenceNode);
52 
53  Q_INVOKABLE bool setEditedNode(vtkMRMLNode* node, QString role = QString(), QString context = QString()) override;
54 
55 public slots:
56 
57  void setActiveSequenceNode(vtkMRMLSequenceNode* newActiveSequenceNode);
58  void onSequenceNodeSelectionChanged();
59  void onSequenceNodeModified();
60 
61  void onIndexNameEdited();
62  void onIndexUnitEdited();
63  void onIndexTypeEdited(QString indexTypeString);
64 
65  void onDataNodeEdited( int row, int column );
66 
67  void onAddDataNodeButtonClicked();
68  void onRemoveDataNodeButtonClicked();
69 
71  void onNodeAddedEvent(vtkObject* scene, vtkObject* node);
72  void onNodeRemovedEvent(vtkObject* scene, vtkObject* node);
73  void onMRMLSceneEndImportEvent();
74  void onMRMLSceneEndRestoreEvent();
75  void onMRMLSceneEndBatchProcessEvent();
76  void onMRMLSceneEndCloseEvent();
77 
78 protected:
79  void updateWidgetFromMRML();
80 
82  void refreshSynchronizedSequenceNodesTable();
83 
84  QScopedPointer<qSlicerSequencesModuleWidgetPrivate> d_ptr;
85 
86  void setup() override;
87 
88  void setEnableWidgets(bool enable);
89 
90 public slots:
91  void setMRMLScene(vtkMRMLScene* scene) override;
92 
93 protected slots:
94  void activeBrowserNodeChanged(vtkMRMLNode* node);
95  void sequenceNodeChanged(vtkMRMLNode*);
96  void playbackItemSkippingEnabledChanged(bool enabled);
97  void recordMasterOnlyChanged(bool enabled);
98  void recordingSamplingModeChanged(int index);
99  void indexDisplayModeChanged(int index);
100  void indexDisplayFormatChanged(const QString& format);
101  void onMRMLInputSequenceInputNodeModified(vtkObject* caller);
102  void onActiveBrowserNodeModified(vtkObject* caller);
103  void updateChart();
104 
105  void sequenceNodeNameEdited(int row, int column);
106 
107  void onAddSequenceNodeButtonClicked();
108  void onRemoveSequenceNodesButtonClicked();
109 
110  void synchronizedSequenceNodePlaybackStateChanged(int aState);
111  void synchronizedSequenceNodeRecordingStateChanged(int aState);
112  void synchronizedSequenceNodeOverwriteProxyNameStateChanged(int aState);
113  void synchronizedSequenceNodeSaveChangesStateChanged(int aState);
114 
115  void onProxyNodeChanged(vtkMRMLNode* newProxyNode);
116 
117  void updateSequenceItemWidgetFromMRML();
118  void updateCandidateNodesWidgetFromMRML(bool forceUpdate = false);
119 
120 private:
121  Q_DECLARE_PRIVATE(qSlicerSequencesModuleWidget);
122  Q_DISABLE_COPY(qSlicerSequencesModuleWidget);
123 };
124 
125 #endif
Q_INVOKABLE bool setEditedNode(vtkMRMLNode *node, QString role=QString(), QString context=QString()) override
Node editing.
QScopedPointer< qSlicerSequencesModuleWidgetPrivate > d_ptr
MRML node for representing a sequence of MRML nodes.
void setMRMLScene(vtkMRMLScene *scene) override
A set of MRML Nodes that supports serialization and undo/redo.
Definition: vtkMRMLScene.h:57
qSlicerAbstractModuleWidget Superclass
Abstract Superclass for all specific types of MRML nodes.
Definition: vtkMRMLNode.h:167
virtual Q_INVOKABLE void enter()
virtual Q_INVOKABLE void exit()