RTK  2.0.1
Reconstruction Toolkit
rtkAverageOutOfROIImageFilter.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 #ifndef rtkAverageOutOfROIImageFilter_h
19 #define rtkAverageOutOfROIImageFilter_h
20 
21 #include "itkInPlaceImageFilter.h"
22 
24 
25 #include "rtkMacro.h"
26 
27 namespace rtk
28 {
50 template< class TInputImage,
51  class TROI = itk::Image< typename TInputImage::PixelType, TInputImage::ImageDimension -1 > >
52 
53 class AverageOutOfROIImageFilter : public itk::InPlaceImageFilter<TInputImage, TInputImage>
54 {
55 public:
56  ITK_DISALLOW_COPY_AND_ASSIGN(AverageOutOfROIImageFilter);
57 
62  using LowerDimImage = itk::Image<typename TInputImage::PixelType, TInputImage::ImageDimension - 1>;
63 
65  itkNewMacro(Self)
66 
67 
69 
71  void SetROI(const TROI* Map);
72 
73 protected:
74  AverageOutOfROIImageFilter();
75  ~AverageOutOfROIImageFilter() override = default;
76 
77  typename TROI::Pointer GetROI();
78 
79  void GenerateOutputInformation() override;
80  void GenerateInputRequestedRegion() override;
81 
83  void ThreadedGenerateData(const typename TInputImage::RegionType& outputRegionForThread, itk::ThreadIdType itkNotUsed(threadId)) override;
84 
86  const itk::ImageRegionSplitterBase* GetImageRegionSplitter(void) const override;
88 };
89 } //namespace RTK
90 
91 
92 #ifndef ITK_MANUAL_INSTANTIATION
93 #include "rtkAverageOutOfROIImageFilter.hxx"
94 #endif
95 
96 #endif
itk::ImageRegionSplitterDirection::Pointer m_Splitter
const itk::ImageRegionSplitterBase * GetImageRegionSplitter(void) const override
void GenerateOutputInformation() override
void GenerateInputRequestedRegion() override
void ThreadedGenerateData(const typename TInputImage::RegionType &outputRegionForThread, itk::ThreadIdType) override
unsigned int ThreadIdType
ImageBaseType::RegionType RegionType
void SetROI(const TROI *Map)
Averages along the last dimension if the pixel is outside ROI.