what does this->ProcessObject::SetNthInput() mean?

I’m reading a simple code to know how itk work.https://itk.org/ITKExamples/src/Filtering/ImageGrid/ShrinkImage/Documentation.html.

When I look for what the ‘shrinkFilter->SetInput(image)’ method calls, I found something like this

template< typename TInputImage, typename TOutputImage >
ImageToImageFilter< TInputImage, TOutputImage >
::SetInput(const InputImageType *input)
  // Process object is not const-correct so the const_cast is required here
  this->ProcessObject::SetNthInput( 0,
                                    const_cast< InputImageType * >( input ) );

in itkImageToImageFilter.hxx.

I don’t know what this->ProcessObject::SetNthInput means, doesn’t this-> should point a method belong to itself? Why it points a static method?

SetNthInput is a virtual method, and this->ProcessObject::SetNthInput means invoke ProcessObject's version of SetNthInput, not mine (ProcessObject being a ancestor of this class).

1 Like