ITK
5.0.0
Insight Segmentation and Registration Toolkit
|
#include <itkImageTransformer.h>
Base class for all process objects that transform an image into something else.
ImageTransformer is the base class for all process objects that transform an image data. Specifically, this class defines the SetInput() method that takes a pointer to the input image. The class also defines some internal private data members that are used to manage streaming of data.
Memory management in an ImageTransformer is slightly different than a standard ProcessObject. ProcessObject's always release the bulk data associated with their output prior to GenerateData() being called. ImageTransformers default to not releasing the bulk data incase that particular memory block is large enough to hold the new output values. This avoids unnecessary deallocation/allocation sequences. ImageTransformer's can be forced to use a memory management model similar to the default ProcessObject behaviour by calling ProcessObject::ReleaseDataBeforeUpdateFlagOn(). A user may want to set this flag to limit peak memory usage during a pipeline update.
Definition at line 59 of file itkImageTransformer.h.
Classes | |
struct | ThreadStruct |
Static Public Attributes | |
static constexpr unsigned int | InputImageDimension = TInputImage::ImageDimension |
Static Protected Member Functions | |
static ITK_THREAD_RETURN_FUNCTION_CALL_CONVENTION | ThreaderCallback (void *arg) |
Additional Inherited Members | |
Static Public Member Functions inherited from itk::Object | |
static bool | GetGlobalWarningDisplay () |
static void | GlobalWarningDisplayOff () |
static void | GlobalWarningDisplayOn () |
static Pointer | New () |
static void | SetGlobalWarningDisplay (bool flag) |
Static Public Member Functions inherited from itk::LightObject | |
static void | BreakOnError () |
static Pointer | New () |
Protected Attributes inherited from itk::ProcessObject | |
TimeStamp | m_OutputInformationMTime |
bool | m_Updating |
Protected Attributes inherited from itk::LightObject | |
std::atomic< int > | m_ReferenceCount |
using itk::ImageTransformer< TInputImage >::ConstPointer = SmartPointer< const Self > |
Definition at line 68 of file itkImageTransformer.h.
using itk::ImageTransformer< TInputImage >::DataObjectPointer = DataObject::Pointer |
Smart Pointer type to a DataObject.
Definition at line 71 of file itkImageTransformer.h.
using itk::ImageTransformer< TInputImage >::InputImagePixelType = typename InputImageType::PixelType |
Definition at line 80 of file itkImageTransformer.h.
using itk::ImageTransformer< TInputImage >::InputImagePointer = typename InputImageType::Pointer |
Definition at line 78 of file itkImageTransformer.h.
using itk::ImageTransformer< TInputImage >::InputImageRegionType = typename InputImageType::RegionType |
Definition at line 79 of file itkImageTransformer.h.
using itk::ImageTransformer< TInputImage >::InputImageType = TInputImage |
Some convenient type alias.
Definition at line 77 of file itkImageTransformer.h.
using itk::ImageTransformer< TInputImage >::Pointer = SmartPointer< Self > |
Definition at line 67 of file itkImageTransformer.h.
using itk::ImageTransformer< TInputImage >::Self = ImageTransformer |
Standard class type aliases.
Definition at line 65 of file itkImageTransformer.h.
using itk::ImageTransformer< TInputImage >::Superclass = ProcessObject |
Definition at line 66 of file itkImageTransformer.h.
|
protected |
|
overrideprotecteddefault |
|
inlineprotectedvirtual |
If an imaging filter needs to perform processing after all processing threads have completed, the filter can can provide an implementation for AfterThreadedGenerateData(). The execution flow in the default GenerateData() method will be: 1) Allocate the output buffer 2) Call BeforeThreadedGenerateData() 3) Spawn threads, calling ThreadedGenerateData() in each thread. 4) Call AfterThreadedGenerateData() Note that this flow of control is only available if a filter provides a ThreadedGenerateData() method and NOT a GenerateData() method.
Reimplemented in itk::Statistics::ImageToHistogramFilter< TImage >.
Definition at line 215 of file itkImageTransformer.h.
|
protectedvirtual |
The GenerateData method normally allocates the buffers for all of the outputs of a filter. Some filters may want to override this default behavior. For example, a filter may have multiple outputs with varying resolution. Or a filter may want to process data in place by grafting its input to its output.
|
inlineprotectedvirtual |
If an imaging filter needs to perform processing after the buffer has been allocated but before threads are spawned, the filter can can provide an implementation for BeforeThreadedGenerateData(). The execution flow in the default GenerateData() method will be: 1) Allocate the output buffer 2) Call BeforeThreadedGenerateData() 3) Spawn threads, calling ThreadedGenerateData() in each thread. 4) Call AfterThreadedGenerateData() Note that this flow of control is only available if a filter provides a ThreadedGenerateData() method and NOT a GenerateData() method.
Reimplemented in itk::Statistics::ImageToHistogramFilter< TImage >.
Definition at line 203 of file itkImageTransformer.h.
|
protected |
Many filters do special management of image buffer and threading, so this method provides just the multi-threaded invocation part of GenerateData() method.
|
overrideprotectedvirtual |
A version of GenerateData() specific for image processing filters. This implementation will split the processing across multiple threads. The buffer is allocated by this method. Then the BeforeThreadedGenerateData() method is called (if provided). Then, a series of threads are spawned each calling ThreadedGenerateData(). After all the threads have completed processing, the AfterThreadedGenerateData() method is called (if provided). If an image processing filter cannot be threaded, the filter should provide an implementation of GenerateData(). That implementation is responsible for allocating the output buffer. If a filter an be threaded, it should NOT provide a GenerateData() method but should provide a ThreadedGenerateData() instead.
Reimplemented from itk::ProcessObject.
|
overrideprotectedvirtual |
The image transformer is assumed to need the whole input.
This implementation of GenerateInputRequestedRegion() only processes the inputs that are a subclass of the ImageBase<InputImageDimension>. If an input is another type of DataObject (including an Image of a different dimension), they are skipped by this method. The subclasses of ImageToImageFilter are responsible for providing an implementation of GenerateInputRequestedRegion() when there are multiple inputs of different types.
Reimplemented from itk::ProcessObject.
const InputImageType* itk::ImageTransformer< TInputImage >::GetInput | ( | ) | const |
InputImageType* itk::ImageTransformer< TInputImage >::GetInput | ( | ) |
const InputImageType* itk::ImageTransformer< TInputImage >::GetInput | ( | unsigned int | idx | ) | const |
|
virtual |
Run-time type information (and related methods).
Reimplemented from itk::ProcessObject.
Reimplemented in itk::Statistics::ImageToHistogramFilter< TImage >, and itk::Statistics::MaskedImageToHistogramFilter< TImage, TMaskImage >.
|
overridevirtual |
Push/Pop the input of this process object. These methods allow a filter to model its input vector as a queue or stack. These routines may not be appropriate for all filters, especially filters with different types of inputs. These routines follow the semantics of STL.
The routines are useful for applications that need to process "rolling" sets of images. For instance, if an application has 10 images and they need to run a filter on images 1, 2, 3, 4, then run the filter on images 2, 3, 4, 5, then run the filter on images 3, 4, 5, 6, the application can accomplish this by popping an input off the front of the input list and push a new image onto the back of input list. Again, this only makes sense for filters that single type of input.
Other uses are also possible. For a single input filter, pushing and popping inputs allow the application to temporarily replace an input to a filter.
Reimplemented from itk::ProcessObject.
|
overridevirtual |
Push/Pop the input of this process object. These methods allow a filter to model its input vector as a queue or stack. These routines may not be appropriate for all filters, especially filters with different types of inputs. These routines follow the semantics of STL.
The routines are useful for applications that need to process "rolling" sets of images. For instance, if an application has 10 images and they need to run a filter on images 1, 2, 3, 4, then run the filter on images 2, 3, 4, 5, then run the filter on images 3, 4, 5, 6, the application can accomplish this by popping an input off the front of the input list and push a new image onto the back of input list. Again, this only makes sense for filters that single type of input.
Other uses are also possible. For a single input filter, pushing and popping inputs allow the application to temporarily replace an input to a filter.
Reimplemented from itk::ProcessObject.
|
virtual |
Push/Pop the input of this process object. These methods allow a filter to model its input vector as a queue or stack. These routines may not be appropriate for all filters, especially filters with different types of inputs. These routines follow the semantics of STL.
The routines are useful for applications that need to process "rolling" sets of images. For instance, if an application has 10 images and they need to run a filter on images 1, 2, 3, 4, then run the filter on images 2, 3, 4, 5, then run the filter on images 3, 4, 5, 6, the application can accomplish this by popping an input off the front of the input list and push a new image onto the back of input list. Again, this only makes sense for filters that single type of input.
Other uses are also possible. For a single input filter, pushing and popping inputs allow the application to temporarily replace an input to a filter.
|
inlineoverrideprotectedvirtual |
PushBackInput(), PushFrontInput() in the public section force the input to be the type expected by an ImageTransformer. However, these methods end up "hiding" the versions from the superclass (ProcessObject) whose arguments are DataObjects. Here, we re-expose the versions from ProcessObject to avoid warnings about hiding methods from the superclass. NOTE: The same code resides in ImageToImageFilter
Reimplemented from itk::ProcessObject.
Definition at line 239 of file itkImageTransformer.h.
|
virtual |
Push/Pop the input of this process object. These methods allow a filter to model its input vector as a queue or stack. These routines may not be appropriate for all filters, especially filters with different types of inputs. These routines follow the semantics of STL.
The routines are useful for applications that need to process "rolling" sets of images. For instance, if an application has 10 images and they need to run a filter on images 1, 2, 3, 4, then run the filter on images 2, 3, 4, 5, then run the filter on images 3, 4, 5, 6, the application can accomplish this by popping an input off the front of the input list and push a new image onto the back of input list. Again, this only makes sense for filters that single type of input.
Other uses are also possible. For a single input filter, pushing and popping inputs allow the application to temporarily replace an input to a filter.
|
inlineoverrideprotectedvirtual |
PushBackInput(), PushFrontInput() in the public section force the input to be the type expected by an ImageTransformer. However, these methods end up "hiding" the versions from the superclass (ProcessObject) whose arguments are DataObjects. Here, we re-expose the versions from ProcessObject to avoid warnings about hiding methods from the superclass. NOTE: The same code resides in ImageToImageFilter
Reimplemented from itk::ProcessObject.
Definition at line 241 of file itkImageTransformer.h.
|
virtual |
|
virtual |
|
protectedvirtual |
Split the input's RequestedRegion into "num" pieces, returning region "i" as "splitRegion". This method is called "num" times. The regions must not overlap. The method returns the number of pieces that the routine is capable of splitting the input RequestedRegion, i.e. return value is less than or equal to "num".
|
protectedvirtual |
If an imaging filter can be implemented as a multithreaded algorithm, the filter will provide an implementation of ThreadedGenerateData(). This superclass will automatically split the output image into a number of pieces, spawn multiple threads, and call ThreadedGenerateData() in each thread. Prior to spawning threads, the BeforeThreadedGenerateData() method is called. After all the threads have completed, the AfterThreadedGenerateData() method is called. If an image processing filter cannot support threading, that filter should provide an implementation of the GenerateData() method instead of providing an implementation of ThreadedGenerateData(). If a filter provides a GenerateData() method as its implementation, then the filter is responsible for allocating the output data. If a filter provides a ThreadedGenerateData() method as its implementation, then the output memory will allocated automatically by this superclass. The ThreadedGenerateData() method should only produce the output specified by "inputThreadRegion" parameter. ThreadedGenerateData() cannot write to any other portion of the output image (as this is responsibility of a different thread).
|
staticprotected |
Static function used as a "callback" by the MultiThreader. The threading library will call this routine for each thread, which will delegate the control to ThreadedGenerateData().
|
static |
ImageDimension constant
Definition at line 83 of file itkImageTransformer.h.