ITK  6.0.0
Insight Toolkit
itkPasteImageFilter.h
Go to the documentation of this file.
1/*=========================================================================
2 *
3 * Copyright NumFOCUS
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#ifndef itkPasteImageFilter_h
19#define itkPasteImageFilter_h
20
22#include "itkSmartPointer.h"
24#include <numeric>
25
26namespace itk
27{
28
29
56template <typename TInputImage, typename TSourceImage = TInputImage, typename TOutputImage = TInputImage>
57class ITK_TEMPLATE_EXPORT PasteImageFilter : public InPlaceImageFilter<TInputImage, TOutputImage>
58{
59public:
60 ITK_DISALLOW_COPY_AND_MOVE(PasteImageFilter);
61
67
69 itkNewMacro(Self);
70
72 itkOverrideGetNameOfClassMacro(PasteImageFilter);
73
75 using typename Superclass::InputImagePointer;
76 using typename Superclass::OutputImagePointer;
77
79 using InputImageType = TInputImage;
80 using OutputImageType = TOutputImage;
81 using SourceImageType = TSourceImage;
85
88
90 using OutputImagePixelType = typename OutputImageType::PixelType;
91 using InputImagePixelType = typename InputImageType::PixelType;
92 using SourceImagePixelType = typename SourceImageType::PixelType;
93
102
104
105
107 static constexpr unsigned int InputImageDimension = InputImageType::ImageDimension;
108 static constexpr unsigned int OutputImageDimension = OutputImageType::ImageDimension;
109 static constexpr unsigned int SourceImageDimension = SourceImageType::ImageDimension;
110
113 itkSetMacro(DestinationIndex, InputImageIndexType);
114 itkGetConstMacro(DestinationIndex, InputImageIndexType);
125 itkSetMacro(DestinationSkipAxes, InputSkipAxesArrayType);
126 itkGetConstMacro(DestinationSkipAxes, InputSkipAxesArrayType);
132 itkSetMacro(SourceRegion, SourceImageRegionType);
133 itkGetConstMacro(SourceRegion, SourceImageRegionType);
152 itkSetDecoratedInputMacro(Constant, SourceImagePixelType);
153 itkGetDecoratedInputMacro(Constant, SourceImagePixelType);
166 void
168
169
175 void
176 VerifyInputInformation() const override
177 {}
178
179 void
180 VerifyPreconditions() const override;
181
182 bool
183 CanRunInPlace() const override;
184
185protected:
187 ~PasteImageFilter() override = default;
188 void
189 PrintSelf(std::ostream & os, Indent indent) const override;
190
193
194
204 void
205 DynamicThreadedGenerateData(const OutputImageRegionType & outputRegionForThread) override;
206
207
208 SourceImageRegionType m_SourceRegion{};
209
210 InputImageIndexType m_DestinationIndex{};
211 InputSkipAxesArrayType m_DestinationSkipAxes{};
212
213 static_assert(InputImageDimension >= SourceImageDimension,
214 "The source image dimension is greater than the input image.");
215};
216} // end namespace itk
217
218#ifndef ITK_MANUAL_INSTANTIATION
219# include "itkPasteImageFilter.hxx"
220#endif
221
222#endif
Base class for filters that take an image as input and overwrite that image as the output.
Control indentation during Print() invocation.
Definition: itkIndent.h:50
Light weight base class for most itk classes.
Paste an image (or a constant value) into another image.
itkGetInputMacro(DestinationImage, InputImageType)
itkSetInputMacro(DestinationImage, InputImageType)
InputImageSizeType GetPresumedDestinationSize() const
typename OutputImageType::PixelType OutputImagePixelType
void VerifyInputInformation() const override
typename SourceImageType::ConstPointer SourceImageConstPointer
typename InputImageType::IndexType InputImageIndexType
~PasteImageFilter() override=default
void PrintSelf(std::ostream &os, Indent indent) const override
typename SourceImageType::SizeType SourceImageSizeType
typename SourceImageType::IndexType SourceImageIndexType
typename InputImageType::RegionType InputImageRegionType
typename OutputImageType::RegionType OutputImageRegionType
bool CanRunInPlace() const override
typename OutputImageType::IndexType OutputImageIndexType
typename InputImageType::PixelType InputImagePixelType
void DynamicThreadedGenerateData(const OutputImageRegionType &outputRegionForThread) override
typename InputImageType::SizeType InputImageSizeType
void VerifyPreconditions() const override
Verifies that the process object has been configured correctly, that all required inputs are set,...
itkGetInputMacro(SourceImage, SourceImageType)
typename OutputImageType::SizeType OutputImageSizeType
typename SourceImageType::RegionType SourceImageRegionType
itkSetInputMacro(SourceImage, SourceImageType)
typename SourceImageType::Pointer SourceImagePointer
void GenerateInputRequestedRegion() override
typename SourceImageType::PixelType SourceImagePixelType
Decorates any "simple" data type (data types without smart pointers) with a DataObject API.
SmartPointer< const Self > ConstPointer
SmartPointer< Self > Pointer
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....