Slicer 5.13
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
Loading...
Searching...
No Matches
vtkMRMLFileWriter.h
Go to the documentation of this file.
1/*==============================================================================
2
3 Program: 3D Slicer
4
5 Copyright (c) Kitware Inc.
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 __vtkMRMLFileWriter_h
19#define __vtkMRMLFileWriter_h
20
22
24
30class VTK_MRML_LOGIC_EXPORT vtkMRMLFileWriter : public vtkMRMLFileIOHandler
31{
32public:
35 void PrintSelf(ostream& os, vtkIndent indent) override;
36
37 bool IsWriter() const override { return true; }
38
44 virtual double CanWriteObjectConfidence(vtkObject* object);
45
48 virtual bool CanWriteObject(vtkObject* object);
49
53 virtual std::vector<std::string> GetNameFiltersForObject(vtkObject* object);
54
58 virtual bool Write(vtkMRMLIOProperties* properties);
59
61 const std::vector<std::string>& GetWrittenNodeIDs() const;
62 void SetWrittenNodeIDs(const std::vector<std::string>& nodeIDs);
63 void AddWrittenNodeID(const std::string& nodeID);
65
69 std::string GetNodeClassName() const;
70 void SetNodeClassName(const std::string& className);
71
73 void SetNodeClassNames(const std::vector<std::string>& classNames);
74 const std::vector<std::string>& GetNodeClassNames() const { return this->NodeClassNames; }
75 void AddNodeClassName(const std::string& className);
76
78 vtkGetMacro(ConfidenceForMatchingClass, double);
79 vtkSetMacro(ConfidenceForMatchingClass, double);
80
81protected:
84
85 std::vector<std::string> NodeClassNames;
87 std::vector<std::string> WrittenNodeIDs;
88
89private:
90 vtkMRMLFileWriter(const vtkMRMLFileWriter&) = delete;
91 void operator=(const vtkMRMLFileWriter&) = delete;
92};
93
94#endif
bool IsWriter() const override
Whether this writes rather than reads.
virtual bool CanWriteObject(vtkObject *object)
void SetNodeClassName(const std::string &className)
void AddNodeClassName(const std::string &className)
virtual std::vector< std::string > GetNameFiltersForObject(vtkObject *object)
std::string GetNodeClassName() const
void SetNodeClassNames(const std::vector< std::string > &classNames)
The classes of nodes this writer is for.
virtual bool Write(vtkMRMLIOProperties *properties)
virtual double CanWriteObjectConfidence(vtkObject *object)
void SetWrittenNodeIDs(const std::vector< std::string > &nodeIDs)
void ClearWrittenNodeIDs()
std::vector< std::string > WrittenNodeIDs
std::vector< std::string > NodeClassNames
~vtkMRMLFileWriter() override
void PrintSelf(ostream &os, vtkIndent indent) override
const std::vector< std::string > & GetNodeClassNames() const
void AddWrittenNodeID(const std::string &nodeID)
const std::vector< std::string > & GetWrittenNodeIDs() const
The nodes the last Write wrote, by node ID.
static vtkMRMLFileWriter * New()