Slicer 5.9
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
Loading...
Searching...
No Matches
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#ifndef __vtkSlicerSequencesLogic_h
24#define __vtkSlicerSequencesLogic_h
25
26// Slicer includes
28
29// MRML includes
30
31// STD includes
32#include <cstdlib>
33
34#include "vtkSlicerSequencesModuleLogicExport.h"
35
37class vtkMRMLNode;
40
41class VTK_SLICER_SEQUENCES_MODULE_LOGIC_EXPORT vtkSlicerSequencesLogic : public vtkSlicerModuleLogic
42{
43public:
46 void PrintSelf(ostream& os, vtkIndent indent) override;
47
54 vtkMRMLSequenceNode* AddSequence(const char* filename, vtkMRMLMessageCollection* userMessages = nullptr);
55
58
61
64
67 {
68 static bool warningLogged = false;
69 if (!warningLogged)
70 {
71 vtkWarningMacro("vtkSlicerSequenceBrowserLogic::UpdateVirtualOutputNodes is deprecated," << " use vtkSlicerSequenceBrowserLogic::UpdateProxyNodes method instead");
72 warningLogged = true;
73 }
74 this->UpdateProxyNodesFromSequences(browserNode);
75 }
76
82
83 void GetCompatibleNodesFromScene(vtkCollection* compatibleNodes, vtkMRMLSequenceNode* sequenceNode);
84
86
88 void GetBrowserNodesForSequenceNode(vtkMRMLSequenceNode* sequenceNode, vtkCollection* foundBrowserNodes);
89
94
96 void GetBrowserNodesForProxyNode(vtkMRMLNode* proxyNode, vtkCollection* foundBrowserNodes);
97
102
103protected:
106
107 void SetMRMLSceneInternal(vtkMRMLScene* newScene) override;
109 void RegisterNodes() override;
110 void UpdateFromMRMLScene() override;
111 void OnMRMLSceneNodeAdded(vtkMRMLNode* node) override;
113 void ProcessMRMLNodesEvents(vtkObject* caller, unsigned long event, void* callData) override;
114
116
117 // Time of the last update of each browser node (in universal time)
118 std::map<vtkMRMLSequenceBrowserNode*, double> LastSequenceBrowserUpdateTimeSec;
119
120private:
121 std::set<vtkMRMLSequenceBrowserNode*> UpdateProxyNodesFromSequencesInProgress;
122 std::set<vtkMRMLSequenceBrowserNode*> UpdateSequencesFromProxyNodesInProgress;
123
124 vtkSlicerSequencesLogic(const vtkSlicerSequencesLogic&); // Not implemented
125 void operator=(const vtkSlicerSequencesLogic&); // Not implemented
126};
127
128#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!
std::map< vtkMRMLSequenceBrowserNode *, double > LastSequenceBrowserUpdateTimeSec
vtkMRMLSequenceBrowserNode * GetFirstBrowserNodeForProxyNode(vtkMRMLNode *proxyNode)
void GetCompatibleNodesFromScene(vtkCollection *compatibleNodes, vtkMRMLSequenceNode *sequenceNode)
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