Main Page   Groups   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Concepts

itkMetaSceneConverter.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkMetaSceneConverter.h,v $
00005   Language:  C++
00006   Date:      $Date: 2005/05/06 15:27:20 $
00007   Version:   $Revision: 1.7 $
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 __MetaSceneConverter__h
00018 #define __MetaSceneConverter__h
00019 
00020 #include "itkSpatialObject.h"
00021 #include "metaScene.h"
00022 #include "itkMetaEvent.h"
00023 #include "itkSceneSpatialObject.h"
00024 #include "itkDefaultStaticMeshTraits.h"
00025 
00026 namespace itk 
00027 {
00028 
00029 template <unsigned int NDimensions, 
00030           typename PixelType = unsigned char,
00031           typename TMeshTraits = DefaultStaticMeshTraits< PixelType , NDimensions, NDimensions >
00032          >
00033 class MetaSceneConverter
00034 {
00035 
00036 public:
00037 
00038   MetaSceneConverter();
00039   ~MetaSceneConverter();
00040 
00041   itkStaticConstMacro(MaximumDepth, unsigned int, 9999999);
00042 
00043   typedef itk::SceneSpatialObject<NDimensions>  SceneType;
00044   typedef typename  SceneType::Pointer ScenePointer;
00045 
00046   ScenePointer ReadMeta(const char* name);
00047 
00048   bool WriteMeta(SceneType * scene,const char* fileName,
00049                  unsigned int depth=MaximumDepth,
00050                  char * spatialObjectTypeName=NULL);
00051 
00052 
00053   const MetaEvent* GetEvent() const {return m_Event;}
00054   void  SetEvent(MetaEvent* event) {m_Event = event;}
00055 
00057   void SetBinaryPoints(bool binary) {m_BinaryPoints = binary;}
00058 
00059   void SetTransformPrecision(unsigned int precision){m_TransformPrecision = precision;}
00060   unsigned int GetTransformPrecision(){return m_TransformPrecision;}
00061 
00063   void SetWriteImagesInSeparateFile(bool separate) {m_WriteImagesInSeparateFile = separate;}
00064 
00065 
00066 private:
00067 
00068   typedef itk::SpatialObject<NDimensions> SpatialObjectType;
00069   typedef typename SpatialObjectType::Pointer SpatialObjectPointer;
00070   typedef typename SpatialObjectType::TransformType TransformType ;
00071 
00072   typedef std::list<MetaObject*>     MetaObjectListType;
00073 
00074   MetaScene * CreateMetaScene(SceneType * scene,
00075                               unsigned int depth=MaximumDepth,
00076                               char * name=NULL);
00077 
00078   ScenePointer CreateSpatialObjectScene( MetaScene * scene );
00079 
00080   void SetTransform(MetaObject* obj, TransformType* transform) ;
00081   void SetTransform(SpatialObjectType* so, MetaObject* obj) ;
00082 
00083   double m_Orientation[100] ;
00084   double m_Position[10] ;
00085   double m_CenterOfRotation[10] ;
00086 
00087   MetaEvent* m_Event;
00088   bool  m_BinaryPoints;
00089   bool  m_WriteImagesInSeparateFile;
00090   unsigned int m_TransformPrecision;
00091 
00092 };
00093 
00094 } // end namespace itk
00095 
00096 #ifndef ITK_MANUAL_INSTANTIATION
00097 #include "itkMetaSceneConverter.txx"
00098 #endif
00099 
00100 
00101 #endif

Generated at Wed May 24 23:40:36 2006 for ITK by doxygen 1.3.5 written by Dimitri van Heesch, © 1997-2000