ITK  4.8.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< typename TInputImage, typename 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 
124  {
125  return itkDynamicCastInDebugMode< 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);
161 
162 protected:
165  void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
166 
170  void GenerateInputRequestedRegion() ITK_OVERRIDE;
171 
175  void EnlargeOutputRequestedRegion( DataObject *itkNotUsed(output) ) ITK_OVERRIDE;
176 
178  void GenerateData() ITK_OVERRIDE;
179 
180 private:
181  //purposely not implemented
183  void operator=(const Self &); //purposely not implemented
184 
186 
188 }; // end of class
189 } // end namespace itk
190 
191 #ifndef ITK_MANUAL_INSTANTIATION
192 #include "itkMorphologicalWatershedFromMarkersImageFilter.hxx"
193 #endif
194 
195 #endif
Light weight base class for most itk classes.
virtual void SetInput(const InputImageType *image)
void EnlargeOutputRequestedRegion(DataObject *) override
DataObject * GetInput(const DataObjectIdentifierType &key)
Return an input.
Base class for filters that take an image as input and produce an image as output.
Control indentation during Print() invocation.
Definition: itkIndent.h:49
void PrintSelf(std::ostream &os, Indent indent) const override
virtual void SetNthInput(DataObjectPointerArraySizeType num, DataObject *input)
Base class for all data objects in ITK.