ITK  4.9.0
Insight Segmentation and Registration Toolkit
itkMetaImageConverter.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 itkMetaImageConverter_h
19 #define itkMetaImageConverter_h
20 
21 // to avoid an Internal Compiler Error in Visual Studio 6.0
22 #include "metaImage.h"
23 #include "itkMetaConverterBase.h"
24 #include "itkImageSpatialObject.h"
25 #include "itkMetaConverterBase.h"
26 
27 namespace itk
28 {
29 
36 template< unsigned int NDimensions = 3,
37  typename TPixel = unsigned char,
38  typename TSpatialObjectType = ImageSpatialObject< NDimensions,TPixel > >
40  public MetaConverterBase< NDimensions >
41 {
42 public:
48 
50  itkNewMacro(Self);
51 
54 
58 
60  typedef TSpatialObjectType ImageSpatialObjectType;
63  typedef MetaImage ImageMetaObjectType;
65 
67  virtual SpatialObjectPointer MetaObjectToSpatialObject(const MetaObjectType *mo) ITK_OVERRIDE;
68 
70  virtual MetaObjectType *SpatialObjectToMetaObject(const SpatialObjectType *spatialObject) ITK_OVERRIDE;
71 
72 protected:
74  virtual MetaObjectType *CreateMetaObject() ITK_OVERRIDE;
75  virtual const char *GetMetaObjectSubType();
77 
78  typename ImageType::Pointer AllocateImage(const ImageMetaObjectType *image);
79 
82 
83 private:
84  MetaImageConverter(const Self &) ITK_DELETE_FUNCTION;
85  void operator=(const Self &) ITK_DELETE_FUNCTION;
86 };
87 
88 } // end namespace itk
89 
90 #ifndef ITK_MANUAL_INSTANTIATION
91  #include "itkMetaImageConverter.hxx"
92 #endif
93 
94 #endif
Image< TPixel, NDimensions > ImageType
Light weight base class for most itk classes.
SmartPointer< const Self > ConstPointer
converts between MetaObject&lt;-&gt;SpatialObject.
Superclass::SpatialObjectType SpatialObjectType
virtual MetaObjectType * SpatialObjectToMetaObject(const SpatialObjectType *spatialObject) override
virtual MetaObjectType * CreateMetaObject() override
SmartPointer< Self > Pointer
ImageSpatialObjectType::Pointer ImageSpatialObjectPointer
SpatialObject< VDimension > SpatialObjectType
ImageSpatialObjectType::ConstPointer ImageSpatialObjectConstPointer
virtual const char * GetMetaObjectSubType()
MetaConverterBase< NDimensions > Superclass
Implementation of the composite pattern.
Base class for MetaObject&lt;-&gt;SpatialObject converters.
virtual SpatialObjectPointer MetaObjectToSpatialObject(const MetaObjectType *mo) override
ImageType::Pointer AllocateImage(const ImageMetaObjectType *image)
Templated n-dimensional image class.
Definition: itkImage.h:75
TSpatialObjectType ImageSpatialObjectType
Superclass::MetaObjectType MetaObjectType
SpatialObjectType::Pointer SpatialObjectPointer