Commit 8823c552 authored by David Gobbi's avatar David Gobbi

16842: Fix reslice SplitMode, Stencil incompatibility

This commit fixes #16842 for vtkImageReslice.  If GenerateStencilOutput
is On, then stencil->InsertNextExtent() is called when vtkImageReslice's
execute method completes a row, but if a row has been split among more
than one piece, the stencil will be corrupted.  It's only when SplitMode
is "Block" that this is likely to occur.  The fix used here is to detect
when rows might be split, and to adjust the split mode so that it won't
occur if GenerateStencilOutput is On.
parent cb672fe7
Pipeline #25058 passed with stage
......@@ -3191,6 +3191,20 @@ int vtkImageReslice::RequestData(
vtkInformationVector** inputVector,
vtkInformationVector* outputVector)
{
// Generation of the StencilOutput is incompatible with splitting
// along the x-axis when multithreaded, because of InsertNextExtent()
if (this->GenerateStencilOutput && this->SplitPathLength == 3)
{
if (this->SplitMode == vtkThreadedImageAlgorithm::BLOCK)
{
vtkWarningMacro("RequestData: SetSplitModeToBlock() is incompatible "
"with GenerateStencilOutputOn(). Denying any splits "
"along x-axis in order to avoid corrupt stencil!");
}
// Ensure that x-axis is never split
this->SplitPathLength = 2;
}
vtkAbstractImageInterpolator *interpolator = this->GetInterpolator();
vtkInformation* info = inputVector[0]->GetInformationObject(0);
interpolator->Initialize(info->Get(vtkDataObject::DATA_OBJECT()));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment