1 /*=========================================================================
2 Program: vv http://www.creatis.insa-lyon.fr/rio/vv
5 - University of LYON http://www.universite-lyon.fr/
6 - Léon Bérard cancer center http://www.centreleonberard.fr
7 - CREATIS CNRS laboratory http://www.creatis.insa-lyon.fr
9 This software is distributed WITHOUT ANY WARRANTY; without even
10 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11 PURPOSE. See the copyright notices for more information.
13 It is distributed under dual licence
15 - BSD See included LICENSE.txt file
16 - CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
17 ===========================================================================**/
18 #ifndef clitkConditionalBinaryDilateImageFilter_h
19 #define clitkConditionalBinaryDilateImageFilter_h
21 /* =================================================
22 * @file clitkConditionalBinaryDilateImageFilter.h
28 ===================================================*/
32 #include "clitkCommon.h"
37 #include "itkBinaryMorphologyImageFilter.h"
39 #include "itkNumericTraits.h"
40 #include "itkNeighborhoodIterator.h"
41 #include "itkConstNeighborhoodIterator.h"
42 #include "itkNeighborhood.h"
43 #include "itkImageBoundaryCondition.h"
44 #include "itkImageRegionIterator.h"
45 #include "itkConceptChecking.h"
50 template <class TInputImage, class TOutputImage, class TKernel>
51 class ITK_EXPORT ConditionalBinaryDilateImageFilter :
52 public itk::BinaryMorphologyImageFilter< TInputImage, TOutputImage, TKernel >
55 /** Extract dimension from input and output image. */
56 itkStaticConstMacro(InputImageDimension, unsigned int,
57 TInputImage::ImageDimension);
58 itkStaticConstMacro(OutputImageDimension, unsigned int,
59 TOutputImage::ImageDimension);
61 /** Extract the dimension of the kernel */
62 itkStaticConstMacro(KernelDimension, unsigned int,
63 TKernel::NeighborhoodDimension);
65 /** Convenient typedefs for simplifying declarations. */
66 typedef TInputImage InputImageType;
67 typedef TOutputImage OutputImageType;
68 typedef TKernel KernelType;
71 /** Standard class typedefs. */
72 typedef ConditionalBinaryDilateImageFilter Self;
73 typedef itk::BinaryMorphologyImageFilter<InputImageType, OutputImageType,
74 KernelType> Superclass;
75 typedef itk::SmartPointer<Self> Pointer;
76 typedef itk::SmartPointer<const Self> ConstPointer;
78 /** Method for creation through the object factory. */
81 /** Run-time type information (and related methods). */
82 itkTypeMacro(ConditionalBinaryDilateImageFilter, BinaryMorphologyImageFilter);
84 /** Kernel (structuring element) iterator. */
85 typedef typename KernelType::ConstIterator KernelIteratorType;
87 /** Image typedef support. */
88 typedef typename InputImageType::PixelType InputPixelType;
89 typedef typename OutputImageType::PixelType OutputPixelType;
90 typedef typename itk::NumericTraits<InputPixelType>::RealType InputRealType;
91 typedef typename InputImageType::OffsetType OffsetType;
92 typedef typename InputImageType::IndexType IndexType;
94 typedef typename InputImageType::RegionType InputImageRegionType;
95 typedef typename OutputImageType::RegionType OutputImageRegionType;
96 typedef typename InputImageType::SizeType InputSizeType;
98 /** Set the value in the image to consider as "foreground". Defaults to
99 * maximum value of PixelType. This is an alias to the
100 * ForegroundValue in the superclass. */
101 void SetDilateValue(const InputPixelType& value)
102 { this->SetForegroundValue( value ); }
104 /** Get the value in the image considered as "foreground". Defaults to
105 * maximum value of PixelType. This is an alias to the
106 * ForegroundValue in the superclass. */
107 InputPixelType GetDilateValue() const
108 { return this->GetForegroundValue(); }
111 ConditionalBinaryDilateImageFilter();
112 virtual ~ConditionalBinaryDilateImageFilter(){}
113 void PrintSelf(std::ostream& os, itk::Indent indent) const;
117 // type inherited from the superclass
118 typedef typename Superclass::NeighborIndexContainer NeighborIndexContainer;
121 ConditionalBinaryDilateImageFilter(const Self&); //purposely not implemented
122 void operator=(const Self&); //purposely not implemented
126 } // end namespace itk
128 #ifndef ITK_MANUAL_INSTANTIATION
129 #include "clitkConditionalBinaryDilateImageFilter.txx"