ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkConfidenceConnectedImageFilter.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 __itkConfidenceConnectedImageFilter_h
00019 #define __itkConfidenceConnectedImageFilter_h
00020 
00021 #include "itkImage.h"
00022 #include "itkImageToImageFilter.h"
00023 
00024 namespace itk
00025 {
00062 template< class TInputImage, class TOutputImage >
00063 class ITK_EXPORT ConfidenceConnectedImageFilter:
00064   public ImageToImageFilter< TInputImage, TOutputImage >
00065 {
00066 public:
00068   typedef ConfidenceConnectedImageFilter                  Self;
00069   typedef ImageToImageFilter< TInputImage, TOutputImage > Superclass;
00070   typedef SmartPointer< Self >                            Pointer;
00071   typedef SmartPointer< const Self >                      ConstPointer;
00072 
00074   itkNewMacro(Self);
00075 
00077   itkTypeMacro(ConfidenceConnectedImageFilter,
00078                ImageToImageFilter);
00079 
00080   typedef TInputImage                         InputImageType;
00081   typedef typename InputImageType::Pointer    InputImagePointer;
00082   typedef typename InputImageType::RegionType InputImageRegionType;
00083   typedef typename InputImageType::PixelType  InputImagePixelType;
00084   typedef typename InputImageType::IndexType  IndexType;
00085   typedef typename InputImageType::SizeType   SizeType;
00086 
00087   typedef TOutputImage                         OutputImageType;
00088   typedef typename OutputImageType::Pointer    OutputImagePointer;
00089   typedef typename OutputImageType::RegionType OutputImageRegionType;
00090   typedef typename OutputImageType::PixelType  OutputImagePixelType;
00091 
00092   typedef std::vector< IndexType > SeedsContainerType;
00093 
00094   typedef typename NumericTraits<
00095     InputImagePixelType >::RealType InputRealType;
00096 
00097   void PrintSelf(std::ostream & os, Indent indent) const;
00098 
00100   void SetSeed(const IndexType & seed);
00101 
00103   void ClearSeeds();
00104 
00106   void AddSeed(const IndexType & seed);
00107 
00110   itkSetMacro(Multiplier, double);
00111   itkGetConstMacro(Multiplier, double);
00113 
00115   itkSetMacro(NumberOfIterations, unsigned int);
00116   itkGetConstMacro(NumberOfIterations, unsigned int);
00118 
00120   itkSetMacro(ReplaceValue, OutputImagePixelType);
00121   itkGetConstMacro(ReplaceValue, OutputImagePixelType);
00123 
00126   itkSetMacro(InitialNeighborhoodRadius, unsigned int);
00127   itkGetConstReferenceMacro(InitialNeighborhoodRadius, unsigned int);
00129 
00133   itkGetConstReferenceMacro(Mean, InputRealType);
00134 
00138   itkGetConstReferenceMacro(Variance, InputRealType);
00139 
00141   virtual const SeedsContainerType &GetSeeds() const;
00142 
00143 #ifdef ITK_USE_CONCEPT_CHECKING
00144 
00145   itkConceptMacro( InputHasNumericTraitsCheck,
00146                    ( Concept::HasNumericTraits< InputImagePixelType > ) );
00147   itkConceptMacro( OutputHasNumericTraitsCheck,
00148                    ( Concept::HasNumericTraits< OutputImagePixelType > ) );
00149 
00151 #endif
00152 protected:
00153   ConfidenceConnectedImageFilter();
00154   ~ConfidenceConnectedImageFilter(){}
00155 
00156   // Override since the filter needs all the data for the algorithm
00157   void GenerateInputRequestedRegion();
00158 
00159   // Override since the filter produces the entire dataset
00160   void EnlargeOutputRequestedRegion(DataObject *output);
00161 
00162   void GenerateData();
00163 
00164 private:
00165   ConfidenceConnectedImageFilter(const Self &); //purposely not implemented
00166   void operator=(const Self &);                 //purposely not implemented
00167 
00168   SeedsContainerType   m_Seeds;
00169   double               m_Multiplier;
00170   unsigned int         m_NumberOfIterations;
00171   OutputImagePixelType m_ReplaceValue;
00172   unsigned int         m_InitialNeighborhoodRadius;
00173   InputRealType        m_Mean;
00174   InputRealType        m_Variance;
00175 };
00176 } // end namespace itk
00177 
00178 #ifndef ITK_MANUAL_INSTANTIATION
00179 #include "itkConfidenceConnectedImageFilter.hxx"
00180 #endif
00181 
00182 #endif
00183