#include <itkObjectByObjectLabelMapFilter.h>
ObjectByObjectLabelMapFilter applies an image pipeline to all the objects of a label map and produce a new label map.
The image pipeline can simply produce a modified object or produce several objects from the single input object. Several options are provided to handle the different cases.
KeepLabel, which defaults to true, makes the filter try to keep as much as possible the labels of the original objects. If an image pipeline produce several objects the label of the input object is assigned to the first output object. The other output objects get another label not present in the input image. When KeepLabel is set to false, all the objects are relabeled in the order of apparition during the filter process.
BinaryInternalOutput can be set to true if the image pipeline produce binary output image. In that case, the objects produced are identified with a connected component algorithm before being reinserted in the output label map. InternalForegroundValue can be set to a specific value which represent the foreground value in the binary image.
PadSize and ConstrainPaddingToImage can be used to extend the size of the image to process passed to the image pipeline. This is useful if the image pipeline is known to be able to enlarge the object. The padding can be constrained to the input label map region by setting ConstrainPaddingToImage to true - this parameter can make a difference for the algorithm with a different behavior on the border of the image. By default, the image is padded by 1 pixel and constrained to the image region.
This implementation was taken from the Insight Journal paper: https://doi.org/10.54294/q6auw4
Definition at line 86 of file itkObjectByObjectLabelMapFilter.h.
Public Types | |
using | ConstPointer = SmartPointer<const Self> |
using | InputFilterType = TInputFilter |
using | InputImageConstPointer = typename InputImageType::ConstPointer |
using | InputImagePixelType = typename InputImageType::PixelType |
using | InputImagePointer = typename InputImageType::Pointer |
using | InputImageRegionType = typename InputImageType::RegionType |
using | InputImageType = TInputImage |
using | InternalIndexType = typename InternalInputImageType::IndexType |
using | InternalInputImageType = TInternalInputImage |
using | InternalInputPixelType = typename InternalInputImageType::PixelType |
using | InternalOffsetType = typename InternalInputImageType::OffsetType |
using | InternalOutputImageType = TInternalOutputImage |
using | InternalOutputPixelType = typename InternalOutputImageType::PixelType |
using | InternalRegionType = typename InternalInputImageType::RegionType |
using | InternalSizeType = typename InternalInputImageType::SizeType |
using | LabelMapType = OutputImageType |
using | LabelObjectType = typename LabelMapType::LabelObjectType |
using | OutputFilterType = TOutputFilter |
using | OutputImageConstPointer = typename OutputImageType::ConstPointer |
using | OutputImagePixelType = typename OutputImageType::PixelType |
using | OutputImagePointer = typename OutputImageType::Pointer |
using | OutputImageRegionType = typename OutputImageType::RegionType |
using | OutputImageType = TOutputImage |
using | Pointer = SmartPointer<Self> |
using | Self = ObjectByObjectLabelMapFilter |
using | SizeType = typename OutputImageType::SizeType |
using | Superclass = LabelMapFilter<TInputImage, TOutputImage> |
![]() | |
using | ConstPointer |
using | ConstPointer |
typedef typename InputImageType::ConstPointer | InputImageConstPointer |
using | InputImageConstPointer |
typedef typename InputImageType::PixelType | InputImagePixelType |
using | InputImagePixelType |
typedef typename InputImageType::Pointer | InputImagePointer |
using | InputImagePointer |
typedef typename InputImageType::RegionType | InputImageRegionType |
using | InputImageRegionType |
typedef TInputImage | InputImageType |
using | InputImageType |
using | LabelObjectType |
using | LabelObjectType |
using | OutputImageConstPointer |
using | OutputImageConstPointer |
using | OutputImagePixelType |
using | OutputImagePixelType |
using | OutputImagePointer |
using | OutputImagePointer |
using | OutputImageRegionType |
using | OutputImageRegionType |
using | OutputImageType |
using | OutputImageType |
using | Pointer |
using | Pointer |
using | Self |
using | Self |
using | Superclass |
using | Superclass |
![]() | |
using | ConstPointer |
using | InputImageConstPointer |
using | InputImagePixelType |
using | InputImagePointer |
using | InputImageRegionType |
using | InputImageType |
typedef typename OutputImageType::PixelType | OutputImagePixelType |
using | OutputImagePixelType |
typedef typename OutputImageType::RegionType | OutputImageRegionType |
using | OutputImageRegionType |
using | Pointer |
using | Self |
using | Superclass |
![]() | |
using | ConstPointer |
using | DataObjectIdentifierType |
using | DataObjectPointer |
using | DataObjectPointerArraySizeType |
using | OutputImagePixelType |
using | OutputImagePointer |
using | OutputImageRegionType |
using | OutputImageType |
using | Pointer |
using | Self |
using | Superclass |
![]() | |
using | ConstPointer = SmartPointer<const Self> |
using | DataObjectIdentifierType = DataObject::DataObjectIdentifierType |
using | DataObjectPointer = DataObject::Pointer |
using | DataObjectPointerArray = std::vector<DataObjectPointer> |
using | DataObjectPointerArraySizeType = DataObjectPointerArray::size_type |
using | MultiThreaderType = MultiThreaderBase |
using | NameArray = std::vector<DataObjectIdentifierType> |
using | Pointer = SmartPointer<Self> |
using | Self = ProcessObject |
using | Superclass = Object |
![]() | |
using | ConstPointer = SmartPointer<const Self> |
using | Pointer = SmartPointer<Self> |
using | Self = Object |
using | Superclass = LightObject |
![]() | |
using | ConstPointer = SmartPointer<const Self> |
using | Pointer = SmartPointer<Self> |
using | Self = LightObject |
Static Public Attributes | |
static constexpr unsigned int | ImageDimension = TOutputImage::ImageDimension |
static constexpr unsigned int | InputImageDimension = TInputImage::ImageDimension |
static constexpr unsigned int | OutputImageDimension = TOutputImage::ImageDimension |
![]() | |
static constexpr unsigned int | InputImageDimension |
static constexpr unsigned int | InputImageDimension |
static constexpr unsigned int | OutputImageDimension |
static constexpr unsigned int | OutputImageDimension |
![]() | |
static constexpr unsigned int | InputImageDimension |
static constexpr unsigned int | InputImageDimension |
static constexpr unsigned int | OutputImageDimension |
static constexpr unsigned int | OutputImageDimension |
![]() | |
static constexpr unsigned int | OutputImageDimension |
Private Attributes | |
BI2LMType::Pointer | m_BI2LM {} |
bool | m_BinaryInternalOutput {} |
bool | m_ConstrainPaddingToImage {} |
CropType::Pointer | m_Crop {} |
InputFilterType::Pointer | m_InputFilter {} |
InternalOutputPixelType | m_InternalForegroundValue {} |
bool | m_KeepLabels {} |
InputImagePixelType | m_Label {} |
LI2LMType::Pointer | m_LI2LM {} |
LM2BIType::Pointer | m_LM2BI {} |
OutputFilterType::Pointer | m_OutputFilter {} |
PadType::Pointer | m_Pad {} |
SizeType | m_PadSize {} |
SelectType::Pointer | m_Select {} |
Additional Inherited Members | |
![]() | |
using | InputToOutputRegionCopierType |
using | OutputToInputRegionCopierType |
![]() | |
static const ImageRegionSplitterBase * | GetGlobalDefaultSplitter () |
static ITK_THREAD_RETURN_FUNCTION_CALL_CONVENTION | ThreaderCallback (void *arg) |
![]() | |
template<typename TSourceObject> | |
static void | MakeRequiredOutputs (TSourceObject &sourceObject, const DataObjectPointerArraySizeType numberOfRequiredOutputs) |
static constexpr float | progressFixedToFloat (uint32_t fixed) |
static uint32_t | progressFloatToFixed (float f) |
![]() | |
std::mutex | m_LabelObjectContainerLock |
std::mutex | m_LabelObjectContainerLock |
![]() | |
bool | m_DynamicMultiThreading |
![]() | |
TimeStamp | m_OutputInformationMTime {} |
bool | m_Updating {} |
![]() | |
std::atomic< int > | m_ReferenceCount {} |
|
private |
Definition at line 243 of file itkObjectByObjectLabelMapFilter.h.
using itk::ObjectByObjectLabelMapFilter< TInputImage, TOutputImage, TInputFilter, TOutputFilter, TInternalInputImage, TInternalOutputImage >::ConstPointer = SmartPointer<const Self> |
Definition at line 95 of file itkObjectByObjectLabelMapFilter.h.
|
private |
Definition at line 231 of file itkObjectByObjectLabelMapFilter.h.
using itk::ObjectByObjectLabelMapFilter< TInputImage, TOutputImage, TInputFilter, TOutputFilter, TInternalInputImage, TInternalOutputImage >::InputFilterType = TInputFilter |
Definition at line 112 of file itkObjectByObjectLabelMapFilter.h.
using itk::ObjectByObjectLabelMapFilter< TInputImage, TOutputImage, TInputFilter, TOutputFilter, TInternalInputImage, TInternalOutputImage >::InputImageConstPointer = typename InputImageType::ConstPointer |
Definition at line 101 of file itkObjectByObjectLabelMapFilter.h.
using itk::ObjectByObjectLabelMapFilter< TInputImage, TOutputImage, TInputFilter, TOutputFilter, TInternalInputImage, TInternalOutputImage >::InputImagePixelType = typename InputImageType::PixelType |
Definition at line 103 of file itkObjectByObjectLabelMapFilter.h.
using itk::ObjectByObjectLabelMapFilter< TInputImage, TOutputImage, TInputFilter, TOutputFilter, TInternalInputImage, TInternalOutputImage >::InputImagePointer = typename InputImageType::Pointer |
Definition at line 100 of file itkObjectByObjectLabelMapFilter.h.
using itk::ObjectByObjectLabelMapFilter< TInputImage, TOutputImage, TInputFilter, TOutputFilter, TInternalInputImage, TInternalOutputImage >::InputImageRegionType = typename InputImageType::RegionType |
Definition at line 102 of file itkObjectByObjectLabelMapFilter.h.
using itk::ObjectByObjectLabelMapFilter< TInputImage, TOutputImage, TInputFilter, TOutputFilter, TInternalInputImage, TInternalOutputImage >::InputImageType = TInputImage |
Some convenient type alias.
Definition at line 98 of file itkObjectByObjectLabelMapFilter.h.
using itk::ObjectByObjectLabelMapFilter< TInputImage, TOutputImage, TInputFilter, TOutputFilter, TInternalInputImage, TInternalOutputImage >::InternalIndexType = typename InternalInputImageType::IndexType |
Definition at line 118 of file itkObjectByObjectLabelMapFilter.h.
using itk::ObjectByObjectLabelMapFilter< TInputImage, TOutputImage, TInputFilter, TOutputFilter, TInternalInputImage, TInternalOutputImage >::InternalInputImageType = TInternalInputImage |
Definition at line 115 of file itkObjectByObjectLabelMapFilter.h.
using itk::ObjectByObjectLabelMapFilter< TInputImage, TOutputImage, TInputFilter, TOutputFilter, TInternalInputImage, TInternalOutputImage >::InternalInputPixelType = typename InternalInputImageType::PixelType |
Definition at line 120 of file itkObjectByObjectLabelMapFilter.h.
using itk::ObjectByObjectLabelMapFilter< TInputImage, TOutputImage, TInputFilter, TOutputFilter, TInternalInputImage, TInternalOutputImage >::InternalOffsetType = typename InternalInputImageType::OffsetType |
Definition at line 119 of file itkObjectByObjectLabelMapFilter.h.
using itk::ObjectByObjectLabelMapFilter< TInputImage, TOutputImage, TInputFilter, TOutputFilter, TInternalInputImage, TInternalOutputImage >::InternalOutputImageType = TInternalOutputImage |
Definition at line 122 of file itkObjectByObjectLabelMapFilter.h.
using itk::ObjectByObjectLabelMapFilter< TInputImage, TOutputImage, TInputFilter, TOutputFilter, TInternalInputImage, TInternalOutputImage >::InternalOutputPixelType = typename InternalOutputImageType::PixelType |
Definition at line 123 of file itkObjectByObjectLabelMapFilter.h.
using itk::ObjectByObjectLabelMapFilter< TInputImage, TOutputImage, TInputFilter, TOutputFilter, TInternalInputImage, TInternalOutputImage >::InternalRegionType = typename InternalInputImageType::RegionType |
Definition at line 116 of file itkObjectByObjectLabelMapFilter.h.
using itk::ObjectByObjectLabelMapFilter< TInputImage, TOutputImage, TInputFilter, TOutputFilter, TInternalInputImage, TInternalOutputImage >::InternalSizeType = typename InternalInputImageType::SizeType |
Definition at line 117 of file itkObjectByObjectLabelMapFilter.h.
using itk::ObjectByObjectLabelMapFilter< TInputImage, TOutputImage, TInputFilter, TOutputFilter, TInternalInputImage, TInternalOutputImage >::LabelMapType = OutputImageType |
Definition at line 109 of file itkObjectByObjectLabelMapFilter.h.
using itk::ObjectByObjectLabelMapFilter< TInputImage, TOutputImage, TInputFilter, TOutputFilter, TInternalInputImage, TInternalOutputImage >::LabelObjectType = typename LabelMapType::LabelObjectType |
Definition at line 110 of file itkObjectByObjectLabelMapFilter.h.
|
private |
Definition at line 240 of file itkObjectByObjectLabelMapFilter.h.
|
private |
Definition at line 237 of file itkObjectByObjectLabelMapFilter.h.
using itk::ObjectByObjectLabelMapFilter< TInputImage, TOutputImage, TInputFilter, TOutputFilter, TInternalInputImage, TInternalOutputImage >::OutputFilterType = TOutputFilter |
Definition at line 113 of file itkObjectByObjectLabelMapFilter.h.
using itk::ObjectByObjectLabelMapFilter< TInputImage, TOutputImage, TInputFilter, TOutputFilter, TInternalInputImage, TInternalOutputImage >::OutputImageConstPointer = typename OutputImageType::ConstPointer |
Definition at line 105 of file itkObjectByObjectLabelMapFilter.h.
using itk::ObjectByObjectLabelMapFilter< TInputImage, TOutputImage, TInputFilter, TOutputFilter, TInternalInputImage, TInternalOutputImage >::OutputImagePixelType = typename OutputImageType::PixelType |
Definition at line 107 of file itkObjectByObjectLabelMapFilter.h.
using itk::ObjectByObjectLabelMapFilter< TInputImage, TOutputImage, TInputFilter, TOutputFilter, TInternalInputImage, TInternalOutputImage >::OutputImagePointer = typename OutputImageType::Pointer |
Definition at line 104 of file itkObjectByObjectLabelMapFilter.h.
using itk::ObjectByObjectLabelMapFilter< TInputImage, TOutputImage, TInputFilter, TOutputFilter, TInternalInputImage, TInternalOutputImage >::OutputImageRegionType = typename OutputImageType::RegionType |
Definition at line 106 of file itkObjectByObjectLabelMapFilter.h.
using itk::ObjectByObjectLabelMapFilter< TInputImage, TOutputImage, TInputFilter, TOutputFilter, TInternalInputImage, TInternalOutputImage >::OutputImageType = TOutputImage |
Definition at line 99 of file itkObjectByObjectLabelMapFilter.h.
|
private |
Definition at line 234 of file itkObjectByObjectLabelMapFilter.h.
using itk::ObjectByObjectLabelMapFilter< TInputImage, TOutputImage, TInputFilter, TOutputFilter, TInternalInputImage, TInternalOutputImage >::Pointer = SmartPointer<Self> |
Definition at line 94 of file itkObjectByObjectLabelMapFilter.h.
|
private |
Definition at line 228 of file itkObjectByObjectLabelMapFilter.h.
using itk::ObjectByObjectLabelMapFilter< TInputImage, TOutputImage, TInputFilter, TOutputFilter, TInternalInputImage, TInternalOutputImage >::Self = ObjectByObjectLabelMapFilter |
Standard class type aliases.
Definition at line 92 of file itkObjectByObjectLabelMapFilter.h.
using itk::ObjectByObjectLabelMapFilter< TInputImage, TOutputImage, TInputFilter, TOutputFilter, TInternalInputImage, TInternalOutputImage >::SizeType = typename OutputImageType::SizeType |
Definition at line 108 of file itkObjectByObjectLabelMapFilter.h.
using itk::ObjectByObjectLabelMapFilter< TInputImage, TOutputImage, TInputFilter, TOutputFilter, TInternalInputImage, TInternalOutputImage >::Superclass = LabelMapFilter<TInputImage, TOutputImage> |
Definition at line 93 of file itkObjectByObjectLabelMapFilter.h.
|
protected |
Referenced by GetNameOfClass().
|
overrideprotecteddefault |
|
virtual |
Set/Get whether the internal image produced by OutputFilter should be interpreted as a binary image in which the filter have to search for connected components. If set to false, the filter consider the image as a label image. Default is false.
|
virtual |
Set/Get whether the internal image produced by OutputFilter should be interpreted as a binary image in which the filter have to search for connected components. If set to false, the filter consider the image as a label image. Default is false.
|
virtual |
Padding by PadSize will be constrained to the input image region if ConstrainPaddingToImage is true, and won't be constrained if it is set to false. Default value is true.
|
virtual |
Padding by PadSize will be constrained to the input image region if ConstrainPaddingToImage is true, and won't be constrained if it is set to false. Default value is true.
|
virtual |
Create an object from an instance, potentially deferring to a factory. This method allows you to create an instance of an object that is exactly the same type as the referring object. This is useful in cases where an object has been cast back to a base class.
Reimplemented from itk::LabelMapFilter< TInputImage, TInputImage >.
|
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 DynamicThreadedGenerateData(). 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 can be threaded, it should NOT provide a GenerateData() method but should provide a DynamicThreadedGenerateData() instead.
Reimplemented from itk::ImageSource< TInputImage >.
|
virtual |
Set/Get whether the internal image produced by OutputFilter should be interpreted as a binary image in which the filter have to search for connected components. If set to false, the filter consider the image as a label image. Default is false.
|
virtual |
Padding by PadSize will be constrained to the input image region if ConstrainPaddingToImage is true, and won't be constrained if it is set to false. Default value is true.
|
inline |
Definition at line 139 of file itkObjectByObjectLabelMapFilter.h.
References m_InputFilter.
|
inline |
Definition at line 145 of file itkObjectByObjectLabelMapFilter.h.
References m_InputFilter.
|
virtual |
|
virtual |
The foreground value used internally to represent the object in the image passed to InputFilter, and to read the data produced by OutputFilter, if BinaryInternalOutput is true
|
virtual |
If KeepLabels is set to true, the filter will do its best to reuse the labels of the input objects in the output ones. However, this is possible only if the internal pipeline produce a single object - the other labels will be taken as they come. If KeepLabels is false, no care is made of the input labels, and a new label is produced for all the objects using LabelMap::PushLabelObject().
|
virtual |
The label of the object currently processed by the filter. This is intended to be used with the IterationEvent sent before the processing of each object. It contains a relevant value only during the filter update.
|
virtual |
|
virtual |
|
overridevirtual |
Reimplemented from itk::LabelMapFilter< TInputImage, TInputImage >.
References ObjectByObjectLabelMapFilter().
|
virtual |
|
virtual |
If PadSize is not zero, the image produce for each object will be padded. The default value is 1 on all the dimensions.
|
virtual |
If KeepLabels is set to true, the filter will do its best to reuse the labels of the input objects in the output ones. However, this is possible only if the internal pipeline produce a single object - the other labels will be taken as they come. If KeepLabels is false, no care is made of the input labels, and a new label is produced for all the objects using LabelMap::PushLabelObject().
|
virtual |
If KeepLabels is set to true, the filter will do its best to reuse the labels of the input objects in the output ones. However, this is possible only if the internal pipeline produce a single object - the other labels will be taken as they come. If KeepLabels is false, no care is made of the input labels, and a new label is produced for all the objects using LabelMap::PushLabelObject().
|
static |
Standard New method.
|
overrideprotectedvirtual |
Methods invoked by Print() to print information about the object including superclasses. Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.
Reimplemented from itk::ImageToImageFilter< TInputImage, TInputImage >.
|
virtual |
Set/Get whether the internal image produced by OutputFilter should be interpreted as a binary image in which the filter have to search for connected components. If set to false, the filter consider the image as a label image. Default is false.
|
virtual |
Padding by PadSize will be constrained to the input image region if ConstrainPaddingToImage is true, and won't be constrained if it is set to false. Default value is true.
void itk::ObjectByObjectLabelMapFilter< TInputImage, TOutputImage, TInputFilter, TOutputFilter, TInternalInputImage, TInternalOutputImage >::SetFilter | ( | InputFilterType * | filter | ) |
void itk::ObjectByObjectLabelMapFilter< TInputImage, TOutputImage, TInputFilter, TOutputFilter, TInternalInputImage, TInternalOutputImage >::SetInputFilter | ( | InputFilterType * | filter | ) |
|
virtual |
The foreground value used internally to represent the object in the image passed to InputFilter, and to read the data produced by OutputFilter, if BinaryInternalOutput is true
|
virtual |
If KeepLabels is set to true, the filter will do its best to reuse the labels of the input objects in the output ones. However, this is possible only if the internal pipeline produce a single object - the other labels will be taken as they come. If KeepLabels is false, no care is made of the input labels, and a new label is produced for all the objects using LabelMap::PushLabelObject().
void itk::ObjectByObjectLabelMapFilter< TInputImage, TOutputImage, TInputFilter, TOutputFilter, TInternalInputImage, TInternalOutputImage >::SetOutputFilter | ( | OutputFilterType * | filter | ) |
|
virtual |
If PadSize is not zero, the image produce for each object will be padded. The default value is 1 on all the dimensions.
|
staticconstexpr |
Definition at line 128 of file itkObjectByObjectLabelMapFilter.h.
|
staticconstexpr |
ImageDimension constants
Definition at line 126 of file itkObjectByObjectLabelMapFilter.h.
|
private |
Definition at line 244 of file itkObjectByObjectLabelMapFilter.h.
|
private |
Definition at line 222 of file itkObjectByObjectLabelMapFilter.h.
|
private |
Definition at line 220 of file itkObjectByObjectLabelMapFilter.h.
|
private |
Definition at line 232 of file itkObjectByObjectLabelMapFilter.h.
|
private |
Definition at line 246 of file itkObjectByObjectLabelMapFilter.h.
Referenced by GetFilter(), and GetFilter().
|
private |
Definition at line 226 of file itkObjectByObjectLabelMapFilter.h.
|
private |
Definition at line 224 of file itkObjectByObjectLabelMapFilter.h.
|
private |
Definition at line 250 of file itkObjectByObjectLabelMapFilter.h.
|
private |
Definition at line 241 of file itkObjectByObjectLabelMapFilter.h.
|
private |
Definition at line 238 of file itkObjectByObjectLabelMapFilter.h.
|
private |
Definition at line 247 of file itkObjectByObjectLabelMapFilter.h.
|
private |
Definition at line 235 of file itkObjectByObjectLabelMapFilter.h.
|
private |
Definition at line 221 of file itkObjectByObjectLabelMapFilter.h.
|
private |
Definition at line 229 of file itkObjectByObjectLabelMapFilter.h.
|
staticconstexpr |
Definition at line 127 of file itkObjectByObjectLabelMapFilter.h.