GOFIGURE2  0.9.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
itkWatershedBasedCellSegmentation.h
Go to the documentation of this file.
1 /*=========================================================================
2  Authors: The GoFigure Dev. Team.
3  at Megason Lab, Systems biology, Harvard Medical school, 2009-11
4 
5  Copyright (c) 2009-11, President and Fellows of Harvard College.
6  All rights reserved.
7 
8  Redistribution and use in source and binary forms, with or without
9  modification, are permitted provided that the following conditions are met:
10 
11  Redistributions of source code must retain the above copyright notice,
12  this list of conditions and the following disclaimer.
13  Redistributions in binary form must reproduce the above copyright notice,
14  this list of conditions and the following disclaimer in the documentation
15  and/or other materials provided with the distribution.
16  Neither the name of the President and Fellows of Harvard College
17  nor the names of its contributors may be used to endorse or promote
18  products derived from this software without specific prior written
19  permission.
20 
21  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
23  THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
24  PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
25  BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
26  OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
27  OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
28  OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
29  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
30  OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
31  ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 
33 =========================================================================*/
34 
35 #ifndef __itkWatershedBasedCellSegmentation_h
36 #define __itkWatershedBasedCellSegmentation_h
37 
38 #if defined( _MSC_VER )
39 #pragma warning ( disable : 4786 )
40 #endif
41 
42 #ifdef __BORLANDC__
43 #define ITK_LEAN_AND_MEAN
44 #endif
45 
46 #include "itkImageToImageFilter.h"
50 #include "itkInvertIntensityImageFilter.h"
52 #include "itkImageRegionIterator.h"
53 #include "itkImageRegionIteratorWithIndex.h"
54 #include "itkMinimumMaximumImageCalculator.h"
55 #include "itkAntiAliasBinaryImageFilter.h"
56 
57 namespace itk
58 {
59 template< class TFeatureImage, class TInputImage, class TSegmentImage >
60 class WatershedBasedCellSegmentation:public ImageToImageFilter<
61  TFeatureImage, TSegmentImage >
62 {
63 public:
65  typedef ImageToImageFilter< TFeatureImage, TSegmentImage > Superclass;
66  typedef SmartPointer< Self > Pointer;
67  typedef SmartPointer< const Self > ConstPointer;
68 
69  itkStaticConstMacro (ImageDimension, unsigned int,
70  TFeatureImage::ImageDimension);
71 
73  itkNewMacro (Self);
74 
76  itkTypeMacro (WatershedBasedCellSegmentation, ImageToImageFilter);
77 
79  void PrintSelf(std::ostream & os, Indent indent) const;
80 
81  typedef TFeatureImage FeatureImageType;
82  typedef typename FeatureImageType::Pointer FeatureImagePointer;
83  typedef typename FeatureImageType::ConstPointer FeatureImageConstPointer;
84  typedef typename FeatureImageType::PixelType FeatureImagePixelType;
85  typedef typename FeatureImageType::RegionType FeatureImageRegionType;
86  typedef typename FeatureImageType::SizeType FeatureImageSizeType;
87  typedef typename FeatureImageSizeType::SizeValueType FeatureImageSizeValueType;
88  typedef typename FeatureImageType::SpacingType FeatureImageSpacingType;
89  typedef typename FeatureImageType::IndexType FeatureImageIndexType;
90  typedef typename FeatureImageType::PointType FeatureImagePointType;
91 
92  typedef TInputImage InputImageType;
93  typedef typename InputImageType::Pointer InputImagePointer;
94  typedef typename InputImageType::ConstPointer InputImageConstPointer;
95  typedef typename InputImageType::PixelType InputImagePixelType;
96  typedef typename InputImageType::RegionType InputImageRegionType;
97  typedef typename InputImageType::SizeType InputImageSizeType;
98  typedef typename InputImageSizeType::SizeValueType InputImageSizeValueType;
99  typedef typename InputImageType::SpacingType InputImageSpacingType;
100  typedef typename InputImageType::IndexType InputImageIndexType;
101  typedef typename InputImageType::PointType InputImagePointType;
102 
103  typedef TSegmentImage SegmentImageType;
104  typedef typename SegmentImageType::Pointer SegmentImagePointer;
105  typedef typename SegmentImageType::ConstPointer SegmentImageConstPointer;
106  typedef typename SegmentImageType::IndexType SegmentImageIndexType;
107  typedef typename SegmentImageType::PixelType SegmentImagePixelType;
108  typedef typename SegmentImageType::SizeType SegmentImageSizeType;
109  typedef typename SegmentImageIndexType::IndexValueType SegmentImageIndexValueType;
110  typedef typename SegmentImageType::RegionType SegmentImageRegionType;
111 
115 
119 
123 
124  typedef InvertIntensityImageFilter< InputImageType, InputImageType >
126  typedef typename RInvertType::Pointer RInvertPointer;
127 
131 
132  typedef MinimumMaximumImageCalculator< InputImageType > MinMaxCalculatorType;
133 
134  typedef ImageRegionIterator< FeatureImageType > FeatureIteratorType;
135  typedef ImageRegionIterator< InputImageType > InputIteratorType;
136  typedef ImageRegionIteratorWithIndex< SegmentImageType > SegmentIteratorType;
137 
138  typedef AntiAliasBinaryImageFilter< SegmentImageType, InputImageType > AntiAliasFilterType;
139  typedef typename AntiAliasFilterType::Pointer AntiAliasFilterPointer;
140 
141  itkGetConstMacro (NucleusRadius, double);
142  itkSetMacro (NucleusRadius, double);
143  itkGetConstMacro (CorrelationKernelSigma, double);
144  itkSetMacro (CorrelationKernelSigma, double);
145  itkGetConstMacro (NucleusThresholdMin, double);
146  itkSetMacro (NucleusThresholdMin, double);
147  itkGetConstMacro (NucleusThresholdMax, double);
148  itkSetMacro (NucleusThresholdMax, double);
149  itkGetConstMacro (CorrelationThreshold1, double);
150  itkSetMacro (CorrelationThreshold1, double);
151  itkGetConstMacro (MembraneThreshold, double);
152  itkSetMacro (MembraneThreshold, double);
153  itkGetConstMacro (Alpha, float);
154  itkSetMacro (Alpha, float);
155  itkGetConstMacro (Beta, float);
156  itkSetMacro (Beta, float);
157 protected:
160  void GenerateData();
161 
168  float m_Alpha;
169  float m_Beta;
170 private:
171  WatershedBasedCellSegmentation (Self &); // intentionally not implemented
172  void operator=(const Self &); // intentionally not implemented
173 };
174 } /* namespace itk */
175 
176 #include "itkWatershedBasedCellSegmentation.txx"
177 #endif
MorphologicalWatershedImageFilter2< InputImageType, SegmentImageType > WatershedFilterType
itkTypeMacro(WatershedBasedCellSegmentation, ImageToImageFilter)
PreprocessImageFilter< FeatureImageType, FeatureImageType > PreprocessFilterType
FeatureImageType::ConstPointer FeatureImageConstPointer
itkStaticConstMacro(ImageDimension, unsigned int, TFeatureImage::ImageDimension)
SegmentImageIndexType::IndexValueType SegmentImageIndexValueType
ImageRegionIterator< FeatureImageType > FeatureIteratorType
void PrintSelf(std::ostream &os, Indent indent) const
itkSetMacro(NucleusRadius, double)
SegmentImageType::ConstPointer SegmentImageConstPointer
CellForegroundExtraction< FeatureImageType, InputImageType, SegmentImageType > ForegroundFilterType
InvertIntensityImageFilter< InputImageType, InputImageType > RInvertType
FeatureImageSizeType::SizeValueType FeatureImageSizeValueType
itkGetConstMacro(NucleusRadius, double)
InputImageSizeType::SizeValueType InputImageSizeValueType
ImageRegionIterator< InputImageType > InputIteratorType
GradientWeightedDistanceImageFilter< FeatureImageType, InputImageType, SegmentImageType > DistanceFilterType
AntiAliasBinaryImageFilter< SegmentImageType, InputImageType > AntiAliasFilterType
ImageRegionIteratorWithIndex< SegmentImageType > SegmentIteratorType
Denoise images - remove median noise and perform morphological reconstruction. Makes it easier to seg...
ImageToImageFilter< TFeatureImage, TSegmentImage > Superclass
MinimumMaximumImageCalculator< InputImageType > MinMaxCalculatorType