00001 /*========================================================================= 00002 00003 Program: Medical Imaging & Interaction Toolkit 00004 Language: C++ 00005 Date: $Date$ 00006 Version: $Revision$ 00007 00008 Copyright (c) German Cancer Research Center, Division of Medical and 00009 Biological Informatics. All rights reserved. 00010 See MITKCopyright.txt or https://www.mitk.org/copyright.html 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 00018 00019 #ifndef MITKSEEDSIMAGE_H_HEADER_INCLUDED_C1C2FCD2 00020 #define MITKSEEDSIMAGE_H_HEADER_INCLUDED_C1C2FCD2 00021 00022 #include "mitkImage.h" 00023 #include "MitkExtExports.h" 00024 00025 #include <itkImage.h> 00026 #include <itkNeighborhood.h> 00027 #include <itkNeighborhoodIterator.h> 00028 #include <itkGaussianSpatialFunction.h> 00029 #include <itkBinaryBallStructuringElement.h> 00030 00031 namespace mitk 00032 { 00033 00034 //##Documentation 00035 //## @brief SeedsImage class for storing seeds-images 00036 //## 00037 //## Handles operations for drawing seeds. 00038 //## @ingroup Data 00039 class MitkExt_EXPORT SeedsImage : public Image 00040 { 00041 00042 public: 00043 00044 mitkClassMacro(SeedsImage, Image); 00045 itkNewMacro(Self); 00046 00047 itkGetMacro(LastPoint, mitk::Point3D); 00048 00049 void Initialize(); 00050 00052 virtual void ExecuteOperation(Operation* operation); 00053 00054 void ClearBuffer(); 00055 00056 00057 protected: 00058 SeedsImage(); 00059 virtual ~SeedsImage(); 00060 00061 template< typename SeedsImageType > 00062 itk::NeighborhoodIterator< SeedsImageType >& GetNit( SeedsImageType* image ); 00063 00065 template < typename SeedsImageType > 00066 void AddSeedPoint(SeedsImageType * itkImage); 00067 00069 template < typename SeedsImageType > 00070 void PointInterpolation(SeedsImageType * itkImage); 00071 00073 template < typename SeedsImageType > 00074 void ClearBuffer(SeedsImageType * itkImage); 00075 00076 00077 protected: 00078 mitk::Point3D m_Point; 00079 mitk::Point3D m_LastPoint; 00080 mitk::Vector3D m_Spacing; 00081 int orig_size[3]; 00082 int m_DrawState; 00083 int m_Radius; 00084 float delta_x, delta_y, delta_z; 00085 float sphere_distance; 00086 00087 typedef itk::Image<float,3> MaskImageType; 00088 00089 typedef itk::GaussianSpatialFunction< int, 3 > GaussianFunction3DType; 00090 GaussianFunction3DType::Pointer m_GaussianFunction3D; 00091 typedef itk::GaussianSpatialFunction< int, 2 > GaussianFunction2DType; 00092 GaussianFunction2DType::Pointer m_GaussianFunction2D; 00093 00094 typedef itk::BinaryBallStructuringElement< short, 3 > BallStructuringElement3DType; 00095 BallStructuringElement3DType m_StructuringElement3D; 00096 typedef itk::BinaryBallStructuringElement< short, 2 > BallStructuringElement2DType; 00097 BallStructuringElement2DType m_StructuringElement2D; 00098 00099 }; 00100 00101 } // namespace mitk 00102 00103 #endif /* MITKSEEDSIMAGE_H_HEADER_INCLUDED_C1C2FCD2 */