RTK  1.4.0
Reconstruction Toolkit
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  * http://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 
22 #include "rtkConstantImageSource.h"
23 
24 #include <itkExtractImageFilter.h>
25 #include <itkPasteImageFilter.h>
26 #include <itkCastImageFilter.h>
27 
28 #ifdef RTK_USE_CUDA
30 #else
32 #endif
33 
34 namespace rtk
35 {
77 template< typename TImageSequence >
78 class TotalVariationDenoiseSequenceImageFilter : public itk::ImageToImageFilter<TImageSequence, TImageSequence>
79 {
80 public:
85 
87  itkNewMacro(Self)
88 
89 
91 
93  itkGetMacro(Gamma, double)
94  itkSetMacro(Gamma, double)
95 
96  itkGetMacro(NumberOfIterations, int)
97  itkSetMacro(NumberOfIterations, int)
98 
99  void SetDimensionsProcessed(bool* arg);
100 
102 #ifdef RTK_USE_CUDA
103  typedef itk::CudaImage<typename TImageSequence::PixelType, TImageSequence::ImageDimension - 1> TImage;
104  typedef rtk::CudaTotalVariationDenoisingBPDQImageFilter TVDenoisingFilterType;
105 #else
106  typedef itk::Image<typename TImageSequence::PixelType, TImageSequence::ImageDimension - 1> TImage;
108 #endif
113 
114 protected:
117 
119  void GenerateData() ITK_OVERRIDE;
120 
121  void GenerateOutputInformation() ITK_OVERRIDE;
122  void GenerateInputRequestedRegion() ITK_OVERRIDE;
123 
126  typename ExtractFilterType::Pointer m_ExtractFilter;
130 
132  typename TImageSequence::RegionType m_ExtractAndPasteRegion;
133 
135  double m_Gamma;
137  bool m_DimensionsProcessed[TImage::ImageDimension];
138 
139 private:
140  TotalVariationDenoiseSequenceImageFilter(const Self &); //purposely not implemented
141  void operator=(const Self &); //purposely not implemented
142 };
143 } //namespace ITK
144 
145 
146 #ifndef ITK_MANUAL_INSTANTIATION
147 #include "rtkTotalVariationDenoiseSequenceImageFilter.hxx"
148 #endif
149 
150 #endif
Generate an n-dimensional image with constant pixel values.
Applies 3D total variation denoising to a 3D + time sequence of images.
Applies a total variation denoising, only alm_SingularValueThresholdFilterong the dimensions specifie...
rtk::TotalVariationDenoisingBPDQImageFilter< TImage > TVDenoisingFilterType
itk::ImageToImageFilter< TImageSequence, TImageSequence > Superclass
itk::Image< typename TImageSequence::PixelType, TImageSequence::ImageDimension-1 > TImage
itk::PasteImageFilter< TImageSequence, TImageSequence > PasteFilterType
itk::ExtractImageFilter< TImageSequence, TImage > ExtractFilterType
#define itkSetMacro(name, type)