Slicer 5.9
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
vtkSlicerSubjectHierarchyModuleLogic.h
Go to the documentation of this file.
1/*==============================================================================
2
3 Program: 3D Slicer
4
5 Copyright (c) Laboratory for Percutaneous Surgery (PerkLab)
6 Queen's University, Kingston, ON, Canada. All Rights Reserved.
7
8 See COPYRIGHT.txt
9 or http://www.slicer.org/copyright/copyright.txt for details.
10
11 Unless required by applicable law or agreed to in writing, software
12 distributed under the License is distributed on an "AS IS" BASIS,
13 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 See the License for the specific language governing permissions and
15 limitations under the License.
16
17 This file was originally developed by Csaba Pinter, PerkLab, Queen's University
18 and was supported through the Applied Cancer Research Unit program of Cancer Care
19 Ontario with funds provided by the Ontario Ministry of Health and Long-Term Care
20
21==============================================================================*/
22
23// .NAME vtkSlicerSubjectHierarchyModuleLogic - slicer logic class for volumes manipulation
24// .SECTION Description
25// This class manages the logic associated with reading, saving,
26// and changing propertied of the volumes
27
28
29#ifndef __vtkSlicerSubjectHierarchyModuleLogic_h
30#define __vtkSlicerSubjectHierarchyModuleLogic_h
31
32// Slicer includes
34
35#include "vtkSlicerSubjectHierarchyModuleLogicExport.h"
36
39
40class VTK_SLICER_SUBJECTHIERARCHY_LOGIC_EXPORT vtkSlicerSubjectHierarchyModuleLogic :
42{
43public:
45 static const char* CLONED_NODE_NAME_POSTFIX;
46
47public:
50 void PrintSelf(ostream& os, vtkIndent indent) override;
51
52public:
56 vtkMRMLSubjectHierarchyNode* shNode, const char* subjectId, const char* studyInstanceUID, const char* seriesInstanceUID );
57
64 static vtkIdType AreItemsInSameBranch(
65 vtkMRMLSubjectHierarchyNode* shNode, vtkIdType item1, vtkIdType item2, std::string lowestCommonLevel );
71 static vtkIdType AreNodesInSameBranch(
72 vtkMRMLNode* node1, vtkMRMLNode* node2, std::string lowestCommonLevel );
73
75 static bool IsPatientTag(std::string tagName);
76
78 static bool IsStudyTag(std::string tagName);
79
87 static void TransformBranch(
88 vtkMRMLSubjectHierarchyNode* shNode, vtkIdType itemID, vtkMRMLTransformNode* transformNode, bool hardenExistingTransforms=true);
89
93 static void HardenTransformOnBranch(vtkMRMLSubjectHierarchyNode* shNode, vtkIdType itemID);
94
99 static vtkIdType CloneSubjectHierarchyItem(
100 vtkMRMLSubjectHierarchyNode* shNode, vtkIdType itemID, const char* name=nullptr );
101
104
105protected:
107 void SetMRMLSceneInternal(vtkMRMLScene* newScene) override;
108
110 void UpdateFromMRMLScene() override;
111
112protected:
115
116private:
118 void operator=(const vtkSlicerSubjectHierarchyModuleLogic&) = delete;
119};
120
121#endif
Abstract Superclass for all specific types of MRML nodes.
A set of MRML Nodes that supports serialization and undo/redo.
MRML node to represent a complete subject hierarchy tree.
MRML node for representing a transformation between this node space and a parent node space.
static vtkIdType AreItemsInSameBranch(vtkMRMLSubjectHierarchyNode *shNode, vtkIdType item1, vtkIdType item2, std::string lowestCommonLevel)
static bool IsStudyTag(std::string tagName)
Determine if a tag name is a study tag (not attribute, but tag - without prefix!)
void UpdateFromMRMLScene() override
Called every time the scene has been significantly changed.
vtkMRMLSubjectHierarchyNode * GetSubjectHierarchyNode()
Convenience function to get subject hierarchy node from the logic.
static vtkIdType AreNodesInSameBranch(vtkMRMLNode *node1, vtkMRMLNode *node2, std::string lowestCommonLevel)
static const char * CLONED_NODE_NAME_POSTFIX
Postfix added to cloned node name by default.
static void TransformBranch(vtkMRMLSubjectHierarchyNode *shNode, vtkIdType itemID, vtkMRMLTransformNode *transformNode, bool hardenExistingTransforms=true)
void SetMRMLSceneInternal(vtkMRMLScene *newScene) override
Called each time a new scene is set.
static vtkSlicerSubjectHierarchyModuleLogic * New()
static vtkIdType InsertDicomSeriesInHierarchy(vtkMRMLSubjectHierarchyNode *shNode, const char *subjectId, const char *studyInstanceUID, const char *seriesInstanceUID)
static vtkIdType CloneSubjectHierarchyItem(vtkMRMLSubjectHierarchyNode *shNode, vtkIdType itemID, const char *name=nullptr)
static void HardenTransformOnBranch(vtkMRMLSubjectHierarchyNode *shNode, vtkIdType itemID)
static bool IsPatientTag(std::string tagName)
Determine if a tag name is a patient tag (not attribute, but tag - without prefix!...
void PrintSelf(ostream &os, vtkIndent indent) override