ITK  4.3.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 #if !defined( ITK_LEGACY_REMOVE )
21 
22 #include "itkImageToImageFilter.h"
23 
24 namespace itk
25 {
46 template< class TImage >
47 class ITK_EXPORT TwoOutputExampleImageFilter:
48  public ImageToImageFilter< TImage, TImage >
49 {
50 public:
52  typedef TwoOutputExampleImageFilter Self;
53  typedef ImageToImageFilter< TImage, TImage > Superclass;
54  typedef SmartPointer< Self > Pointer;
55  typedef SmartPointer< const Self > ConstPointer;
56 
58  itkNewMacro(Self);
59 
61  typedef typename TImage::PixelType PixelType;
62 
64  itkTypeMacro(TwoOutputExampleImageFilter, ImageToImageFilter);
65 
68  itkSetMacro(OutsideValue, PixelType);
69 
71  itkGetConstMacro(OutsideValue, PixelType);
72 
74  void ThresholdAbove(PixelType & thresh);
75 
77  void ThresholdBelow(PixelType & thresh);
78 
80  void ThresholdOutside(PixelType & lower, PixelType & upper);
81 
82  typedef typename Superclass::InputImageConstPointer InputImageConstPointer;
83 
85  typedef TImage OutputImageType;
86  typedef typename OutputImageType::Pointer OutputImagePointer;
87  typedef typename OutputImageType::RegionType OutputImageRegionType;
88  typedef typename OutputImageType::PixelType OutputImagePixelType;
89 
91  OutputImagePointer GetInverseOutput()
92  { return static_cast< TImage * >( this->ProcessObject::GetOutput(1) ); }
93 
95  void SetInverseOutput(OutputImageType *output)
96  { this->SetNthOutput(1, output); }
97 
98 #ifdef ITK_USE_CONCEPT_CHECKING
99 
100  itkConceptMacro( ComparableCheck,
101  ( Concept::Comparable< PixelType > ) );
102  itkConceptMacro( OStreamWritableCheck,
103  ( Concept::OStreamWritable< PixelType > ) );
104 
106 #endif
107 
108 protected:
109  TwoOutputExampleImageFilter();
110  ~TwoOutputExampleImageFilter() {}
111  void PrintSelf(std::ostream & os, Indent indent) const;
112 
123  void ThreadedGenerateData(const OutputImageRegionType & outputRegionForThread,
124  ThreadIdType threadId);
125 
126 private:
127  TwoOutputExampleImageFilter(const Self &); //purposely not implemented
128  void operator=(const Self &); //purposely not implemented
129 
130  PixelType m_OutsideValue;
131  PixelType m_Lower;
132  PixelType m_Upper;
133 };
134 } // end namespace itk
135 
136 #ifndef ITK_MANUAL_INSTANTIATION
137 #include "itkTwoOutputExampleImageFilter.hxx"
138 #endif
139 
140 #endif //#if !defined( ITK_LEGACY_REMOVE )
141 #endif
142