ITK  4.0.0
Insight Segmentation and Registration Toolkit
itkDoubleThresholdImageFilter.h
Go to the documentation of this file.
00001 /*=========================================================================
00002  *
00003  *  Copyright Insight Software Consortium
00004  *
00005  *  Licensed under the Apache License, Version 2.0 (the "License");
00006  *  you may not use this file except in compliance with the License.
00007  *  You may obtain a copy of the License at
00008  *
00009  *         http://www.apache.org/licenses/LICENSE-2.0.txt
00010  *
00011  *  Unless required by applicable law or agreed to in writing, software
00012  *  distributed under the License is distributed on an "AS IS" BASIS,
00013  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014  *  See the License for the specific language governing permissions and
00015  *  limitations under the License.
00016  *
00017  *=========================================================================*/
00018 #ifndef __itkDoubleThresholdImageFilter_h
00019 #define __itkDoubleThresholdImageFilter_h
00020 
00021 #include "itkImageToImageFilter.h"
00022 
00023 namespace itk
00024 {
00053 template< class TInputImage, class TOutputImage >
00054 class ITK_EXPORT DoubleThresholdImageFilter:
00055   public ImageToImageFilter< TInputImage, TOutputImage >
00056 {
00057 public:
00059   typedef DoubleThresholdImageFilter                      Self;
00060   typedef ImageToImageFilter< TInputImage, TOutputImage > Superclass;
00061   typedef SmartPointer< Self >                            Pointer;
00062   typedef SmartPointer< const Self >                      ConstPointer;
00063 
00065   itkNewMacro(Self);
00066 
00068   itkTypeMacro(DoubleThresholdImageFilter, ImageToImageFilter);
00069 
00071   typedef typename Superclass::InputImagePointer InputImagePointer;
00072   typedef typename Superclass::InputImageType    InputImageType;
00073 
00075   typedef typename TInputImage::PixelType  InputPixelType;
00076   typedef typename TOutputImage::PixelType OutputPixelType;
00077 
00080   itkSetMacro(OutsideValue, OutputPixelType);
00081 
00083   itkGetConstMacro(OutsideValue, OutputPixelType);
00084 
00087   itkSetMacro(InsideValue, OutputPixelType);
00088 
00090   itkGetConstMacro(InsideValue, OutputPixelType);
00091 
00097   itkSetMacro(Threshold1, InputPixelType);
00098   itkSetMacro(Threshold2, InputPixelType);
00099   itkSetMacro(Threshold3, InputPixelType);
00100   itkSetMacro(Threshold4, InputPixelType);
00102 
00104   itkGetConstMacro(Threshold1, InputPixelType);
00105   itkGetConstMacro(Threshold2, InputPixelType);
00106   itkGetConstMacro(Threshold3, InputPixelType);
00107   itkGetConstMacro(Threshold4, InputPixelType);
00109 
00116   itkSetMacro(FullyConnected, bool);
00117   itkGetConstReferenceMacro(FullyConnected, bool);
00118   itkBooleanMacro(FullyConnected);
00120 
00121 #ifdef ITK_USE_CONCEPT_CHECKING
00122 
00123   itkConceptMacro( OutputEqualityComparableCheck,
00124                    ( Concept::EqualityComparable< OutputPixelType > ) );
00125   itkConceptMacro( InputComparableCheck,
00126                    ( Concept::Comparable< InputPixelType > ) );
00127   itkConceptMacro( InputOStreamWritableCheck,
00128                    ( Concept::OStreamWritable< InputPixelType > ) );
00129   itkConceptMacro( OutputOStreamWritableCheck,
00130                    ( Concept::OStreamWritable< OutputPixelType > ) );
00131 
00133 #endif
00134 protected:
00135   DoubleThresholdImageFilter();
00136   virtual ~DoubleThresholdImageFilter() {}
00137   void PrintSelf(std::ostream & os, Indent indent) const;
00139 
00142   void GenerateInputRequestedRegion();
00143 
00146   void EnlargeOutputRequestedRegion( DataObject *itkNotUsed(output) );
00147 
00151   void GenerateData();
00152 
00153 private:
00154   DoubleThresholdImageFilter(const Self &); //purposely not implemented
00155   void operator=(const Self &);             //purposely not implemented
00156 
00157   InputPixelType m_Threshold1;
00158   InputPixelType m_Threshold2;
00159   InputPixelType m_Threshold3;
00160   InputPixelType m_Threshold4;
00161 
00162   OutputPixelType m_InsideValue;
00163   OutputPixelType m_OutsideValue;
00164 
00165   unsigned long m_NumberOfIterationsUsed;
00166 
00167   bool m_FullyConnected;
00168 };
00169 } // end namespace itk
00170 
00171 #ifndef ITK_MANUAL_INSTANTIATION
00172 #include "itkDoubleThresholdImageFilter.hxx"
00173 #endif
00174 
00175 #endif
00176