ITK  4.8.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< typename TImage >
47 class 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  // Begin concept checking
100  itkConceptMacro( ComparableCheck,
101  ( Concept::Comparable< PixelType > ) );
102  itkConceptMacro( OStreamWritableCheck,
103  ( Concept::OStreamWritable< PixelType > ) );
104  // Begin concept checking
105 #endif
106 
107 protected:
108  TwoOutputExampleImageFilter();
109  ~TwoOutputExampleImageFilter() {}
110  void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
111 
122  void ThreadedGenerateData(const OutputImageRegionType & outputRegionForThread,
123  ThreadIdType threadId);
124 
125 private:
126  TwoOutputExampleImageFilter(const Self &); //purposely not implemented
127  void operator=(const Self &); //purposely not implemented
128 
129  PixelType m_OutsideValue;
130  PixelType m_Lower;
131  PixelType m_Upper;
132 };
133 } // end namespace itk
134 
135 #ifndef ITK_MANUAL_INSTANTIATION
136 #include "itkTwoOutputExampleImageFilter.hxx"
137 #endif
138 
139 #endif //#if !defined( ITK_LEGACY_REMOVE )
140 #endif
unsigned int ThreadIdType
Definition: itkIntTypes.h:159
TOutput m_OutsideValue
#define itkConceptMacro(name, concept)
DataObject * GetOutput(const DataObjectIdentifierType &key)