template<typename TInputImage, typename TOutputImage, typename TInputFilter = ImageToImageFilter<Image<typename TInputImage::PixelType, TInputImage::ImageDimension - 1>, Image<typename TOutputImage::PixelType, TOutputImage::ImageDimension - 1>>, class TOutputFilter = typename TInputFilter::Superclass, class TInternalInputImage = typename TInputFilter::InputImageType, class TInternalOutputImage = typename TOutputFilter::OutputImageType>
class itk::SliceBySliceImageFilter< TInputImage, TOutputImage, TInputFilter, TOutputFilter, TInternalInputImage, TInternalOutputImage >
Apply a filter or a pipeline slice by slice on an image.
SliceBySliceImageFilter let the user apply a filter or a pipeline of filters on the slices of an image. The filters must work on images smaller of one dimension than the input and output images of the SliceBySliceImageFilter - if the SliceBySliceImageFilter work on 3D images, the filters used internally must work on 2D images.
The dimension along which the slices are extracted can be selected with SetDimension() and defaults to the last one.
SliceBySliceImageFilter takes the input and the output filters of a pipeline as parameter. They can be set with SetInputFilter() and SetOutputFilter(). The pipeline will be run once per slice.
If there is only one filter to apply to the slices of the input image, the SetFilter() method can be used to set the filter passed as parameter both as the input and as the output filter.
SliceBySliceImageFilter can take several images as input. In that case, the same number of slices will be passed to the input filter. If the output filter produce several output slices, SliceBySliceImageFilter produce the same number of output images. The input images are passed with the same input number to the input filter - if SetInput( 3, img ) is used on the SliceBySliceImageFilter the corresponding slice will be passed to the input filter with SetInput( 3, img ). See https://www.itk.org/pipermail/insight-users/2008-May/026112.html for an example of usage of that feature with MaskImageFilter.
The input requested region is enlarged to cover whole slices, but not in the slice direction - however, the internal pipeline only requests the output requested region for that slice (the requested region per slice is not enlarged to the whole slice unless done by the internal filters ).
The output images of SliceBySliceImageFilter must be of the same size than the input images. All the input images must be of the same pixel type. All the output images must be of the same pixel type.
- Author
- Gaetan Lehmann
This class was taken from the Insight Journal paper: https://doi.org/10.54294/47329s
Definition at line 81 of file itkSliceBySliceImageFilter.h.
|
void | GenerateData () override |
|
void | GenerateInputRequestedRegion () override |
|
void | PrintSelf (std::ostream &os, Indent indent) const override |
|
| SliceBySliceImageFilter () |
|
void | VerifyInputInformation () const override |
|
| ~SliceBySliceImageFilter () override=default |
|
virtual void | CallCopyInputRegionToOutputRegion (OutputImageRegionType &destRegion, const InputImageRegionType &srcRegion) |
|
virtual void | CallCopyOutputRegionToInputRegion (InputImageRegionType &destRegion, const OutputImageRegionType &srcRegion) |
|
void | GenerateInputRequestedRegion () override |
|
| ImageToImageFilter () |
|
void | PrintSelf (std::ostream &os, Indent indent) const override |
|
void | VerifyInputInformation () const override |
|
| ~ImageToImageFilter () override=default |
|
virtual void | PushBackInput (const DataObject *input) |
|
virtual void | PushFrontInput (const DataObject *input) |
|
virtual void | AfterThreadedGenerateData () |
|
virtual void | AllocateOutputs () |
|
virtual void | BeforeThreadedGenerateData () |
|
void | ClassicMultiThread (ThreadFunctionType callbackFunction) |
|
void | GenerateData () override |
|
virtual const ImageRegionSplitterBase * | GetImageRegionSplitter () const |
|
| ImageSource () |
|
void | PrintSelf (std::ostream &os, Indent indent) const override |
|
virtual unsigned int | SplitRequestedRegion (unsigned int i, unsigned int pieces, OutputImageRegionType &splitRegion) |
|
| ~ImageSource () override=default |
|
virtual void | ThreadedGenerateData (const OutputImageRegionType ®ion, ThreadIdType threadId) |
|
virtual void | DynamicThreadedGenerateData (const OutputImageRegionType &outputRegionForThread) |
|
virtual bool | GetDynamicMultiThreading () const |
|
virtual void | SetDynamicMultiThreading (bool _arg) |
|
virtual void | DynamicMultiThreadingOn () |
|
virtual void | AddInput (DataObject *input) |
|
void | AddOptionalInputName (const DataObjectIdentifierType &) |
|
void | AddOptionalInputName (const DataObjectIdentifierType &, DataObjectPointerArraySizeType idx) |
|
virtual void | AddOutput (DataObject *output) |
|
bool | AddRequiredInputName (const DataObjectIdentifierType &) |
|
bool | AddRequiredInputName (const DataObjectIdentifierType &, DataObjectPointerArraySizeType idx) |
|
virtual void | CacheInputReleaseDataFlags () |
|
virtual void | GenerateData () |
|
virtual void | GenerateInputRequestedRegion () |
|
virtual void | GenerateOutputInformation () |
|
virtual void | GenerateOutputRequestedRegion (DataObject *output) |
|
DataObject * | GetInput (const DataObjectIdentifierType &key) |
|
const DataObject * | GetInput (const DataObjectIdentifierType &key) const |
|
virtual const DataObjectPointerArraySizeType & | GetNumberOfRequiredInputs () const |
|
virtual const DataObjectPointerArraySizeType & | GetNumberOfRequiredOutputs () const |
|
bool | IsIndexedInputName (const DataObjectIdentifierType &) const |
|
bool | IsIndexedOutputName (const DataObjectIdentifierType &) const |
|
bool | IsRequiredInputName (const DataObjectIdentifierType &) const |
|
DataObjectPointerArraySizeType | MakeIndexFromInputName (const DataObjectIdentifierType &name) const |
|
DataObjectPointerArraySizeType | MakeIndexFromOutputName (const DataObjectIdentifierType &name) const |
|
DataObjectIdentifierType | MakeNameFromInputIndex (DataObjectPointerArraySizeType idx) const |
|
DataObjectIdentifierType | MakeNameFromOutputIndex (DataObjectPointerArraySizeType idx) const |
|
virtual void | PopBackInput () |
|
virtual void | PopFrontInput () |
|
void | PrintSelf (std::ostream &os, Indent indent) const override |
|
| ProcessObject () |
|
virtual void | PropagateResetPipeline () |
|
virtual void | PushBackInput (const DataObject *input) |
|
virtual void | PushFrontInput (const DataObject *input) |
|
virtual void | ReleaseInputs () |
|
virtual void | RemoveInput (const DataObjectIdentifierType &key) |
|
virtual void | RemoveInput (DataObjectPointerArraySizeType) |
|
virtual void | RemoveOutput (const DataObjectIdentifierType &key) |
|
virtual void | RemoveOutput (DataObjectPointerArraySizeType idx) |
|
bool | RemoveRequiredInputName (const DataObjectIdentifierType &) |
|
virtual void | RestoreInputReleaseDataFlags () |
|
virtual void | SetInput (const DataObjectIdentifierType &key, DataObject *input) |
|
virtual void | SetNthInput (DataObjectPointerArraySizeType idx, DataObject *input) |
|
virtual void | SetNthOutput (DataObjectPointerArraySizeType idx, DataObject *output) |
|
void | SetNumberOfIndexedInputs (DataObjectPointerArraySizeType num) |
|
void | SetNumberOfIndexedOutputs (DataObjectPointerArraySizeType num) |
|
virtual void | SetNumberOfRequiredInputs (DataObjectPointerArraySizeType) |
|
virtual void | SetNumberOfRequiredOutputs (DataObjectPointerArraySizeType _arg) |
|
virtual void | SetOutput (const DataObjectIdentifierType &name, DataObject *output) |
|
virtual void | SetPrimaryInput (DataObject *object) |
|
virtual void | SetPrimaryOutput (DataObject *object) |
|
void | SetRequiredInputNames (const NameArray &) |
|
virtual void | VerifyInputInformation () const |
|
virtual void | VerifyPreconditions () const |
|
| ~ProcessObject () override |
|
DataObject * | GetInput (DataObjectPointerArraySizeType idx) |
|
const DataObject * | GetInput (DataObjectPointerArraySizeType idx) const |
|
DataObject * | GetPrimaryInput () |
|
const DataObject * | GetPrimaryInput () const |
|
virtual void | SetPrimaryInputName (const DataObjectIdentifierType &key) |
|
virtual const char * | GetPrimaryInputName () const |
|
DataObject * | GetOutput (const DataObjectIdentifierType &key) |
|
const DataObject * | GetOutput (const DataObjectIdentifierType &key) const |
|
virtual void | SetPrimaryOutputName (const DataObjectIdentifierType &key) |
|
virtual const char * | GetPrimaryOutputName () const |
|
DataObject * | GetOutput (DataObjectPointerArraySizeType i) |
|
const DataObject * | GetOutput (DataObjectPointerArraySizeType i) const |
|
DataObject * | GetPrimaryOutput () |
|
const DataObject * | GetPrimaryOutput () const |
|
virtual bool | GetThreaderUpdateProgress () const |
|
virtual void | ThreaderUpdateProgressOn () |
|
virtual void | SetThreaderUpdateProgress (bool arg) |
|
| Object () |
|
bool | PrintObservers (std::ostream &os, Indent indent) const |
|
void | PrintSelf (std::ostream &os, Indent indent) const override |
|
virtual void | SetTimeStamp (const TimeStamp &timeStamp) |
|
| ~Object () override |
|
virtual LightObject::Pointer | InternalClone () const |
|
| LightObject () |
|
virtual void | PrintHeader (std::ostream &os, Indent indent) const |
|
virtual void | PrintSelf (std::ostream &os, Indent indent) const |
|
virtual void | PrintTrailer (std::ostream &os, Indent indent) const |
|
virtual | ~LightObject () |
|
template<typename TInputImage , typename TOutputImage , typename TInputFilter = ImageToImageFilter<Image<typename TInputImage::PixelType, TInputImage::ImageDimension - 1>, Image<typename TOutputImage::PixelType, TOutputImage::ImageDimension - 1>>, class TOutputFilter = typename TInputFilter::Superclass, class TInternalInputImage = typename TInputFilter::InputImageType, class TInternalOutputImage = typename TOutputFilter::OutputImageType>
void itk::SliceBySliceImageFilter< TInputImage, TOutputImage, TInputFilter, TOutputFilter, TInternalInputImage, TInternalOutputImage >::GenerateInputRequestedRegion |
( |
| ) |
|
|
overrideprotectedvirtual |
What is the input requested region that is required to produce the output requested region? The base assumption for image processing filters is that the input requested region can be set to match the output requested region. If a filter requires more input (for instance a filter that uses neighborhoods needs more input than output to avoid introducing artificial boundary conditions) or less input (for instance a magnify filter) will have to override this method. In doing so, it should call its superclass' implementation as its first step. Note that imaging filters operate differently than the classes to this point in the class hierarchy. Up till now, the base assumption has been that the largest possible region will be requested of the 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.
- See also
- ProcessObject::GenerateInputRequestedRegion(), ImageSource::GenerateInputRequestedRegion()
Reimplemented from itk::ImageToImageFilter< TInputImage, TOutputImage >.
template<typename TInputImage , typename TOutputImage , typename TInputFilter = ImageToImageFilter<Image<typename TInputImage::PixelType, TInputImage::ImageDimension - 1>, Image<typename TOutputImage::PixelType, TOutputImage::ImageDimension - 1>>, class TOutputFilter = typename TInputFilter::Superclass, class TInternalInputImage = typename TInputFilter::InputImageType, class TInternalOutputImage = typename TOutputFilter::OutputImageType>
void itk::SliceBySliceImageFilter< TInputImage, TOutputImage, TInputFilter, TOutputFilter, TInternalInputImage, TInternalOutputImage >::VerifyInputInformation |
( |
| ) |
const |
|
overrideprotectedvirtual |
Verifies that the input images occupy the same physical space and the each index is at the same physical location.
The default implementation of the PropagateRequestedRegion() methods copies the index and size from the output to the input. This makes an implicit assumption that the images occupy the same physical location at each voxel. This method enforces that they are the same.
This implementation verifies that all input images of InputImageDimensions have the same origin, spacing and direction.
Filters which do not expect all input images to be at the same physical location should over-ride this method. Also filters whose inputs are different dimensions may need to override this method.
- See also
- ProcessObject::VerifyInputInformation
Reimplemented from itk::ImageToImageFilter< TInputImage, TOutputImage >.