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: 2007/01/28 19:24:56 $
00007   Version:   $Revision: 1.8 $
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 __itkMetaSceneConverter_h
00018 #define __itkMetaSceneConverter_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 = 
00032             DefaultStaticMeshTraits< PixelType , NDimensions, NDimensions >
00033          >
00034 class MetaSceneConverter
00035 {
00036 
00037 public:
00038 
00039   MetaSceneConverter();
00040   ~MetaSceneConverter();
00041 
00042   itkStaticConstMacro(MaximumDepth, unsigned int, 9999999);
00043 
00044   typedef itk::SceneSpatialObject<NDimensions> SceneType;
00045   typedef typename  SceneType::Pointer         ScenePointer;
00046 
00047   ScenePointer ReadMeta(const char* name);
00048 
00049   bool WriteMeta(SceneType * scene,const char* fileName,
00050                  unsigned int depth=MaximumDepth,
00051                  char * spatialObjectTypeName=NULL);
00052 
00053 
00054   const MetaEvent* GetEvent() const {return m_Event;}
00055   void  SetEvent(MetaEvent* event) {m_Event = event;}
00056 
00058   void SetBinaryPoints(bool binary) {m_BinaryPoints = binary;}
00059 
00060   void SetTransformPrecision(unsigned int precision)
00061     {
00062     m_TransformPrecision = precision;
00063     }
00064   unsigned int GetTransformPrecision(){return m_TransformPrecision;}
00065 
00067   void SetWriteImagesInSeparateFile(bool separate) 
00068     {
00069     m_WriteImagesInSeparateFile = separate;
00070     }
00071 
00072 
00073 private:
00074 
00075   typedef itk::SpatialObject<NDimensions>           SpatialObjectType;
00076   typedef typename SpatialObjectType::Pointer       SpatialObjectPointer;
00077   typedef typename SpatialObjectType::TransformType TransformType;
00078 
00079   typedef std::list<MetaObject*>     MetaObjectListType;
00080 
00081   MetaScene * CreateMetaScene(SceneType * scene,
00082                               unsigned int depth=MaximumDepth,
00083                               char * name=NULL);
00084 
00085   ScenePointer CreateSpatialObjectScene( MetaScene * scene );
00086 
00087   void SetTransform(MetaObject* obj, TransformType* transform);
00088   void SetTransform(SpatialObjectType* so, MetaObject* obj);
00089 
00090   double m_Orientation[100];
00091   double m_Position[10];
00092   double m_CenterOfRotation[10];
00093 
00094   MetaEvent*   m_Event;
00095   bool         m_BinaryPoints;
00096   bool         m_WriteImagesInSeparateFile;
00097   unsigned int m_TransformPrecision;
00098 
00099 };
00100 
00101 } // end namespace itk
00102 
00103 #ifndef ITK_MANUAL_INSTANTIATION
00104 #include "itkMetaSceneConverter.txx"
00105 #endif
00106 
00107 
00108 #endif
00109 

Generated at Wed Nov 5 22:52:34 2008 for ITK by doxygen 1.5.1 written by Dimitri van Heesch, © 1997-2000