ITK  4.4.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 > >
39 class ITK_EXPORT MetaImageConverter :
40  public MetaConverterBase< NDimensions >
41 {
42 public:
48 
50  itkNewMacro(Self);
51 
54 
55  typedef typename Superclass::SpatialObjectType SpatialObjectType;
57  typedef typename Superclass::MetaObjectType MetaObjectType;
58 
60  typedef TSpatialObjectType ImageSpatialObjectType;
63  typedef MetaImage ImageMetaObjectType;
65 
67  virtual SpatialObjectPointer MetaObjectToSpatialObject(const MetaObjectType *mo);
68 
70  virtual MetaObjectType *SpatialObjectToMetaObject(const SpatialObjectType *spatialObject);
71 
72 protected:
74  virtual MetaObjectType *CreateMetaObject();
75  virtual const char *GetMetaObjectSubType();
77 
78  typename ImageType::Pointer AllocateImage(const ImageMetaObjectType *image);
79 
82 
83 private:
84  MetaImageConverter(const Self &); //purposely not implemented
85  void operator=(const Self &); //purposely not implemented
86 };
87 
88 } // end namespace itk
89 
90 #ifndef ITK_MANUAL_INSTANTIATION
91  #include "itkMetaImageConverter.hxx"
92 #endif
93 
94 #endif
95