ITK  4.13.0
Insight Segmentation and Registration Toolkit
itkSpatialObjectReader.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 #ifndef itkSpatialObjectReader_h
19 #define itkSpatialObjectReader_h
20 
21 #include "itkMetaSceneConverter.h"
22 #include "itkMetaConverterBase.h"
23 #include "itkGroupSpatialObject.h"
24 #include "itkProcessObject.h"
25 
26 namespace itk
27 {
33 template< unsigned int NDimensions = 3,
34  typename PixelType = unsigned char,
35  typename TMeshTraits = DefaultStaticMeshTraits< PixelType, NDimensions, NDimensions >
36  >
37 class ITK_TEMPLATE_EXPORT SpatialObjectReader:public Object
38 {
39 public:
40 
46 
48  typedef typename GroupType::Pointer GroupPointer;
49 
51  typedef typename SceneType::Pointer ScenePointer;
52 
57 
59  itkNewMacro(Self);
60 
62  typedef Object Superclass;
63  itkTypeMacro(SpatialObjectReader, Object);
65 
67  void Update();
68 
70  itkSetStringMacro(FileName);
71 
73  itkGetStringMacro(FileName);
74 
76  ScenePointer GetScene(void) { return m_Scene; }
77  GroupPointer GetGroup(void) { return m_Group; }
79 
81  const MetaEvent * GetEvent() { return m_MetaToSpatialConverter.GetEvent(); }
82  void SetEvent(MetaEvent *event) { m_MetaToSpatialConverter.SetEvent(event); }
84 
86  void RegisterMetaConverter(const char *metaTypeName,
87  const char *spatialObjectTypeName,
88  MetaConverterBaseType *converter);
89 
90 protected:
91  ITK_DISALLOW_COPY_AND_ASSIGN(SpatialObjectReader);
92 
93  std::string m_FileName;
94 
96  virtual ~SpatialObjectReader() ITK_OVERRIDE;
97 
98 private:
99 
100  ScenePointer m_Scene;
101  GroupPointer m_Group;
102 
103  MetaSceneConverter< NDimensions, PixelType, TMeshTraits > m_MetaToSpatialConverter;
104 };
105 } // namespace itk
106 
107 #ifndef ITK_MANUAL_INSTANTIATION
108 #include "itkSpatialObjectReader.hxx"
109 #endif
110 
111 #endif // itkSpatialObjectReader_h
Event abstract class.
Definition: itkMetaEvent.h:37
Light weight base class for most itk classes.
SmartPointer< Self > Pointer
a SceneSpatialObject has a list of SpatialObjects
SpatialObjectType::Pointer SpatialObjectPointer
void SetEvent(MetaEvent *event)
MetaConverterBase< NDimensions > MetaConverterBaseType
SceneSpatialObject< NDimensions > SceneType
Implementation of the composite pattern.
SpatialObject< NDimensions > SpatialObjectType
Converts between MetaObject and SpaitalObject scenes.
Representation of a group based on the spatial object classes.
GroupSpatialObject< NDimensions > GroupType
Base class for most ITK classes.
Definition: itkObject.h:59