ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itkImageSink.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 itkImageSink_h
19#define itkImageSink_h
20
22#include "itkImage.h"
26
27namespace itk
28{
29
52template <typename TInputImage>
56{
57public:
58 ITK_DISALLOW_COPY_AND_MOVE(ImageSink);
59
61 using Self = ImageSink;
65
67 itkOverrideGetNameOfClassMacro(ImageSink);
68
71
73 using InputImageType = TInputImage;
74 using InputImagePointer = typename InputImageType::Pointer;
75 using InputImageRegionType = typename InputImageType::RegionType;
76 using InputImagePixelType = typename InputImageType::PixelType;
77
81
83
85 static constexpr unsigned int InputImageDimension = InputImageType::ImageDimension;
86
87
90 virtual void
91 SetInput(const InputImageType * input);
92
93 virtual const InputImageType *
94 GetInput() const;
95
96 virtual const InputImageType *
97 GetInput(unsigned int idx) const;
98
99 virtual const InputImageType *
101
102 void
103 Update() override;
104
105 void
107
113 itkSetMacro(CoordinateTolerance, double);
114 itkGetConstMacro(CoordinateTolerance, double);
116
122 itkSetMacro(DirectionTolerance, double);
123 itkGetConstMacro(DirectionTolerance, double);
125
134
135
144
145protected:
147 ~ImageSink() override = default;
148
149 void
150 PrintSelf(std::ostream & os, Indent indent) const override;
151
152 unsigned int
154
155 void
156 GenerateNthInputRequestedRegion(unsigned int inputRequestedRegionNumber) override;
157
158 virtual void
161
162 void
163 VerifyInputInformation() const override;
164
165 void
167 {
168 this->AllocateOutputs();
169 }
170
171 void
172 StreamedGenerateData(unsigned int inputRequestedRegionNumber) override;
173
174 virtual void
175 ThreadedStreamedGenerateData(const InputImageRegionType & inputRegionForChunk) = 0;
176
177
180 itkSetMacro(NumberOfStreamDivisions, unsigned int);
181
184 itkGetConstMacro(NumberOfStreamDivisions, unsigned int);
185
188 itkSetObjectMacro(RegionSplitter, SplitterType);
189 itkGetModifiableObjectMacro(RegionSplitter, SplitterType);
191
192
193private:
194 unsigned int m_NumberOfStreamDivisions{ 1 };
197
204};
205
206
207} // namespace itk
208
209#include "itkImageSink.hxx"
210
211#endif // itkImageSink_h
SmartPointer< Self > Pointer
Divide an image region into several pieces.
virtual const InputImageType * GetInput() const
virtual void AllocateOutputs()
static double GetGlobalDefaultCoordinateTolerance()
ImageRegionSplitterBase SplitterType
virtual const InputImageType * GetInput(unsigned int idx) const
DataObject::Pointer DataObjectPointer
SmartPointer< const Self > ConstPointer
virtual void SetInput(const InputImageType *input)
static double GetGlobalDefaultDirectionTolerance()
void Update() override
Bring this filter up-to-date.
SmartPointer< Self > Pointer
typename InputImageType::Pointer InputImagePointer
unsigned int m_NumberOfStreamDivisions
virtual const InputImageType * GetInput(const DataObjectIdentifierType &key) const
void StreamedGenerateData(unsigned int inputRequestedRegionNumber) override
InputImageRegionType m_CurrentInputRegion
void PrintSelf(std::ostream &os, Indent indent) const override
void VerifyInputInformation() const override
Verifies that the inputs meta-data is consistent and valid for continued execution of the pipeline,...
void UpdateLargestPossibleRegion() override
Sets the output requested region to the largest possible region and updates.
typename SplitterType::Pointer RegionSplitterPointer
unsigned int GetNumberOfInputRequestedRegions() override
Return the actual number of regions to request upstream.
~ImageSink() override=default
StreamingProcessObject Superclass
typename InputImageType::RegionType InputImageRegionType
void GenerateNthInputRequestedRegion(unsigned int inputRequestedRegionNumber) override
For each streamed region, propagate request to all inputs.
TInputImage InputImageType
static constexpr unsigned int InputImageDimension
void BeforeStreamedGenerateData() override
RegionSplitterPointer m_RegionSplitter
virtual void ThreadedStreamedGenerateData(const InputImageRegionType &inputRegionForChunk)=0
typename InputImageType::PixelType InputImagePixelType
ImageSink Self
Secondary base class of ImageToImageFilter common between templates.
static double GetGlobalDefaultCoordinateTolerance()
static double GetGlobalDefaultDirectionTolerance()
static void SetGlobalDefaultDirectionTolerance(double)
static void SetGlobalDefaultCoordinateTolerance(double)
Control indentation during Print() invocation.
Definition itkIndent.h:50
virtual void SetInput(const DataObjectIdentifierType &key, DataObject *input)
Protected method for setting indexed and named inputs.
DataObject::DataObjectIdentifierType DataObjectIdentifierType
Implements transparent reference counting.
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....