ITK  6.0.0
Insight Toolkit
itkMetaImageConverter.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright NumFOCUS
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  * https://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 
26 namespace itk
27 {
28 
36 template <unsigned int VDimension = 3,
37  typename TPixel = unsigned char,
38  typename TSpatialObjectType = ImageSpatialObject<VDimension, TPixel>>
39 class ITK_TEMPLATE_EXPORT MetaImageConverter : public MetaConverterBase<VDimension>
40 {
41 public:
42  ITK_DISALLOW_COPY_AND_MOVE(MetaImageConverter);
43 
49 
51  itkNewMacro(Self);
52 
54  itkOverrideGetNameOfClassMacro(MetaImageConverter);
55 
56  using typename Superclass::SpatialObjectType;
58  using typename Superclass::MetaObjectType;
59 
61  using ImageSpatialObjectType = TSpatialObjectType;
64  using ImageMetaObjectType = MetaImage;
66 
69  MetaObjectToSpatialObject(const MetaObjectType * mo) override;
70 
73  SpatialObjectToMetaObject(const SpatialObjectType * so) override;
74 
75 protected:
78  CreateMetaObject() override;
79  virtual const char *
80  GetMetaObjectSubType();
83  typename ImageType::Pointer
84  AllocateImage(const ImageMetaObjectType * image);
85 
86  MetaImageConverter() = default;
87  ~MetaImageConverter() override = default;
88 };
89 
90 } // end namespace itk
91 
92 #ifndef ITK_MANUAL_INSTANTIATION
93 # include "itkMetaImageConverter.hxx"
94 #endif
95 
96 #endif
Pointer
SmartPointer< Self > Pointer
Definition: itkAddImageFilter.h:93
ConstPointer
SmartPointer< const Self > ConstPointer
Definition: itkAddImageFilter.h:94
itkImageSpatialObject.h
itk::MetaImageConverter< VDimension, unsigned char, ImageMaskSpatialObject< VDimension > >::ImageSpatialObjectPointer
typename ImageSpatialObjectType::Pointer ImageSpatialObjectPointer
Definition: itkMetaImageConverter.h:62
itk::MetaImageConverter< VDimension, unsigned char, ImageMaskSpatialObject< VDimension > >::ImageSpatialObjectConstPointer
typename ImageSpatialObjectType::ConstPointer ImageSpatialObjectConstPointer
Definition: itkMetaImageConverter.h:63
itk::MetaImageConverter< VDimension, unsigned char, ImageMaskSpatialObject< VDimension > >::ImageMetaObjectType
MetaImage ImageMetaObjectType
Definition: itkMetaImageConverter.h:64
itk::SmartPointer< Self >
itk::MetaConverterBase::MetaObjectType
MetaObject MetaObjectType
Definition: itkMetaConverterBase.h:58
itk::MetaConverterBase::SpatialObjectPointer
typename SpatialObjectType::Pointer SpatialObjectPointer
Definition: itkMetaConverterBase.h:56
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:55
itk::SpatialObject
Implementation of the composite pattern.
Definition: itkSpatialObject.h:58
itk::MetaImageConverter
converts between MetaObject<->SpatialObject.
Definition: itkMetaImageConverter.h:39
itk::MetaConverterBase
Base class for MetaObject<->SpatialObject converters.
Definition: itkMetaConverterBase.h:42
itk::ImageMaskSpatialObject
Implementation of an image mask as spatial object.
Definition: itkImageMaskSpatialObject.h:47
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnatomicalOrientation.h:29
itk::Image
Templated n-dimensional image class.
Definition: itkImage.h:88
itkMetaConverterBase.h