ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkMetaContourConverter.h
Go to the documentation of this file.
00001 /*=========================================================================
00002  *
00003  *  Copyright Insight Software Consortium
00004  *
00005  *  Licensed under the Apache License, Version 2.0 (the "License");
00006  *  you may not use this file except in compliance with the License.
00007  *  You may obtain a copy of the License at
00008  *
00009  *         http://www.apache.org/licenses/LICENSE-2.0.txt
00010  *
00011  *  Unless required by applicable law or agreed to in writing, software
00012  *  distributed under the License is distributed on an "AS IS" BASIS,
00013  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014  *  See the License for the specific language governing permissions and
00015  *  limitations under the License.
00016  *
00017  *=========================================================================*/
00018 #ifndef __itkMetaContourConverter_h
00019 #define __itkMetaContourConverter_h
00020 
00021 #include "metaContour.h"
00022 #include "itkContourSpatialObject.h"
00023 #include "itkSpatialObject.h"
00024 #include "itkMetaConverterBase.h"
00025 
00026 namespace itk
00027 {
00034 template< unsigned int NDimensions = 3 >
00035 class ITK_EXPORT MetaContourConverter :
00036     public MetaConverterBase< NDimensions >
00037 {
00038 public:
00040   typedef MetaContourConverter             Self;
00041   typedef MetaConverterBase< NDimensions > Superclass;
00042   typedef SmartPointer< Self >             Pointer;
00043   typedef SmartPointer< const Self >       ConstPointer;
00044 
00046   itkNewMacro(Self);
00047 
00049   itkTypeMacro(MetaContourConverter, MetaConverterBase);
00050 
00051   typedef typename Superclass::SpatialObjectType SpatialObjectType;
00052   typedef typename SpatialObjectType::Pointer    SpatialObjectPointer;
00053   typedef typename Superclass::MetaObjectType    MetaObjectType;
00054 
00056   typedef ContourSpatialObject<NDimensions>               ContourSpatialObjectType;
00057   typedef typename ContourSpatialObjectType::Pointer      ContourSpatialObjectPointer;
00058   typedef typename ContourSpatialObjectType::ConstPointer ContourSpatialObjectConstPointer;
00059   typedef MetaContour                                     ContourMetaObjectType;
00060 
00062   virtual SpatialObjectPointer MetaObjectToSpatialObject(const MetaObjectType *mo);
00063 
00065   virtual MetaObjectType *SpatialObjectToMetaObject(const SpatialObjectType *spatialObject);
00066 
00067 protected:
00069   virtual MetaObjectType *CreateMetaObject();
00070 
00071   MetaContourConverter();
00072   ~MetaContourConverter() {}
00073 
00074 private:
00075   MetaContourConverter(const Self &);   //purposely not implemented
00076   void operator=(const Self &);       //purposely not implemented
00077 
00078 };
00079 } // end namespace itk
00080 
00081 #ifndef ITK_MANUAL_INSTANTIATION
00082 #include "itkMetaContourConverter.hxx"
00083 #endif
00084 
00085 #endif
00086