VMTK
Loading...
Searching...
No Matches
itkUpwindGradientMagnitudeImageFilter.h
Go to the documentation of this file.
1/*=========================================================================
2
3Program: VMTK
4
5 Copyright (c) Luca Antiga, David Steinman. All rights reserved.
6 See LICENSE file for details.
7
8 Portions of this code are covered under the VTK copyright.
9 See VTKCopyright.txt or http://www.kitware.com/VTKCopyright.htm
10 for details.
11
12 Portions of this code are covered under the ITK copyright.
13 See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm
14 for details.
15
16 This software is distributed WITHOUT ANY WARRANTY; without even
17 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
18 PURPOSE. See the above copyright notices for more information.
19
20=========================================================================*/
21#ifndef __itkUpwindGradientMagnitudeImageFilter_h
22#define __itkUpwindGradientMagnitudeImageFilter_h
23
24#include "itkImageToImageFilter.h"
25#include "itkImage.h"
26
27namespace itk
28{
41template <typename TInputImage, typename TOutputImage>
43 public ImageToImageFilter< TInputImage, TOutputImage >
44{
45public:
48 typedef ImageToImageFilter< TInputImage, TOutputImage > Superclass;
49 typedef SmartPointer<Self> Pointer;
50 typedef SmartPointer<const Self> ConstPointer;
51
54
57
60 typedef typename TOutputImage::PixelType OutputPixelType;
61 typedef typename TInputImage::PixelType InputPixelType;
62 typedef typename NumericTraits<InputPixelType>::RealType RealType;
63
66 itkStaticConstMacro(ImageDimension, unsigned int,
67 TOutputImage::ImageDimension);
68
70 typedef TInputImage InputImageType;
71 typedef TOutputImage OutputImageType;
72 typedef typename InputImageType::Pointer InputImagePointer;
73 typedef typename OutputImageType::Pointer OutputImagePointer;
74
76 typedef typename Superclass::OutputImageRegionType OutputImageRegionType;
77
86 virtual void GenerateInputRequestedRegion(); //throw(InvalidRequestedRegionError) ITK_OVERRIDE;
87
91 { this->SetUseImageSpacing(true); }
92
96 { this->SetUseImageSpacing(false); }
97
100 itkSetMacro(UseImageSpacing, bool);
101 itkGetMacro(UseImageSpacing, bool);
102
105 itkSetMacro(UpwindFactor, double);
106 itkGetMacro(UpwindFactor, double);
107
108protected:
110 {
111 m_UseImageSpacing = true;
112 m_UpwindFactor = 1.0;
113#if ITK_VERSION_MAJOR >= 5
114 this->DynamicMultiThreadingOn();
115 this->ThreaderUpdateProgressOff();
116#endif
117 }
119
131#if ITK_VERSION_MAJOR >= 5
132 void DynamicThreadedGenerateData(const OutputImageRegionType& outputRegionForThread) ITK_OVERRIDE;
133#else
134 void ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread,
135 ThreadIdType threadId ) ITK_OVERRIDE;
136#endif
137
138 void PrintSelf(std::ostream&, Indent) const ITK_OVERRIDE;
139
140
141private:
142 UpwindGradientMagnitudeImageFilter(const Self&); //purposely not implemented
143 void operator=(const Self&); //purposely not implemented
144
145 double m_UpwindFactor;
146 bool m_UseImageSpacing;
147
148};
149
150} // end namespace itk
151
152#ifndef ITK_MANUAL_INSTANTIATION
153#include "itkUpwindGradientMagnitudeImageFilter.txx"
154#endif
155
156#endif
NumericTraits< InputPixelType >::RealType RealType
void ThreadedGenerateData(const OutputImageRegionType &outputRegionForThread, ThreadIdType threadId) ITK_OVERRIDE
void PrintSelf(std::ostream &, Indent) const ITK_OVERRIDE
itkTypeMacro(UpwindGradientMagnitudeImageFilter, ImageToImageFilter)
itkStaticConstMacro(ImageDimension, unsigned int, TOutputImage::ImageDimension)
ImageToImageFilter< TInputImage, TOutputImage > Superclass