File: itkLesionSegmentationImageFilter4.h

package info (click to toggle)
volview 3.4-3
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 25,204 kB
  • sloc: cpp: 132,585; ansic: 11,612; tcl: 236; sh: 64; makefile: 25; xml: 8
file content (171 lines) | stat: -rw-r--r-- 6,889 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
/*=========================================================================

  Copyright (c) Kitware, Inc.
  All rights reserved.
  See Copyright.txt or http://www.kitware.com/VolViewCopyright.htm for details.

     This software is distributed WITHOUT ANY WARRANTY; without even
     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
     PURPOSE.  See the above copyright notice for more information.

=========================================================================*/
#ifndef __itkLesionSegmentationImageFilter4_h
#define __itkLesionSegmentationImageFilter4_h

#include "itkImageToImageFilter.h"
#include "itkImage.h"
#include "itkFixedArray.h"
#include "itkCommand.h"
#include "itkImageSpatialObject.h"
#include "itkLandmarkSpatialObject.h"
#include "itkLungWallFeatureGenerator.h"
#include "itkSatoVesselnessSigmoidFeatureGenerator.h"
#include "itkSigmoidFeatureGenerator.h"
#include "itkGradientMagnitudeSigmoidFeatureGenerator.h"
#include "itkFastMarchingSegmentationModule.h"
#include "itkMinimumFeatureAggregator.h"
#include "itkRegionOfInterestImageFilter.h"
#include "itkLesionSegmentationMethod.h"
#include "itkMinimumFeatureAggregator.h"
#include <string>

