ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
rtkUpsampleImageFilter.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 rtkUpsampleImageFilter_h
20#define rtkUpsampleImageFilter_h
21
24
25namespace rtk
26{
27
38template <class TInputImage, class TOutputImage = TInputImage>
39class ITK_TEMPLATE_EXPORT UpsampleImageFilter : public itk::ImageToImageFilter<TInputImage, TOutputImage>
40{
41public:
42 ITK_DISALLOW_COPY_AND_MOVE(UpsampleImageFilter);
43
49
51 itkNewMacro(Self);
52
54 itkOverrideGetNameOfClassMacro(UpsampleImageFilter);
55
57 using OutputImageType = TOutputImage;
58 using InputImageType = TInputImage;
59 using OutputImagePointer = typename OutputImageType::Pointer;
60 using InputImagePointer = typename InputImageType::Pointer;
61 using InputImageConstPointer = typename InputImageType::ConstPointer;
62
64 using OutputImageRegionType = typename TOutputImage::RegionType;
65
67 static constexpr unsigned int ImageDimension = TInputImage::ImageDimension;
68
71 void
72 SetFactors(const unsigned int factors[]);
73
76 void
77 SetFactor(unsigned int dimension, unsigned int factor);
78
86 void
88
94 void
96
102 itkSetMacro(Order, unsigned int);
103 itkGetMacro(Order, unsigned int);
104
110 itkSetMacro(OutputSize, typename TOutputImage::SizeType);
111 itkGetMacro(OutputSize, typename TOutputImage::SizeType);
112
119 itkSetMacro(OutputIndex, typename TOutputImage::IndexType);
120 itkGetMacro(OutputIndex, typename TOutputImage::IndexType);
121
122protected:
124 ~UpsampleImageFilter() override = default;
125
136 void
137 ThreadedGenerateData(const OutputImageRegionType & outputRegionForThread,
138 itk::ThreadIdType itkNotUsed(threadId)) override;
139
140private:
142 unsigned int m_Order;
143 typename TOutputImage::SizeType m_OutputSize;
144 typename TOutputImage::IndexType m_OutputIndex;
145
146 [[nodiscard]] const itk::ImageRegionSplitterBase *
147 GetImageRegionSplitter() const override;
149};
150
151
152} // end namespace rtk
153
154#ifndef rtk_MANUAL_INSTANTIATION
155# include "rtkUpsampleImageFilter.hxx"
156#endif
157
158#endif
Divide an image region into several pieces.
Base class for filters that take an image as input and produce an image as output.
Implements transparent reference counting.
void SetFactors(const unsigned int factors[])
itk::ImageRegionSplitterDirection::Pointer m_Splitter
void ThreadedGenerateData(const OutputImageRegionType &outputRegionForThread, itk::ThreadIdType threadId) override
void GenerateInputRequestedRegion() override
void GenerateOutputInformation() override
void SetFactor(unsigned int dimension, unsigned int factor)
itk::ImageToImageFilter< InputImageType, InputImageType > Superclass
typename InputImageType::Pointer InputImagePointer
~UpsampleImageFilter() override=default
typename OutputImageType::Pointer OutputImagePointer
typename InputImageType::RegionType OutputImageRegionType
typename InputImageType::ConstPointer InputImageConstPointer
const itk::ImageRegionSplitterBase * GetImageRegionSplitter() const override
Get the image splitter to split the image for multi-threading.
unsigned int ThreadIdType
Definition itkIntTypes.h:98
#define itkSetMacro(name, type)