forked from InsightSoftwareConsortium/ITKWikiExamples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathitkOilPaintingImageFilter.h
64 lines (50 loc) · 1.84 KB
/
itkOilPaintingImageFilter.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#ifndef __itkOilPaintingImageFilter_h
#define __itkOilPaintingImageFilter_h
#include "itkImageToImageFilter.h"
#include "itkNeighborhoodIterator.h"
namespace itk
{
/** \class OilPaintingImageFilter
* \brief Implements oil painting artistic image filter.
*
* Default number of bins is 20.
* Default radius is 5, meaning a window of 11x11x11 for 3D images.
*
* \ingroup ImageFilters
*/
template< class TImage>
class OilPaintingImageFilter:public ImageToImageFilter< TImage, TImage >
{
public:
/** Standard class type alias. */
using Self = OilPaintingImageFilter;
using Superclass = ImageToImageFilter< TImage, TImage >;
using Pointer = SmartPointer< Self >;
using RadiusType = typename NeighborhoodIterator<TImage>::RadiusType;
/** Method for creation through the object factory. */
itkNewMacro(Self);
/** Run-time type information (and related methods). */
itkTypeMacro(OilPaintingImageFilter, ImageToImageFilter);
itkSetMacro(NumberOfBins, unsigned int);
itkGetConstMacro(NumberOfBins, const unsigned int);
itkSetMacro(Radius, RadiusType);
itkGetConstMacro(Radius, const RadiusType);
void SetRadius(unsigned int radius);
protected:
OilPaintingImageFilter();
~OilPaintingImageFilter(){}
virtual void BeforeThreadedGenerateData();
/** Does the real work. */
virtual void ThreadedGenerateData(const typename Superclass::OutputImageRegionType& outputRegionForThread, ThreadIdType threadId);
private:
OilPaintingImageFilter(const Self &); //purposely not implemented
void operator=(const Self &); //purposely not implemented
typename TImage::ValueType m_Maximum, m_Minimum;
typename NeighborhoodIterator<TImage>::RadiusType m_Radius;
unsigned int m_NumberOfBins;
};
} //namespace ITK
#ifndef ITK_MANUAL_INSTANTIATION
#include "itkOilPaintingImageFilter.txx"
#endif
#endif // __itkOilPaintingImageFilter_h