Slicer  5.1
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
qMRMLVolumeInfoWidget.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 Julien Finet, Kitware Inc.
17  and was partially funded by NIH grant 3P41RR013218-12S1
18 
19 ==============================================================================*/
20 
21 #ifndef __qMRMLVolumeInfoWidget_h
22 #define __qMRMLVolumeInfoWidget_h
23 
24 
25 // Qt includes
26 #include <QListWidget>
27 
28 // CTK includes
29 #include <ctkVTKObject.h>
30 
31 // qMRML includes
32 #include "qMRMLWidget.h"
33 #include "qMRMLWidgetsExport.h"
34 
35 class qMRMLVolumeInfoWidgetPrivate;
36 class vtkMRMLNode;
37 class vtkMRMLVolumeNode;
38 
39 class QMRML_WIDGETS_EXPORT qMRMLVolumeInfoWidget : public qMRMLWidget
40 {
41  Q_OBJECT
42  QVTK_OBJECT
43  Q_PROPERTY(bool dataTypeEditable READ isDataTypeEditable WRITE setDataTypeEditable)
44 public:
46 
47  qMRMLVolumeInfoWidget(QWidget *parent=nullptr);
48  ~qMRMLVolumeInfoWidget() override;
49 
50  vtkMRMLVolumeNode* volumeNode()const;
51  // Depends on the dimension, spacing and origin of the volume
52  bool isCentered()const;
53 
54  // Disabled by default
55  bool isDataTypeEditable()const;
56 
57 public slots:
59  void setVolumeNode(vtkMRMLNode *node);
61  void setVolumeNode(vtkMRMLVolumeNode *node);
62  void setDataTypeEditable(bool enable);
63 
64  void setImageSpacing(double*);
65  void setImageOrigin(double*);
66  void center();
67  void setScanOrder(int);
68  void setNumberOfScalars(int);
69  void setScalarType(int);
70  void setWindowLevelFromPreset(QListWidgetItem*);
71 
72 protected slots:
73  void updateWidgetFromMRML();
74 
75 protected:
76  QScopedPointer<qMRMLVolumeInfoWidgetPrivate> d_ptr;
77 
78 private:
79  Q_DECLARE_PRIVATE(qMRMLVolumeInfoWidget);
80  Q_DISABLE_COPY(qMRMLVolumeInfoWidget);
81 };
82 
83 #endif
QScopedPointer< qMRMLVolumeInfoWidgetPrivate > d_ptr
Base class for any widget that requires a MRML Scene.
Definition: qMRMLWidget.h:35
MRML node for representing a volume (image stack).
Abstract Superclass for all specific types of MRML nodes.
Definition: vtkMRMLNode.h:167