ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
rtkTotalVariationDenoiseSequenceImageFilter.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 rtkTotalVariationDenoiseSequenceImageFilter_h
20#define rtkTotalVariationDenoiseSequenceImageFilter_h
21
23
24#include <itkCastImageFilter.h>
26#include <itkPasteImageFilter.h>
27
28#ifdef RTK_USE_CUDA
30#else
32#endif
33
34namespace rtk
35{
78
79template <typename TImageSequence>
81 : public itk::ImageToImageFilter<TImageSequence, TImageSequence>
82{
83public:
84 ITK_DISALLOW_COPY_AND_MOVE(TotalVariationDenoiseSequenceImageFilter);
85
90
92 itkNewMacro(Self);
93
95 itkOverrideGetNameOfClassMacro(TotalVariationDenoiseSequenceImageFilter);
96
98 itkGetMacro(Gamma, double);
99 itkSetMacro(Gamma, double);
100
101 itkGetMacro(NumberOfIterations, int);
102 itkSetMacro(NumberOfIterations, int);
103
104 void
106
109 using ImageType = typename TImageSequence::template RebindImageType<typename TImageSequence::PixelType,
110 TImageSequence::ImageDimension - 1>;
111#ifdef RTK_USE_CUDA
112 using TVDenoisingFilterType = typename std::conditional_t<std::is_same_v<TImageSequence, CPUImageSequenceType>,
114 CudaTotalVariationDenoisingBPDQImageFilter>;
115#else
117#endif
122
123protected:
126
128 void
129 GenerateData() override;
130
131 void
133 void
135
142
144 typename TImageSequence::RegionType m_ExtractAndPasteRegion;
145
147 double m_Gamma{ 1. };
149 bool m_DimensionsProcessed[ImageType::ImageDimension];
150};
151} // namespace rtk
152
153
154#ifndef ITK_MANUAL_INSTANTIATION
155# include "rtkTotalVariationDenoiseSequenceImageFilter.hxx"
156#endif
157
158#endif
Casts input pixels to output pixel type.
SmartPointer< Self > Pointer
Decrease the image size by cropping the image to the selected region bounds.
Base class for filters that take an image as input and produce an image as output.
Templated n-dimensional image class.
Definition itkImage.h:89
Paste an image (or a constant value) into another image.
SmartPointer< Self > Pointer
Implements transparent reference counting.
Generate an n-dimensional image with constant pixel values.
~TotalVariationDenoiseSequenceImageFilter() override=default
typename VolumeSeriesType::template RebindImageType< typename VolumeSeriesType::PixelType, VolumeSeriesType::ImageDimension - 1 > ImageType
typename itk::Image< typename VolumeSeriesType::PixelType, VolumeSeriesType::ImageDimension > CPUImageSequenceType
Applies a total variation denoising, only alm_SingularValueThresholdFilterong the dimensions specifie...
#define itkSetMacro(name, type)