Slicer  4.11
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
vtkSlicerSegmentationGeometryLogic.h
Go to the documentation of this file.
1 /*==============================================================================
2 
3  Copyright (c) Laboratory for Percutaneous Surgery (PerkLab)
4  Queen's University, Kingston, ON, Canada. All Rights Reserved.
5 
6  See COPYRIGHT.txt
7  or http://www.slicer.org/copyright/copyright.txt for details.
8 
9  Unless required by applicable law or agreed to in writing, software
10  distributed under the License is distributed on an "AS IS" BASIS,
11  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  See the License for the specific language governing permissions and
13  limitations under the License.
14 
15  This file was originally developed by Csaba Pinter, PerkLab, Queen's University
16  and was supported through CANARIE and the Applied Cancer Research Unit program
17  of Cancer Care Ontario with funds provided by the Ontario Ministry of Health and
18  Long-Term Care
19 
20 ==============================================================================*/
21 
22 // .NAME vtkSlicerSegmentationGeometryLogic
23 // .SECTION Description
24 // This class manages the logic associated with converting and handling
25 // segmentation node objects.
26 
27 #ifndef __vtkSlicerSegmentationGeometryLogic_h
28 #define __vtkSlicerSegmentationGeometryLogic_h
29 
30 // Slicer includes
31 #include "vtkSlicerSegmentationsModuleLogicExport.h"
32 
33 // Segmentations includes
35 
36 // vtkSegmentationCore includes
37 #include "vtkOrientedImageData.h"
38 
40 class VTK_SLICER_SEGMENTATIONS_LOGIC_EXPORT vtkSlicerSegmentationGeometryLogic : public vtkObject
41 {
42 public:
44  vtkTypeMacro(vtkSlicerSegmentationGeometryLogic, vtkObject);
45  void PrintSelf(ostream& os, vtkIndent indent) override;
46 
49  std::string CalculateOutputGeometry();
50 
52  bool IsSourceSegmentationWithBinaryLabelmapMaster();
53 
55  bool InputSegmentationCanBeResampled();
56 
59  void ComputeSourceAxisIndexForInputAxis();
60 
61  vtkGetObjectMacro(OutputGeometryImageData, vtkOrientedImageData);
62 
64  void ResetGeometryImageData();
65 
66  vtkGetObjectMacro(InputSegmentationNode, vtkMRMLSegmentationNode);
67  vtkSetObjectMacro(InputSegmentationNode, vtkMRMLSegmentationNode);
68 
69  vtkGetObjectMacro(SourceGeometryNode, vtkMRMLDisplayableNode);
70  virtual void SetSourceGeometryNode(vtkMRMLDisplayableNode* node);
71 
72  vtkGetMacro(IsotropicSpacing, bool);
73  vtkSetMacro(IsotropicSpacing, bool);
74  vtkBooleanMacro(IsotropicSpacing, bool);
75 
76  vtkGetMacro(OversamplingFactor, double);
77  vtkSetMacro(OversamplingFactor, double);
78 
79  vtkGetVectorMacro(UserSpacing, double, 3);
80  vtkSetVectorMacro(UserSpacing, double, 3);
81 
82  vtkGetVectorMacro(InputAxisIndexForSourceAxis, int, 3);
83 
84  vtkGetVectorMacro(SourceAxisIndexForInputAxis, int, 3);
85 
86 protected:
89 
90 protected:
91 
95  std::string CalculateOutputGeometryFromImage();
96 
101  std::string CalculateOutputGeometryFromBounds(bool keepCurrentAxisDirections);
102 
105 
108 
113 
118 
121  double UserSpacing[3]{ 1.0, 1.0, 1.0 };
122 
125 
127  int InputAxisIndexForSourceAxis[3]{ 0, 1, 2 };
129  int SourceAxisIndexForInputAxis[3]{ 0, 1, 2 };
130 
131 private:
133  void operator=(const vtkSlicerSegmentationGeometryLogic&) = delete;
134 };
135 
136 #endif
vtkMRMLDisplayableNode * SourceGeometryNode
MRML node specifying the source geometry.
Image data containing orientation information.
vtkMRMLSegmentationNode * InputSegmentationNode
Input segmentation MRML node to modify the labelmap geometry of.
vtkOrientedImageData * OutputGeometryImageData
Oriented image data containing output geometry. This is what the class calculates from the inputs...
MRML node containing segmentationsSegmentation node stores a set of segments (also known as contours ...