ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itkImageSource.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/*=========================================================================
19 *
20 * Portions of this file are subject to the VTK Toolkit Version 3 copyright.
21 *
22 * Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
23 *
24 * For complete copyright, license and disclaimer of warranty information
25 * please refer to the NOTICE file at the top of the ITK source tree.
26 *
27 *=========================================================================*/
28#ifndef itkImageSource_h
29#define itkImageSource_h
30
31#include "itkProcessObject.h"
32#include "itkImage.h"
35
36namespace itk
37{
38
66template <typename TOutputImage>
67class ITK_TEMPLATE_EXPORT ImageSource
68 : public ProcessObject
69 , private ImageSourceCommon
70{
71public:
72 ITK_DISALLOW_COPY_AND_MOVE(ImageSource);
73
79
82
85
87 itkOverrideGetNameOfClassMacro(ImageSource);
88
90 using OutputImageType = TOutputImage;
91 using OutputImagePointer = typename OutputImageType::Pointer;
92 using OutputImageRegionType = typename OutputImageType::RegionType;
93 using OutputImagePixelType = typename OutputImageType::PixelType;
96 static constexpr unsigned int OutputImageDimension = TOutputImage::ImageDimension;
97
148 const OutputImageType *
149 GetOutput() const;
152 GetOutput(unsigned int idx);
153
192 virtual void
194
200 virtual void
202
209 virtual void
210 GraftNthOutput(unsigned int idx, DataObject * graft);
211
231protected:
233 ~ImageSource() override = default;
234
250 void
251 GenerateData() override;
252
256 void
258
301 virtual void
303 virtual void
311 virtual void
313
324 virtual void
327
338 virtual void
341
347 static const ImageRegionSplitterBase *
352
363 virtual const ImageRegionSplitterBase *
365
380 virtual unsigned int
381 SplitRequestedRegion(unsigned int i, unsigned int pieces, OutputImageRegionType & splitRegion);
382
387 ThreaderCallback(void * arg);
388
391 {
393 };
394
395 void
396 PrintSelf(std::ostream & os, Indent indent) const override;
397
402 itkGetConstMacro(DynamicMultiThreading, bool);
403 itkSetMacro(DynamicMultiThreading, bool);
404 itkBooleanMacro(DynamicMultiThreading);
407};
408} // end namespace itk
409
410#ifndef ITK_MANUAL_INSTANTIATION
411# include "itkImageSource.hxx"
412#endif
413
414#endif
SmartPointer< Self > Pointer
Divide an image region into several pieces.
OutputImageType * GetOutput()
const OutputImageType * GetOutput() const
ProcessObject::DataObjectPointer MakeOutput(const ProcessObject::DataObjectIdentifierType &) override
virtual void AllocateOutputs()
virtual void DynamicThreadedGenerateData(const OutputImageRegionType &outputRegionForThread)
typename OutputImageType::PixelType OutputImagePixelType
SmartPointer< Self > Pointer
virtual void BeforeThreadedGenerateData()
virtual void ThreadedGenerateData(const OutputImageRegionType &region, ThreadIdType threadId)
typename OutputImageType::RegionType OutputImageRegionType
void ClassicMultiThread(ThreadFunctionType callbackFunction)
TOutputImage OutputImageType
~ImageSource() override=default
virtual unsigned int SplitRequestedRegion(unsigned int i, unsigned int pieces, OutputImageRegionType &splitRegion)
virtual const ImageRegionSplitterBase * GetImageRegionSplitter() const
Get the image splitter to split the image for multi-threading.
OutputImageType * GetOutput(unsigned int idx)
static ITK_THREAD_RETURN_FUNCTION_CALL_CONVENTION ThreaderCallback(void *arg)
virtual void GraftOutput(DataObject *graft)
ProcessObject::DataObjectPointer MakeOutput(ProcessObject::DataObjectPointerArraySizeType idx) override
Superclass::DataObjectIdentifierType DataObjectIdentifierType
DataObject::Pointer DataObjectPointer
typename OutputImageType::Pointer OutputImagePointer
SmartPointer< const Self > ConstPointer
static constexpr unsigned int OutputImageDimension
static const ImageRegionSplitterBase * GetGlobalDefaultSplitter()
Returns the default image region splitter.
virtual void AfterThreadedGenerateData()
virtual void GraftNthOutput(unsigned int idx, DataObject *graft)
void GenerateData() override
virtual void GraftOutput(const DataObjectIdentifierType &key, DataObject *graft)
Superclass::DataObjectPointerArraySizeType DataObjectPointerArraySizeType
void PrintSelf(std::ostream &os, Indent indent) const override
Control indentation during Print() invocation.
Definition itkIndent.h:50
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
DataObjectPointerArray::size_type DataObjectPointerArraySizeType
DataObject::Pointer DataObjectPointer
DataObject::DataObjectIdentifierType DataObjectIdentifierType
Implements transparent reference counting.
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
unsigned int ThreadIdType
itk::ITK_THREAD_RETURN_TYPE ITK_THREAD_RETURN_FUNCTION_CALL_CONVENTION
void(*)(void *) ThreadFunctionType
Secondary base class of ImageSource common between templates.
static const ImageRegionSplitterBase * GetGlobalDefaultSplitter()