Slicer  5.3
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
vtkMRMLSequenceStorageNode.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 #ifndef __vtkMRMLSequenceStorageNode_h
19 #define __vtkMRMLSequenceStorageNode_h
20 
21 #include "vtkMRML.h"
22 #include "vtkMRMLStorageNode.h"
23 #include "vtkMRMLSequenceNode.h"
24 
28 class VTK_MRML_EXPORT vtkMRMLSequenceStorageNode : public vtkMRMLStorageNode
29 {
30 public:
31  static vtkMRMLSequenceStorageNode *New();
33  void PrintSelf(ostream& os, vtkIndent indent) override;
34 
35  vtkMRMLNode* CreateNodeInstance() override;
36 
39  const char* GetNodeTagName() override {return "SequenceStorage";};
40 
42  const char* GetDefaultWriteFileExtension() override;
43 
45  bool CanReadInReferenceNode(vtkMRMLNode *refNode) override;
46 
47  // filename: fCal_Test_Validation_3NWires_fCal2.0-ProbeToTracker-Seq.seq.mha
48  // itemname: ProbeToTracker
49  // return: fCal_Test_Validation_3NWires_fCal2.0
50  static std::string GetSequenceBaseName(const std::string& fileNameName, const std::string& itemName);
51 
52  // baseName: fCal_Test_Validation_3NWires_fCal2.0
53  // itemName: Image
54  // return: fCal_Test_Validation_3NWires_fCal2.0-Image-Seq
55  static std::string GetSequenceNodeName(const std::string& baseName, const std::string& itemName);
56 
57 protected:
59  ~vtkMRMLSequenceStorageNode() override;
62 
64  void InitializeSupportedReadFileTypes() override;
65 
67  void InitializeSupportedWriteFileTypes() override;
68 
70  int ReadDataInternal(vtkMRMLNode *refNode) override;
71 
73  int WriteDataInternal(vtkMRMLNode *refNode) override;
74 
75  bool WriteToMRB(const char* fullName, vtkMRMLScene *scene);
76 
77  bool ReadFromMRB(const char* fullName, vtkMRMLScene *scene);
78 
80  void ForceUniqueDataNodeFileNames(vtkMRMLSequenceNode* sequenceNode);
81 };
82 
83 #endif
vtkMRMLNode * CreateNodeInstance() override=0
Create instance of the default node. Like New only virtual.
const char * GetNodeTagName() override
Get node XML tag name (like Storage, Sequence)
virtual int ReadDataInternal(vtkMRMLNode *refNode)
virtual void InitializeSupportedReadFileTypes()
virtual const char * GetDefaultWriteFileExtension()
Return default file extension for writing.
void operator=(const vtkMRMLStorageNode &)
MRML node for representing a sequence of MRML nodes.
A set of MRML Nodes that supports serialization and undo/redo.
Definition: vtkMRMLScene.h:57
void PrintSelf(ostream &os, vtkIndent indent) override
A superclass for other storage nodes.
virtual void InitializeSupportedWriteFileTypes()
virtual int WriteDataInternal(vtkMRMLNode *refNode)
Abstract Superclass for all specific types of MRML nodes.
Definition: vtkMRMLNode.h:167
MRML node for storing a sequence node on disk.
virtual bool CanReadInReferenceNode(vtkMRMLNode *refNode)=0