GOFIGURE2  0.9.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
itkGaussianProfileMatchingImageFilter.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 __itkGaussianProfileMatchingImageFilter_h
36 #define __itkGaussianProfileMatchingImageFilter_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"
47 #include "itkCastImageFilter.h"
48 #include "itkMedianImageFilter.h"
49 #include "itkRecursiveGaussianImageFilter.h"
50 #include "itkRegionOfInterestImageFilter.h"
51 #include "itkDiscreteGaussianImageFilter.h"
52 #include "itkRescaleIntensityImageFilter.h"
53 #include "itkImageRegionIteratorWithIndex.h"
54 #include "itkImageRegionIterator.h"
55 #include "itkImageRegion.h"
56 #include "itkRegion.h"
57 #include "itkIndex.h"
58 #include "itkSize.h"
59 
60 namespace itk
61 {
62 template< class TFeatureImage, class TInputImage, class TSegmentImage >
63 class GaussianProfileMatchingImageFilter:public ImageToImageFilter<
64  TFeatureImage, TInputImage >
65 {
66 public:
68  typedef ImageToImageFilter< TFeatureImage, TInputImage > Superclass;
69  typedef SmartPointer< Self > Pointer;
70  typedef SmartPointer< const Self > ConstPointer;
71 
72  itkStaticConstMacro (ImageDimension, unsigned int,
73  TFeatureImage::ImageDimension);
74 
76  itkNewMacro (Self);
77 
80 
82  void PrintSelf(std::ostream & os, Indent indent) const;
83 
84  typedef TFeatureImage FeatureImageType;
85  typedef typename FeatureImageType::Pointer FeatureImagePointer;
86  typedef typename FeatureImageType::ConstPointer FeatureImageConstPointer;
87  typedef typename FeatureImageType::PixelType FeatureImagePixelType;
88  typedef typename FeatureImageType::RegionType FeatureImageRegionType;
89  typedef typename FeatureImageType::SizeType FeatureImageSizeType;
90  typedef typename FeatureImageSizeType::SizeValueType FeatureImageSizeValueType;
91  typedef typename FeatureImageType::SpacingType FeatureImageSpacingType;
92  typedef typename FeatureImageType::IndexType FeatureImageIndexType;
93  typedef typename FeatureImageType::PointType FeatureImagePointType;
94 
95  typedef TInputImage ImageType;
96  typedef typename ImageType::Pointer ImagePointer;
97  typedef typename ImageType::ConstPointer ImageConstPointer;
98  typedef typename ImageType::PixelType ImagePixelType;
99  typedef typename ImageType::RegionType ImageRegionType;
100  typedef typename ImageType::SizeType ImageSizeType;
101  typedef typename ImageSizeType::SizeValueType ImageSizeValueType;
102  typedef typename ImageType::SpacingType ImageSpacingType;
103  typedef typename ImageType::IndexType ImageIndexType;
104  typedef typename ImageType::PointType ImagePointType;
105 
106  typedef TSegmentImage SegmentImageType;
107  typedef typename SegmentImageType::Pointer SegmentImagePointer;
108  typedef typename SegmentImageType::ConstPointer SegmentImageConstPointer;
109  typedef typename SegmentImageType::IndexType SegmentImageIndexType;
110  typedef typename SegmentImageType::PixelType SegmentImagePixelType;
111 
112  typedef RegionOfInterestImageFilter< FeatureImageType, FeatureImageType >
114  typedef typename ROIFilterType::Pointer ROIFilterPointer;
115 
116  typedef CastImageFilter< FeatureImageType, FeatureImageType > CastFilterType;
117  typedef typename CastFilterType::Pointer CastFilterPointer;
118 
119  typedef ImageRegionConstIterator< FeatureImageType > FeatureConstIteratorType;
120  typedef ImageRegionConstIteratorWithIndex< FeatureImageType > FeatureIndexConstIteratorType;
121  typedef ImageRegionIterator< ImageType > IteratorType;
122  typedef ImageRegionIteratorWithIndex< ImageType > IndexIteratorType;
123 
124  itkGetConstMacro (SigmaForm, double);
125  itkSetMacro (SigmaForm, double);
126  itkGetConstMacro (LargestCellRadius, double);
127  itkSetMacro (LargestCellRadius, double);
128 protected:
131 
133 
134  inline ImagePixelType
136 
138 
140  virtual void BeforeThreadedGenerateData();
141 
142  virtual void AfterThreadedGenerateData();
143 
144  virtual void ThreadedGenerateData(const ImageRegionType & windowRegion,
145 #ifdef ITKv4
146  ThreadIdType threadId );
147 #else
148  int threadId);
149 #endif
151 
152  void EnlargeOutputRequestedRegion( DataObject *itkNotUsed(output) );
153 
154  double m_SigmaForm;
159 private:
160  GaussianProfileMatchingImageFilter (Self &); // intentionally not implemented
161  void operator=(const Self &); // intentionally not implemented
162 };
163 } /* namespace itk */
164 
165 #include "itkGaussianProfileMatchingImageFilter.txx"
166 #endif
ImagePointer GaussianCorrelation(FeatureImagePointer rawImg)
void PrintSelf(std::ostream &os, Indent indent) const
FeatureImageSizeType::SizeValueType FeatureImageSizeValueType
ImagePointer InitializeBlob(FeatureImageSpacingType spacing, FeatureImageSizeType size)
ImageToImageFilter< TFeatureImage, TInputImage > Superclass
itkStaticConstMacro(ImageDimension, unsigned int, TFeatureImage::ImageDimension)
ImagePixelType PearsonCorrelation(ImageRegionType &region)
void EnlargeOutputRequestedRegion(DataObject *itkNotUsed(output))
CastImageFilter< FeatureImageType, FeatureImageType > CastFilterType
ImageRegionConstIteratorWithIndex< FeatureImageType > FeatureIndexConstIteratorType
ImageRegionIteratorWithIndex< ImageType > IndexIteratorType
itkTypeMacro(GaussianProfileMatchingImageFilter, ImageToImageFilter)
ImageRegionConstIterator< FeatureImageType > FeatureConstIteratorType
virtual void ThreadedGenerateData(const ImageRegionType &windowRegion, int threadId)
RegionOfInterestImageFilter< FeatureImageType, FeatureImageType > ROIFilterType