ITK  4.2.0
Insight Segmentation and Registration Toolkit
itkMorphologicalWatershedFromMarkersImageFilter.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 __itkMorphologicalWatershedFromMarkersImageFilter_h
19 #define __itkMorphologicalWatershedFromMarkersImageFilter_h
20 
21 #include "itkImageToImageFilter.h"
22 
23 namespace itk
24 {
79 template< class TInputImage, class TLabelImage >
81  public ImageToImageFilter< TInputImage, TLabelImage >
82 {
83 public:
89 
91  typedef TInputImage InputImageType;
92  typedef TLabelImage LabelImageType;
93  typedef typename InputImageType::Pointer InputImagePointer;
94  typedef typename InputImageType::ConstPointer InputImageConstPointer;
95  typedef typename InputImageType::RegionType InputImageRegionType;
96  typedef typename InputImageType::PixelType InputImagePixelType;
97  typedef typename LabelImageType::Pointer LabelImagePointer;
98  typedef typename LabelImageType::ConstPointer LabelImageConstPointer;
99  typedef typename LabelImageType::RegionType LabelImageRegionType;
100  typedef typename LabelImageType::PixelType LabelImagePixelType;
101 
102  typedef typename LabelImageType::IndexType IndexType;
103 
105  itkStaticConstMacro(ImageDimension, unsigned int,
106  TInputImage::ImageDimension);
107 
109  itkNewMacro(Self);
110 
114 
116  void SetMarkerImage(const TLabelImage *input)
117  {
118  // Process object is not const-correct so the const casting is required.
119  this->SetNthInput( 1, const_cast< TLabelImage * >( input ) );
120  }
121 
123  const LabelImageType * GetMarkerImage() const
124  {
125  return static_cast< LabelImageType * >(
126  const_cast< DataObject * >( this->ProcessObject::GetInput(1) ) );
127  }
128 
130  void SetInput1(const TInputImage *input)
131  {
132  this->SetInput(input);
133  }
134 
136  void SetInput2(const TLabelImage *input)
137  {
138  this->SetMarkerImage(input);
139  }
140 
147  itkSetMacro(FullyConnected, bool);
148  itkGetConstReferenceMacro(FullyConnected, bool);
149  itkBooleanMacro(FullyConnected);
151 
157  itkSetMacro(MarkWatershedLine, bool);
158  itkGetConstReferenceMacro(MarkWatershedLine, bool);
159  itkBooleanMacro(MarkWatershedLine);
160 protected:
163  void PrintSelf(std::ostream & os, Indent indent) const;
165 
169  void GenerateInputRequestedRegion();
170 
174  void EnlargeOutputRequestedRegion( DataObject *itkNotUsed(output) );
175 
177  void GenerateData();
178 
179 private:
180  //purposely not implemented
182  void operator=(const Self &); //purposely not implemented
183 
185 
187 }; // end of class
188 } // end namespace itk
189 
190 #ifndef ITK_MANUAL_INSTANTIATION
191 #include "itkMorphologicalWatershedFromMarkersImageFilter.hxx"
192 #endif
193 
194 #endif
195