ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itkMaskedAssignImageFilter.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 itkMaskedAssignImageFilter_h
19#define itkMaskedAssignImageFilter_h
20
22#include "itkNumericTraits.h"
23
24namespace itk
25{
26
59template <typename TInputImage, typename TMaskImage, typename TOutputImage = TInputImage>
60class MaskedAssignImageFilter : public TernaryGeneratorImageFilter<TInputImage, TMaskImage, TOutputImage, TOutputImage>
61{
62public:
63 ITK_DISALLOW_COPY_AND_MOVE(MaskedAssignImageFilter);
64
68
71
73 itkNewMacro(Self);
74
76 itkOverrideGetNameOfClassMacro(MaskedAssignImageFilter);
77
79 using InputImageType = TInputImage;
80 using MaskImageType = TMaskImage;
81 using AssignImageType = TOutputImage;
82 using OutputImageType = TOutputImage;
83
84 using OutputPixelType = typename OutputImageType::PixelType;
85
86 virtual void
88 {
89 this->SetInput2(mask);
90 }
91 virtual const MaskImageType *
93 {
94 return dynamic_cast<const MaskImageType *>(this->ProcessObject::GetInput(1));
95 }
96
97 virtual void
99 {
100 this->SetInput3(assign);
101 }
102 virtual const AssignImageType *
104 {
105 return dynamic_cast<const AssignImageType *>(this->ProcessObject::GetInput(2));
106 }
107
108 virtual void
110 {
111 this->SetConstant3(v);
112 }
113 virtual OutputPixelType
115 {
116 return this->GetConstant3();
117 }
118
119protected:
121 ~MaskedAssignImageFilter() override = default;
122};
123} // end namespace itk
124
125#endif
126
127#ifndef ITK_MANUAL_INSTANTIATION
128#include "itkMaskedAssignImageFilter.hxx"
129#endif
typename OutputImageType::PixelType OutputPixelType
virtual void SetAssignImage(const AssignImageType *assign)
SmartPointer< const Self > ConstPointer
virtual const MaskImageType * GetMaskImage() const
virtual void SetAssignConstant(const OutputPixelType &v)
virtual const AssignImageType * GetAssignImage() const
~MaskedAssignImageFilter() override=default
virtual void SetMaskImage(const MaskImageType *mask)
virtual OutputPixelType GetAssignConstant() const
TernaryGeneratorImageFilter< TInputImage, TMaskImage, TOutputImage, TOutputImage > Superclass
DataObject * GetInput(const DataObjectIdentifierType &key)
Return an input.
Implements transparent reference counting.
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....