ITK  4.8.0
Insight Segmentation and Registration Toolkit
itkIsolatedWatershedImageFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0.txt
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *=========================================================================*/
18 #ifndef itkIsolatedWatershedImageFilter_h
19 #define itkIsolatedWatershedImageFilter_h
20 
23 
24 namespace itk
25 {
40 template< typename TInputImage, typename TOutputImage >
42  public ImageToImageFilter< TInputImage, TOutputImage >
43 {
44 public:
50 
52  itkNewMacro(Self);
53 
55  itkTypeMacro(IsolatedWatershedImageFilter,
57 
58  typedef TInputImage InputImageType;
59  typedef typename InputImageType::Pointer InputImagePointer;
60  typedef typename InputImageType::ConstPointer InputImageConstPointer;
61  typedef typename InputImageType::RegionType InputImageRegionType;
62  typedef typename InputImageType::PixelType InputImagePixelType;
63  typedef typename InputImageType::IndexType IndexType;
64  typedef typename InputImageType::SizeType SizeType;
65 
66  typedef TOutputImage OutputImageType;
67  typedef typename OutputImageType::Pointer OutputImagePointer;
68  typedef typename OutputImageType::RegionType OutputImageRegionType;
69  typedef typename OutputImageType::PixelType OutputImagePixelType;
70 
73 
76  void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
77 
81  itkSetMacro(Seed1, IndexType);
82  itkGetConstMacro(Seed1, IndexType);
84 
88  itkSetMacro(Seed2, IndexType);
89  itkGetConstMacro(Seed2, IndexType);
91 
93  itkSetMacro(Threshold, double);
94  itkGetConstMacro(Threshold, double);
96 
99  itkSetMacro(IsolatedValueTolerance, double);
100  itkGetConstMacro(IsolatedValueTolerance, double);
102 
105  itkSetMacro(UpperValueLimit, double);
106  itkGetConstMacro(UpperValueLimit, double);
108 
112  itkSetMacro(ReplaceValue1, OutputImagePixelType);
113  itkGetConstMacro(ReplaceValue1, OutputImagePixelType);
114  itkSetMacro(ReplaceValue2, OutputImagePixelType);
115  itkGetConstMacro(ReplaceValue2, OutputImagePixelType);
117 
119  itkGetConstMacro(IsolatedValue, double);
120 
121 protected:
126 
129 
131 
133 
134  double m_Threshold;
138 
139  // Override since the filter needs all the data for the algorithm
140  void GenerateInputRequestedRegion() ITK_OVERRIDE;
141 
142  // Override since the filter produces the entire dataset
143  void EnlargeOutputRequestedRegion(DataObject *output) ITK_OVERRIDE;
144 
145  void GenerateData() ITK_OVERRIDE;
146 
147 private:
148  IsolatedWatershedImageFilter(const Self &); //purposely not implemented
149  void operator=(const Self &); //purposely not implemented
150 };
151 } // end namespace itk
152 
153 #ifndef ITK_MANUAL_INSTANTIATION
154 #include "itkIsolatedWatershedImageFilter.hxx"
155 #endif
156 
157 #endif
A low-level image analysis algorithm that automatically produces a hierarchy of segmented, labeled images from a scalar-valued image input.
void EnlargeOutputRequestedRegion(DataObject *output) override
Isolate watershed basins using two seeds.
GradientMagnitudeType::Pointer m_GradientMagnitude
void GenerateInputRequestedRegion() override
Image< RealPixelType, TInputImage::ImageDimension > RealImageType
WatershedImageFilter< RealImageType > WatershedType
Base class for all process objects that output image data.
ImageToImageFilter< TInputImage, TOutputImage > Superclass
InputImageType::ConstPointer InputImageConstPointer
Computes the gradient magnitude of an image region at each pixel.
OutputImageType::PixelType OutputImagePixelType
Base class for filters that take an image as input and produce an image as output.
GradientMagnitudeImageFilter< InputImageType, RealImageType > GradientMagnitudeType
Control indentation during Print() invocation.
Definition: itkIndent.h:49
NumericTraits< InputImagePixelType >::RealType RealPixelType
Define additional traits for native types such as int or float.
void PrintSelf(std::ostream &os, Indent indent) const override
Base class for all data objects in ITK.
Templated n-dimensional image class.
Definition: itkImage.h:75