00001 /*========================================================================= 00002 00003 Program: Insight Segmentation & Registration Toolkit 00004 Module: $RCSfile: itkMetaMeshConverter.h,v $ 00005 Language: C++ 00006 Date: $Date: 2004/06/17 18:24:57 $ 00007 Version: $Revision: 1.1 $ 00008 00009 Copyright (c) Insight Software Consortium. All rights reserved. 00010 See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details. 00011 00012 This software is distributed WITHOUT ANY WARRANTY; without even 00013 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00014 PURPOSE. See the above copyright notices for more information. 00015 00016 =========================================================================*/ 00017 #ifndef __MetaMeshConverter__h 00018 #define __MetaMeshConverter__h 00019 00020 00021 #include "metaMesh.h" 00022 #include "itkMeshSpatialObject.h" 00023 #include "itkSpatialObject.h" 00024 00025 namespace itk 00026 { 00027 00028 template <unsigned int NDimensions, 00029 typename PixelType = unsigned char, 00030 typename TMeshTraits = DefaultStaticMeshTraits< PixelType , NDimensions, NDimensions > 00031 > 00032 class MetaMeshConverter 00033 { 00034 00035 public: 00036 00037 MetaMeshConverter(); 00038 ~MetaMeshConverter() {}; 00039 00040 typedef itk::Mesh<PixelType,NDimensions,TMeshTraits> MeshType; 00041 typedef itk::MeshSpatialObject<MeshType> SpatialObjectType; 00042 00043 typedef typename SpatialObjectType::TransformType TransformType; 00044 00045 typedef typename SpatialObjectType::Pointer SpatialObjectPointer; 00046 00047 SpatialObjectPointer ReadMeta(const char* name); 00048 00049 bool WriteMeta(SpatialObjectType* spatialObject,const char* name); 00050 00051 SpatialObjectPointer MetaMeshToMeshSpatialObject(MetaMesh * Mesh); 00052 MetaMesh* MeshSpatialObjectToMetaMesh(SpatialObjectType * spatialObject); 00053 00054 }; 00055 00056 } // end namespace itk 00057 00058 #ifndef ITK_MANUAL_INSTANTIATION 00059 #include "itkMetaMeshConverter.txx" 00060 #endif 00061 00062 00063 #endif