ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
rtkTotalVariationImageFilter.h
Go to the documentation of this file.
1/*=========================================================================
2 *
3 * Copyright RTK Consortium
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * https://www.apache.org/licenses/LICENSE-2.0.txt
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 *
17 *=========================================================================*/
18
19#ifndef rtkTotalVariationImageFilter_h
20#define rtkTotalVariationImageFilter_h
21
22#include <itkArray.h>
24#include <itkNumericTraits.h>
26
27#include "rtkMacro.h"
28
29namespace rtk
30{
48
49template <typename TInputImage>
50class ITK_TEMPLATE_EXPORT TotalVariationImageFilter : public itk::ImageToImageFilter<TInputImage, TInputImage>
51{
52public:
53 ITK_DISALLOW_COPY_AND_MOVE(TotalVariationImageFilter);
54
60
62 itkNewMacro(Self);
63
65 itkOverrideGetNameOfClassMacro(TotalVariationImageFilter);
66
68 using InputImagePointer = typename TInputImage::Pointer;
69
70 using RegionType = typename TInputImage::RegionType;
71 using SizeType = typename TInputImage::SizeType;
72 using IndexType = typename TInputImage::IndexType;
73 using PixelType = typename TInputImage::PixelType;
74
76 static constexpr unsigned int ImageDimension = TInputImage::ImageDimension;
77
80
83
86 // using PixelObjectType = SimpleDataObjectDecorator< PixelType >;
87
91 {
92 return this->GetTotalVariationOutput()->Get();
93 }
94 RealObjectType *
96
97 const RealObjectType *
99
106
107 // Begin concept checking
108 itkConceptMacro(InputHasNumericTraitsCheck, (itk::Concept::HasNumericTraits<PixelType>));
109 // End concept checking
110
113 void
115 {
116 this->SetUseImageSpacing(true);
117 }
118
121 void
123 {
124 this->SetUseImageSpacing(false);
125 }
126
129 itkSetMacro(UseImageSpacing, bool);
130 itkGetConstMacro(UseImageSpacing, bool);
131
132protected:
134 ~TotalVariationImageFilter() override = default;
135 void
136 PrintSelf(std::ostream & os, itk::Indent indent) const override;
137
141 void
142 AllocateOutputs() override;
143
145 void
147
150 void
152
154 void
155 ThreadedGenerateData(const RegionType & outputRegionForThread, itk::ThreadIdType threadId) override;
156
157 // Override since the filter needs all the data for the algorithm
158 void
160
161 // Override since the filter produces all of its output
162 void
164
166
167private:
169}; // end of class
170} // end namespace rtk
171
172#ifndef ITK_MANUAL_INSTANTIATION
173# include "rtkTotalVariationImageFilter.hxx"
174#endif
175
176#endif
Array class with size defined at construction time.
Definition itkArray.h:48
Base class for all data objects in ITK.
SmartPointer< Self > Pointer
Base class for filters that take an image as input and produce an image as output.
Control indentation during Print() invocation.
Definition itkIndent.h:53
DataObjectPointerArray::size_type DataObjectPointerArraySizeType
virtual DataObjectPointer MakeOutput(DataObjectPointerArraySizeType idx)
Make a DataObject of the correct type to used as the specified output.
Decorates any "simple" data type (data types without smart pointers) with a DataObject API.
Implements transparent reference counting.
void BeforeThreadedGenerateData() override
typename itk::NumericTraits< PixelType >::RealType RealType
DataObjectPointer MakeOutput(DataObjectPointerArraySizeType output) override
RealObjectType * GetTotalVariationOutput()
virtual void SetUseImageSpacing(bool _arg)
itk::SimpleDataObjectDecorator< RealType > RealObjectType
typename TInputImage::IndexType IndexType
void PrintSelf(std::ostream &os, itk::Indent indent) const override
itk::SmartPointer< const Self > ConstPointer
const RealObjectType * GetTotalVariationOutput() const
~TotalVariationImageFilter() override=default
typename itk::DataObject::Pointer DataObjectPointer
static constexpr unsigned int ImageDimension
typename TInputImage::SizeType SizeType
void GenerateInputRequestedRegion() override
void AfterThreadedGenerateData() override
void ThreadedGenerateData(const RegionType &outputRegionForThread, itk::ThreadIdType threadId) override
void EnlargeOutputRequestedRegion(itk::DataObject *data) override
typename TInputImage::Pointer InputImagePointer
typename TInputImage::RegionType RegionType
typename TInputImage::PixelType PixelType
itk::ProcessObject::DataObjectPointerArraySizeType DataObjectPointerArraySizeType
itk::ImageToImageFilter< TInputImage, TInputImage > Superclass
#define itkConceptMacro(name, conceptType)
Compile-time check that a template argument satisfies an itk::Concept.
unsigned int ThreadIdType
Definition itkIntTypes.h:98
#define itkSetMacro(name, type)