GOFIGURE2  0.9.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
itkMorphologicalWatershedFromMarkersImageFilter2.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 /*=========================================================================
36 
37  Program: Insight Segmentation & Registration Toolkit
38  Module: $RCSfile: itkMorphologicalWatershedFromMarkersImageFilter2.h,v $
39  Language: C++
40  Date: $Date: 2009-01-28 18:14:36 $
41  Version: $Revision: 1.4 $
42 
43  Copyright (c) Insight Software Consortium. All rights reserved.
44  See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
45 
46  This software is distributed WITHOUT ANY WARRANTY; without even
47  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
48  PURPOSE. See the above copyright notices for more information.
49 
50 =========================================================================*/
51 #ifndef __itkMorphologicalWatershedFromMarkersImageFilter2_h
52 #define __itkMorphologicalWatershedFromMarkersImageFilter2_h
53 
54 #include "itkImageToImageFilter.h"
55 
56 namespace itk
57 {
105 template< class TInputImage, class TLabelImage >
107  public ImageToImageFilter< TInputImage, TLabelImage >
108 {
109 public:
112  typedef ImageToImageFilter< TInputImage, TLabelImage > Superclass;
113  typedef SmartPointer< Self > Pointer;
114  typedef SmartPointer< const Self > ConstPointer;
115 
117  typedef TInputImage InputImageType;
118  typedef TLabelImage LabelImageType;
119  typedef typename InputImageType::Pointer InputImagePointer;
120  typedef typename InputImageType::ConstPointer InputImageConstPointer;
121  typedef typename InputImageType::RegionType InputImageRegionType;
122  typedef typename InputImageType::PixelType InputImagePixelType;
123  typedef typename LabelImageType::Pointer LabelImagePointer;
124  typedef typename LabelImageType::ConstPointer LabelImageConstPointer;
125  typedef typename LabelImageType::RegionType LabelImageRegionType;
126  typedef typename LabelImageType::PixelType LabelImagePixelType;
127 
128  typedef typename LabelImageType::IndexType IndexType;
129 
131  itkStaticConstMacro(ImageDimension, unsigned int,
132  TInputImage::ImageDimension);
133 
135  itkNewMacro(Self);
136 
139  ImageToImageFilter);
140 
142  void SetMarkerImage(const TLabelImage *input)
143  {
144  // Process object is not const-correct so the const casting is required.
145  this->SetNthInput( 1, const_cast< TLabelImage * >( input ) );
146  }
147 
150  {
151  return static_cast< LabelImageType * >(
152  const_cast< DataObject * >( this->ProcessObject::GetInput(1) ) );
153  }
154 
156  void SetInput1(const TInputImage *input)
157  {
158  this->SetInput(input);
159  }
160 
162  void SetInput2(const TLabelImage *input)
163  {
164  this->SetMarkerImage(input);
165  }
166 
168  void SetForegroundImage(TLabelImage *fg)
169  {
170  m_ForegroundImg = fg;
171  }
172 
179  itkSetMacro(FullyConnected, bool);
180  itkGetConstReferenceMacro(FullyConnected, bool);
181  itkBooleanMacro(FullyConnected);
182 
188  itkSetMacro(MarkWatershedLine, bool);
189  itkGetConstReferenceMacro(MarkWatershedLine, bool);
190  itkBooleanMacro(MarkWatershedLine);
191 protected:
194  void PrintSelf(std::ostream & os, Indent indent) const;
195 
200 
204  void EnlargeOutputRequestedRegion( DataObject *itkNotUsed(output) );
205 
207  void GenerateData();
208 
210 private:
211  //purposely not implemented
213  void operator=(const Self &); //purposely not implemented
214 
216 
218 }; // end of class
219 } // end namespace itk
220 
221 #ifndef ITK_MANUAL_INSTANTIATION
222 #include "itkMorphologicalWatershedFromMarkersImageFilter2.txx"
223 #endif
224 
225 #endif
void PrintSelf(std::ostream &os, Indent indent) const
itkTypeMacro(MorphologicalWatershedFromMarkersImageFilter2, ImageToImageFilter)
void EnlargeOutputRequestedRegion(DataObject *itkNotUsed(output))
itkStaticConstMacro(ImageDimension, unsigned int, TInputImage::ImageDimension)