ITK  5.2.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  * 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 
37 template <unsigned int NDimensions = 3,
38  typename TPixel = unsigned char,
39  typename TSpatialObjectType = ImageSpatialObject<NDimensions, TPixel>>
40 class ITK_TEMPLATE_EXPORT MetaImageConverter : public MetaConverterBase<NDimensions>
41 {
42 public:
43  ITK_DISALLOW_COPY_AND_MOVE(MetaImageConverter);
44 
50 
52  itkNewMacro(Self);
53 
56 
57  using SpatialObjectType = typename Superclass::SpatialObjectType;
59  using MetaObjectType = typename Superclass::MetaObjectType;
60 
62  using ImageSpatialObjectType = TSpatialObjectType;
65  using ImageMetaObjectType = MetaImage;
67 
70  MetaObjectToSpatialObject(const MetaObjectType * mo) override;
71 
74  SpatialObjectToMetaObject(const SpatialObjectType * spatialObject) override;
75 
76 protected:
79  CreateMetaObject() override;
80  virtual const char *
81  GetMetaObjectSubType();
83 
84  typename ImageType::Pointer
85  AllocateImage(const ImageMetaObjectType * image);
86 
87  MetaImageConverter() = default;
88  ~MetaImageConverter() override = default;
89 };
90 
91 } // end namespace itk
92 
93 #ifndef ITK_MANUAL_INSTANTIATION
94 # include "itkMetaImageConverter.hxx"
95 #endif
96 
97 #endif
itkImageSpatialObject.h
itk::MetaImageConverter< NDimensions, unsigned char, ImageMaskSpatialObject< NDimensions > >::ImageSpatialObjectPointer
typename ImageSpatialObjectType::Pointer ImageSpatialObjectPointer
Definition: itkMetaImageConverter.h:63
itk::MetaImageConverter< NDimensions, unsigned char, ImageMaskSpatialObject< NDimensions > >::ImageSpatialObjectConstPointer
typename ImageSpatialObjectType::ConstPointer ImageSpatialObjectConstPointer
Definition: itkMetaImageConverter.h:64
itk::SmartPointer< Self >
itk::MetaConverterBase< NDimensions >::MetaObjectType
MetaObject MetaObjectType
Definition: itkMetaConverterBase.h:57
itk::MetaImageConverter< NDimensions, unsigned char, ImageMaskSpatialObject< NDimensions > >::ImageMetaObjectType
MetaImage ImageMetaObjectType
Definition: itkMetaImageConverter.h:65
itk::MetaConverterBase< NDimensions >::SpatialObjectPointer
typename SpatialObjectType::Pointer SpatialObjectPointer
Definition: itkMetaConverterBase.h:56
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:59
itk::SpatialObject
Implementation of the composite pattern.
Definition: itkSpatialObject.h:57
itk::MetaImageConverter
converts between MetaObject<->SpatialObject.
Definition: itkMetaImageConverter.h:40
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:45
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::Image
Templated n-dimensional image class.
Definition: itkImage.h:86
itkMetaConverterBase.h