ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkDOMReader.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0.txt
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  *=========================================================================*/
18 
19 #ifndef itkDOMReader_h
20 #define itkDOMReader_h
21 
22 #include "itkDOMNodeXMLReader.h"
23 #include "itkObject.h"
24 #include "itkLogger.h"
25 
26 namespace itk
27 {
28 
64 template< typename TOutput >
65 class ITK_TEMPLATE_EXPORT DOMReader : public Object
66 {
67 public:
68  ITK_DISALLOW_COPY_AND_ASSIGN(DOMReader);
70 
72  using Self = DOMReader;
73 
74  itkTypeMacro(DOMReader, Object);
75 
76  using OutputType = TOutput;
77 
80 
81  using LoggerType = Logger;
83 
85  itkSetStringMacro(FileName);
86 
88  itkGetStringMacro(FileName);
89 
94  virtual void SetOutput( OutputType* output );
95 
97  OutputType* GetOutput();
98 
100  const OutputType* GetOutput() const;
101 
106  itkGetConstMacro( Logger, LoggerType* );
107 
113  void Update( const DOMNodeType* inputdom, const void* userdata = nullptr );
114 
118  virtual void Update();
119 
120 protected:
121  DOMReader();
122 
130  virtual void GenerateData( const DOMNodeType* inputdom, const void* userdata ) = 0;
131 
132 private:
134  itkSetObjectMacro( IntermediateDOM, DOMNodeType );
135  itkGetModifiableObjectMacro(IntermediateDOM, DOMNodeType );
137 
139  std::string m_FileName;
140 
143 
146 
149 
152 };
153 
154 } // namespace itk
155 
156 #ifndef ITK_MANUAL_INSTANTIATION
157 #include "itkDOMReader.hxx"
158 #endif
159 
160 #endif // itkDOMReader_h
Light weight base class for most itk classes.
typename LoggerType::Pointer LoggerPointer
Definition: itkDOMReader.h:82
LightObject::Pointer m_OutputHolder
Definition: itkDOMReader.h:145
Class to represent a node in a Document Object Model (DOM) tree structure.
Definition: itkDOMNode.h:53
TOutput OutputType
Definition: itkDOMReader.h:76
typename DOMNodeType::Pointer DOMNodePointer
Definition: itkDOMReader.h:79
LoggerPointer m_Logger
Definition: itkDOMReader.h:151
DOMNodePointer m_IntermediateDOM
Definition: itkDOMReader.h:148
std::string m_FileName
Definition: itkDOMReader.h:135
OutputType * m_Output
Definition: itkDOMReader.h:142
Base class for most ITK classes.
Definition: itkObject.h:60
Used for logging information during a run.
Definition: itkLogger.h:36
Class to read an ITK object from an XML file or a DOM object, using the DOM APIs. ...
Definition: itkDOMReader.h:65