ITK  4.2.0
Insight Segmentation and Registration Toolkit
itkTwoOutputExampleImageFilter.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 __itkTwoOutputExampleImageFilter_h
19 #define __itkTwoOutputExampleImageFilter_h
20 
21 #include "itkImageToImageFilter.h"
22 
23 namespace itk
24 {
43 template< class TImage >
44 class ITK_EXPORT TwoOutputExampleImageFilter:
45  public ImageToImageFilter< TImage, TImage >
46 {
47 public:
53 
55  itkNewMacro(Self);
56 
58  typedef typename TImage::PixelType PixelType;
59 
62 
65  itkSetMacro(OutsideValue, PixelType);
66 
68  itkGetConstMacro(OutsideValue, PixelType);
69 
71  void ThresholdAbove(PixelType & thresh);
72 
74  void ThresholdBelow(PixelType & thresh);
75 
77  void ThresholdOutside(PixelType & lower, PixelType & upper);
78 
79  typedef typename Superclass::InputImageConstPointer InputImageConstPointer;
80 
82  typedef TImage OutputImageType;
83  typedef typename OutputImageType::Pointer OutputImagePointer;
84  typedef typename OutputImageType::RegionType OutputImageRegionType;
85  typedef typename OutputImageType::PixelType OutputImagePixelType;
86 
88  OutputImagePointer GetInverseOutput()
89  { return static_cast< TImage * >( this->ProcessObject::GetOutput(1) ); }
90 
92  void SetInverseOutput(OutputImageType *output)
93  { this->SetNthOutput(1, output); }
94 
95 #ifdef ITK_USE_CONCEPT_CHECKING
96 
97  itkConceptMacro( ComparableCheck,
99  itkConceptMacro( OStreamWritableCheck,
101 
103 #endif
104 protected:
107  void PrintSelf(std::ostream & os, Indent indent) const;
109 
120  void ThreadedGenerateData(const OutputImageRegionType & outputRegionForThread,
121  ThreadIdType threadId);
122 
123 private:
124  TwoOutputExampleImageFilter(const Self &); //purposely not implemented
125  void operator=(const Self &); //purposely not implemented
126 
130 };
131 } // end namespace itk
132 
133 #ifndef ITK_MANUAL_INSTANTIATION
134 #include "itkTwoOutputExampleImageFilter.hxx"
135 #endif
136 
137 #endif
138