namespace itk
{

/** \class LesionSegmentationImageFilter4
 */
template<class TInputImage, class TOutputImage>
class VTK_EXPORT LesionSegmentationImageFilter4
  : public ImageToImageFilter<TInputImage, TOutputImage>
{
public:
  /** Standard "Self" & Superclass typedef.  */
  typedef LesionSegmentationImageFilter4                 Self;
  typedef ImageToImageFilter<TInputImage, TOutputImage> Superclass;
   
  /** Image typedef support   */
  typedef TInputImage  InputImageType;
  typedef TOutputImage OutputImageType;
      
  /** SmartPointer typedef support  */
  typedef SmartPointer<Self>        Pointer;
  typedef SmartPointer<const Self>  ConstPointer;

  /** Define pixel types. */
  typedef typename TInputImage::PixelType   InputImagePixelType;
  typedef typename TOutputImage::PixelType  OutputImagePixelType;
  typedef typename TInputImage::IndexType   IndexType;

  /** Method for creation through the object factory. */
  itkNewMacro(Self);  
    
  /** Typedef to describe the output image region type. */
  typedef typename TOutputImage::RegionType OutputImageRegionType;
  typedef typename TOutputImage::RegionType RegionType;
    
  /** Run-time type information (and related methods). */
  itkTypeMacro(LesionSegmentationImageFilter4, ImageToImageFilter);
  
  /** ImageDimension constant    */
  itkStaticConstMacro(ImageDimension, unsigned int,
                      TInputImage::ImageDimension);

  /** Get a status message for display purposes */
  itkGetStringMacro( StatusMessage );
  
  virtual void GenerateInputRequestedRegion() 
            throw(InvalidRequestedRegionError);

#ifdef ITK_USE_CONCEPT_CHECKING
  itkStaticConstMacro(OutputImageDimension, unsigned int,
                      TOutputImage::ImageDimension);

  /** Begin concept checking */
  itkConceptMacro(InputHasNumericTraitsCheck,
    (Concept::HasNumericTraits<InputImagePixelType>));
  itkConceptMacro(OutputHasNumericTraitsCheck,
    (Concept::HasNumericTraits<OutputImagePixelType>));
  itkConceptMacro(SameDimensionCheck,
    (Concept::SameDimension<ImageDimension, OutputImageDimension>));
  itkConceptMacro(OutputIsFloatingPointCheck,
    (Concept::IsFloatingPoint<OutputImagePixelType>));
  /** End concept checking */
#endif


  void ProgressUpdate( Object * caller, 
                       const EventObject & event );

  itkSetMacro( RegionOfInterest, RegionType );
  itkGetMacro( RegionOfInterest, RegionType );

  itkSetMacro( SigmoidBeta, double );
  itkGetMacro( SigmoidBeta, double );
  
  typedef itk::LandmarkSpatialObject< ImageDimension > SeedSpatialObjectType;
  typedef typename SeedSpatialObjectType::PointListType PointListType;

  void SetSeeds( PointListType p ) { this->m_Seeds = p; }
  PointListType GetSeeds() { return m_Seeds; }
  
  // Return the status message
  const char *GetStatusMessage() 
    {
    return m_StatusMessage.length() ? m_StatusMessage.c_str() : NULL;
    }

protected:
  LesionSegmentationImageFilter4();
  LesionSegmentationImageFilter4(const Self&) {}
  void PrintSelf(std::ostream& os, Indent indent) const;

  virtual void GenerateOutputInformation();
  void GenerateData();

  // Filters used by this class
  typedef LesionSegmentationMethod< ImageDimension > LesionSegmentationMethodType;
  typedef SatoVesselnessSigmoidFeatureGenerator< ImageDimension > VesselnessGeneratorType;
  typedef LungWallFeatureGenerator< ImageDimension > LungWallGeneratorType;
  typedef SigmoidFeatureGenerator< ImageDimension > SigmoidFeatureGeneratorType;
  typedef GradientMagnitudeSigmoidFeatureGenerator< ImageDimension > GradientMagnitudeSigmoidGeneratorType;  
  typedef MinimumFeatureAggregator< ImageDimension > FeatureAggregatorType;
  typedef FastMarchingSegmentationModule< ImageDimension > SegmentationModuleType;
  typedef RegionOfInterestImageFilter< InputImageType, InputImageType > CropFilterType; 
  typedef typename SegmentationModuleType::SpatialObjectType       SpatialObjectType;
  typedef typename SegmentationModuleType::OutputSpatialObjectType OutputSpatialObjectType;
  typedef itk::ImageSpatialObject< ImageDimension, InputImagePixelType > InputImageSpatialObjectType;
  typedef typename RegionType::SizeType           SizeType;
  typedef MemberCommand< Self >  CommandType;


private:
  virtual ~LesionSegmentationImageFilter4(){};

  double                                m_Sigma;
  double                                m_SigmoidBeta;
  double                                m_GradientMagnitudeSigmoidBeta;
  double                                m_FastMarchingStoppingTime;
  double                                m_FastMarchingDistanceFromSeeds;
  typename LesionSegmentationMethodType::Pointer m_LesionSegmentationMethod;
  typename LungWallGeneratorType::Pointer        m_LungWallFeatureGenerator;
  typename VesselnessGeneratorType::Pointer      m_VesselnessFeatureGenerator;
  typename SigmoidFeatureGeneratorType::Pointer  m_SigmoidFeatureGenerator;
  typename GradientMagnitudeSigmoidGeneratorType::Pointer m_GradientMagnitudeSigmoidFeatureGenerator;
  typename FeatureAggregatorType::Pointer        m_FeatureAggregator;
  typename SegmentationModuleType::Pointer       m_SegmentationModule;
  typename CropFilterType::Pointer               m_CropFilter;
  typename InputImageSpatialObjectType::Pointer  m_InputSpatialObject;
  typename CommandType::Pointer                  m_CommandObserver;
  RegionType                                     m_RegionOfInterest;
  std::string                                    m_StatusMessage;
  typename SeedSpatialObjectType::PointListType  m_Seeds;
};

} //end of namespace itk

#ifndef ITK_MANUAL_INSTANTIATION
#include "itkLesionSegmentationImageFilter4.txx"
#endif
  
#endif