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
vtkSlicerSequencesLogic.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// .NAME vtkSlicerSequencesLogic - slicer logic class for volumes manipulation
19// .SECTION Description
20// This class manages the logic associated with reading, saving,
21// and changing propertied of the volumes
22
23
24#ifndef __vtkSlicerSequencesLogic_h
25#define __vtkSlicerSequencesLogic_h
26
27// Slicer includes
29
30// MRML includes
31
32// STD includes
33#include <cstdlib>
34
35#include "vtkSlicerSequencesModuleLogicExport.h"
36
38class vtkMRMLNode;
41
42class VTK_SLICER_SEQUENCES_MODULE_LOGIC_EXPORT vtkSlicerSequencesLogic :
44{
45public:
46
49 void PrintSelf(ostream& os, vtkIndent indent) override;
50
57 vtkMRMLSequenceNode* AddSequence(const char* filename, vtkMRMLMessageCollection* userMessages=nullptr);
58
61
64
67
70 {
71 static bool warningLogged = false;
72 if (!warningLogged)
73 {
74 vtkWarningMacro("vtkSlicerSequenceBrowserLogic::UpdateVirtualOutputNodes is deprecated,"
75 << " use vtkSlicerSequenceBrowserLogic::UpdateProxyNodes method instead");
76 warningLogged = true;
77 }
78 this->UpdateProxyNodesFromSequences(browserNode);
79 }
80
86
87 void GetCompatibleNodesFromScene(vtkCollection* compatibleNodes, vtkMRMLSequenceNode* sequenceNode);
88
90
92 void GetBrowserNodesForSequenceNode(vtkMRMLSequenceNode* sequenceNode, vtkCollection* foundBrowserNodes);
93
98
100 void GetBrowserNodesForProxyNode(vtkMRMLNode* proxyNode, vtkCollection* foundBrowserNodes);
101
106
107protected:
110
111 void SetMRMLSceneInternal(vtkMRMLScene* newScene) override;
113 void RegisterNodes() override;
114 void UpdateFromMRMLScene() override;
115 void OnMRMLSceneNodeAdded(vtkMRMLNode* node) override;
117 void ProcessMRMLNodesEvents(vtkObject *caller, unsigned long event, void *callData) override;
118
120
121 // Time of the last update of each browser node (in universal time)
122 std::map< vtkMRMLSequenceBrowserNode*, double > LastSequenceBrowserUpdateTimeSec;
123
124private:
125
126 std::set<vtkMRMLSequenceBrowserNode*> UpdateProxyNodesFromSequencesInProgress;
127 std::set<vtkMRMLSequenceBrowserNode*> UpdateSequencesFromProxyNodesInProgress;
128
129 vtkSlicerSequencesLogic(const vtkSlicerSequencesLogic&); // Not implemented
130 void operator=(const vtkSlicerSequencesLogic&); // Not implemented
131};
132
133#endif
Abstract Superclass for all specific types of MRML nodes.
A set of MRML Nodes that supports serialization and undo/redo.
MRML node for representing a sequence of MRML nodes.
void UpdateAllProxyNodes()
Refreshes the output of all the active browser nodes. Called regularly by a timer.
void RegisterNodes() override
Register MRML Node classes to Scene. Gets called automatically when the MRMLScene is attached to this...
void GetBrowserNodesForProxyNode(vtkMRMLNode *proxyNode, vtkCollection *foundBrowserNodes)
Get collection of browser nodes that use a specific proxy node.
void PrintSelf(ostream &os, vtkIndent indent) override
static bool IsNodeCompatibleForBrowsing(vtkMRMLSequenceNode *masterNode, vtkMRMLSequenceNode *testedNode)
void GetBrowserNodesForSequenceNode(vtkMRMLSequenceNode *sequenceNode, vtkCollection *foundBrowserNodes)
Get collection of browser nodes that use a specific sequence node.
void UpdateProxyNodesFromSequences(vtkMRMLSequenceBrowserNode *browserNode)
Updates the contents of all the proxy nodes (all the nodes copied from the master and synchronized se...
void UpdateVirtualOutputNodes(vtkMRMLSequenceBrowserNode *browserNode)
Deprecated method!
vtkMRMLSequenceBrowserNode * GetFirstBrowserNodeForProxyNode(vtkMRMLNode *proxyNode)
void GetCompatibleNodesFromScene(vtkCollection *compatibleNodes, vtkMRMLSequenceNode *sequenceNode)
std::map< vtkMRMLSequenceBrowserNode *, double > LastSequenceBrowserUpdateTimeSec
void SetMRMLSceneInternal(vtkMRMLScene *newScene) override
vtkMRMLSequenceBrowserNode * GetFirstBrowserNodeForSequenceNode(vtkMRMLSequenceNode *sequenceNode)
void UpdateFromMRMLScene() override
static vtkSlicerSequencesLogic * New()
void ProcessMRMLNodesEvents(vtkObject *caller, unsigned long event, void *callData) override
void UpdateSequencesFromProxyNodes(vtkMRMLSequenceBrowserNode *browserNode, vtkMRMLNode *proxyNode)
Updates the sequence from a changed proxy node (if saving of state changes is allowed)
~vtkSlicerSequencesLogic() override
void OnMRMLSceneNodeRemoved(vtkMRMLNode *node) override
vtkMRMLSequenceNode * AddSequence(const char *filename, vtkMRMLMessageCollection *userMessages=nullptr)
vtkMRMLSequenceNode * AddSynchronizedNode(vtkMRMLNode *sequenceNode, vtkMRMLNode *proxyNode, vtkMRMLNode *browserNode)
bool IsDataConnectorNode(vtkMRMLNode *)
void OnMRMLSceneNodeAdded(vtkMRMLNode *node) override