GOFIGURE2  0.9.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
itkPreprocessImageFilter.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 #ifndef __itkPreprocessImageFilter_h
35 #define __itkPreprocessImageFilter_h
36 
37 #if defined( _MSC_VER )
38 #pragma warning ( disable : 4786 )
39 #endif
40 
41 #ifdef __BORLANDC__
42 #define ITK_LEAN_AND_MEAN
43 #endif
44 
45 #include "itkImageToImageFilter.h"
46 #include "itkCastImageFilter.h"
47 #include "itkMedianImageFilter.h"
48 #include "itkGrayscaleFillholeImageFilter.h"
49 #include "itkRecursiveGaussianImageFilter.h"
50 
51 namespace itk
52 {
58 template< class TInputImage, class TOutputImage = TInputImage >
59 class PreprocessImageFilter:public ImageToImageFilter<
60  TInputImage, TOutputImage >
61 {
62 public:
63 
65  typedef ImageToImageFilter< TInputImage, TOutputImage > Superclass;
66  typedef SmartPointer< Self > Pointer;
67  typedef SmartPointer< const Self > ConstPointer;
68 
69  itkStaticConstMacro (ImageDimension, unsigned int,
70  TInputImage::ImageDimension);
71 
73  itkNewMacro (Self);
74 
76  itkTypeMacro (PreprocessImageFilter, ImageToImageFilter);
77 
79  void PrintSelf(std::ostream & os, Indent indent) const;
80 
81  typedef Image< float, ImageDimension > ImageType;
82  typedef typename ImageType::Pointer ImagePointer;
83  typedef typename ImageType::ConstPointer ImageConstPointer;
84  typedef typename ImageType::PixelType ImagePixelType;
85  typedef typename ImageType::RegionType ImageRegionType;
86  typedef typename ImageType::SizeType ImageSizeType;
87  typedef typename ImageSizeType::SizeValueType ImageSizeValueType;
88 
89  typedef typename ImageType::SpacingType ImageSpacingType;
90  typedef typename ImageType::IndexType ImageIndexType;
91  typedef typename ImageType::PointType ImagePointType;
92 
93  typedef CastImageFilter< TInputImage, ImageType > InputCastType;
94  typedef typename InputCastType::Pointer InputCastPointer;
95 
96  typedef MedianImageFilter< ImageType, ImageType > MedianFilterType;
97  typedef typename MedianFilterType::Pointer MedianFilterPointer;
98  typedef RecursiveGaussianImageFilter< ImageType, ImageType >
100  typedef typename SmoothingFilterType::Pointer SmoothingFilterPointer;
101  typedef GrayscaleFillholeImageFilter< ImageType, ImageType > GrayscaleFillholeFilterType;
102  typedef typename GrayscaleFillholeFilterType::Pointer GrayscaleFillholePointer;
103  typedef CastImageFilter< ImageType, TOutputImage > OutputCastType;
104  typedef typename OutputCastType::Pointer OutputCastPointer;
105 
106  itkGetConstMacro (LargestCellRadius, double);
107  itkSetMacro (LargestCellRadius, double);
108 protected:
109 
112 
113  void GenerateData();
114 
116 private:
117  PreprocessImageFilter (Self &); // intentionally not implemented
118  void operator=(const Self &); // intentionally not implemented
119 };
120 } /* namespace itk */
121 
122 #include "itkPreprocessImageFilter.txx"
123 #endif
RecursiveGaussianImageFilter< ImageType, ImageType > SmoothingFilterType
itkGetConstMacro(LargestCellRadius, double)
SmartPointer< const Self > ConstPointer
ImageType::ConstPointer ImageConstPointer
ImageType::RegionType ImageRegionType
void operator=(const Self &)
Image< float, ImageDimension > ImageType
void PrintSelf(std::ostream &os, Indent indent) const
SmoothingFilterType::Pointer SmoothingFilterPointer
CastImageFilter< TInputImage, ImageType > InputCastType
MedianFilterType::Pointer MedianFilterPointer
ImageType::SpacingType ImageSpacingType
OutputCastType::Pointer OutputCastPointer
ImageToImageFilter< TInputImage, TOutputImage > Superclass
itkTypeMacro(PreprocessImageFilter, ImageToImageFilter)
ImageSizeType::SizeValueType ImageSizeValueType
GrayscaleFillholeFilterType::Pointer GrayscaleFillholePointer
InputCastType::Pointer InputCastPointer
CastImageFilter< ImageType, TOutputImage > OutputCastType
MedianImageFilter< ImageType, ImageType > MedianFilterType
itkStaticConstMacro(ImageDimension, unsigned int, TInputImage::ImageDimension)
GrayscaleFillholeImageFilter< ImageType, ImageType > GrayscaleFillholeFilterType
itkSetMacro(LargestCellRadius, double)
Denoise images - remove median noise and perform morphological reconstruction. Makes it easier to seg...