ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itkNPasteImageFilter.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 itkNPasteImageFilter_h
19#define itkNPasteImageFilter_h
20
22#include "itkSmartPointer.h"
24#include <numeric>
25
26namespace itk
27{
28
29
59template <typename TInputImage, typename TSourceImage = TInputImage, typename TOutputImage = TInputImage>
60class ITK_TEMPLATE_EXPORT NPasteImageFilter : public InPlaceImageFilter<TInputImage, TOutputImage>
61{
62public:
63 ITK_DISALLOW_COPY_AND_MOVE(NPasteImageFilter);
64
70
72 itkNewMacro(Self);
73
75 itkOverrideGetNameOfClassMacro(NPasteImageFilter);
76
80
82 using InputImageType = TInputImage;
83 using OutputImageType = TOutputImage;
84 using SourceImageType = TSourceImage;
85 using OutputImageRegionType = typename OutputImageType::RegionType;
86 using InputImageRegionType = typename InputImageType::RegionType;
87 using SourceImageRegionType = typename SourceImageType::RegionType;
88
89 using SourceImagePointer = typename SourceImageType::Pointer;
90 using SourceImageConstPointer = typename SourceImageType::ConstPointer;
91
93 using OutputImagePixelType = typename OutputImageType::PixelType;
94 using InputImagePixelType = typename InputImageType::PixelType;
95 using SourceImagePixelType = typename SourceImageType::PixelType;
96
98 using OutputImageIndexType = typename OutputImageType::IndexType;
99 using OutputImageSizeType = typename OutputImageType::SizeType;
100 using InputImageIndexType = typename InputImageType::IndexType;
101 using InputImageSizeType = typename InputImageType::SizeType;
102 using SourceImageIndexType = typename SourceImageType::IndexType;
103 using SourceImageSizeType = typename SourceImageType::SizeType;
105
107
108
110 static constexpr unsigned int InputImageDimension = InputImageType::ImageDimension;
111 static constexpr unsigned int OutputImageDimension = OutputImageType::ImageDimension;
112 static constexpr unsigned int SourceImageDimension = SourceImageType::ImageDimension;
113
117 itkGetConstMacro(DestinationIndex, InputImageIndexType);
118
127 itkSetMacro(DestinationSkipAxes, InputSkipAxesArrayType);
128 itkGetConstMacro(DestinationSkipAxes, InputSkipAxesArrayType);
129
130
134 itkGetConstMacro(SourceRegion, SourceImageRegionType);
135
140
145
150 itkSetDecoratedInputMacro(Constant, SourceImagePixelType);
151 itkGetDecoratedInputMacro(Constant, SourceImagePixelType);
152
153
163 void
165
166
172 void
173 VerifyInputInformation() const override
174 {}
175
176 void
177 VerifyPreconditions() const override;
178
179 bool
180 CanRunInPlace() const override;
181
182protected:
184 ~NPasteImageFilter() override = default;
185 void
186 PrintSelf(std::ostream & os, Indent indent) const override;
187
190
191
201 void
202 DynamicThreadedGenerateData(const OutputImageRegionType & outputRegionForThread) override;
203
204
206
209
210 static_assert(InputImageDimension >= SourceImageDimension, "The source image is greater than the input image.");
211};
212} // end namespace itk
213
214#ifndef ITK_MANUAL_INSTANTIATION
215# include "itkNPasteImageFilter.hxx"
216#endif
217
218#endif
Simulate a standard C array with copy semantics.
typename OutputImageType::Pointer OutputImagePointer
Control indentation during Print() invocation.
Definition itkIndent.h:53
typename InputImageType::RegionType InputImageRegionType
~NPasteImageFilter() override=default
typename OutputImageType::PixelType OutputImagePixelType
typename SourceImageType::Pointer SourceImagePointer
typename SourceImageType::ConstPointer SourceImageConstPointer
InputImageIndexType m_DestinationIndex
void VerifyPreconditions() const override
Verifies that the process object has been configured correctly, that all required inputs are set,...
SmartPointer< Self > Pointer
typename OutputImageType::IndexType OutputImageIndexType
InputImageSizeType GetPresumedDestinationSize() const
typename InputImageType::SizeType InputImageSizeType
typename SourceImageType::IndexType SourceImageIndexType
SimpleDataObjectDecorator< SourceImagePixelType > DecoratedSourceImagePixelType
bool CanRunInPlace() const override
typename SourceImageType::PixelType SourceImagePixelType
typename InputImageType::IndexType InputImageIndexType
void PrintSelf(std::ostream &os, Indent indent) const override
static constexpr unsigned int InputImageDimension
FixedArray< bool, InputImageType::ImageDimension > InputSkipAxesArrayType
void VerifyInputInformation() const override
SmartPointer< const Self > ConstPointer
typename Superclass::InputImagePointer InputImagePointer
typename OutputImageType::RegionType OutputImageRegionType
typename SourceImageType::SizeType SourceImageSizeType
itkSetInputMacro(SourceImage, SourceImageType)
InPlaceImageFilter< TInputImage, TOutputImage > Superclass
itkSetInputMacro(DestinationImage, InputImageType)
void GenerateInputRequestedRegion() override
itkGetInputMacro(DestinationImage, InputImageType)
SourceImageRegionType m_SourceRegion
typename Superclass::OutputImagePointer OutputImagePointer
typename SourceImageType::RegionType SourceImageRegionType
static constexpr unsigned int OutputImageDimension
itkGetInputMacro(SourceImage, SourceImageType)
InputSkipAxesArrayType m_DestinationSkipAxes
static constexpr unsigned int SourceImageDimension
typename OutputImageType::SizeType OutputImageSizeType
void DynamicThreadedGenerateData(const OutputImageRegionType &outputRegionForThread) override
typename InputImageType::PixelType InputImagePixelType
Decorates any "simple" data type (data types without smart pointers) with a DataObject API.
Implements transparent reference counting.
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
#define itkSetMacro(name, type)