Page MenuHomePhabricator

a vtk error occurs when a plane is rotated and the crosshair is moved
Closed, ResolvedPublic

Description

Open an image, rotate one of the planes and then move the crosshair.
Vtk produces the following error in the vtkOutputWindow:

ERROR: In ..\..\CMakeExternals\Source\VTK\Filtering\vtkStreamingDemandDrivenPipeline.cxx, line 878
vtkStreamingDemandDrivenPipeline (000000000CE0DBD0): The update extent specified in the information for output port 0 on algorithm vtkImageReslice(000000000C8AE2C0) is -3 261 0 48 0 0, which is outside the whole extent -2 261 0 48 0 0.

The error only occurs if one or more planes are rotated.

Event Timeline

Hello team,

The same issue happens when the "slice thickness" slider is sent back to the beginning (TS = 1) on any render window; but no at start up, when TS equals 1 by default.

Let me know if I can be of any help

thanks
sebastian

the problem should be around lines 439-452, mitkImageVtkMapper2D.cpp

if(thickSlicesMode > 0)

{
  dataZSpacing = 1.0 / normInIndex.GetNorm();
  localStorage->m_Reslicer->SetOutputDimensionality( 3 );
  localStorage->m_Reslicer->SetOutputExtent( xMin, xMax-1, yMin, yMax-1, -thickSlicesNum, 0+thickSlicesNum );
}
else
{
  localStorage->m_Reslicer->SetOutputDimensionality( 2 );
  localStorage->m_Reslicer->SetOutputExtent( xMin, xMax-1, yMin, yMax-1, 0, 0 );
}

Hi Sebastian,

the problem is the calculation of the four values xMin, xMax, yMin, and yMax. For some reason these values exceed the vtk volume in some cases. I checked the computation during our last bugsquashing, yet i could not find any mistake.

I figured out a very strange behavior. Try to imagine a cake with 8 pieces. If you load an image and rotate the crosshair in the transversal slice clock-wisely, the warnings do appear in 4 of the 8 pieces. If you rotate it counter-clock-wisely, the warnings will appear in the other 4 of the 8 pieces. I have no idea about the source of this behavior.

I dont even know the source. There are two possibilies:

  1. The computation is wrong, there could be some error related to the 0.5 pixel offset for images or something like that. However, this error can be anywhere starting from interaction over geometries to the image mapper.
  2. The input of the geometries is set wrong. There could be a small problem in the interaction which sets the values a little bit wrong.

Let me know if you find out anything else. I assume that all warnings are caused by the same source. So it does not matter if you use thick slices or rotation/swivil mode.

Basti and I think that setting the extent is not necessary at all, since we want always the maximum extent (the default setting of the vtkImageReslice). Hence, we removed the line:
"localStorage->m_Reslicer->SetOutputExtent( xMin, xMax-1, yMin, yMax-1, 0, 0 );"

Unfortunately, some site effects occur. Neither, the spacing is correct and not the rotation/swivil mode. We removed further settings of the vtkImageReslice, including the vtkImageChangeInformation filter.
Everything seems to work, except the rotatio/swivil mode, which looks a bit distorted.

I pushed our changes to: bug-10265-VTKErrorsInRotation.

I think we can get rid of a lot of code in the image mapper and will still have the perfect result, but we need to investigate more in the correct usage of the vtkImageReslice.

Postponed until the reslicing of Tobias is finished.

There were actually two vtk errors.

And yes, they are fixed with T10860.

  1. If a segmentation was created and you rotated one of the planes, an error occured saying some pixels are not in memory. This was related to the CreateOutlinePolyData method in mitkImageVtkMapper2D which draws the red outlines for marked pixels. The method did not consider the bounds of the 2D image, indices had hard coded start values.
  1. The message was something like 'updateExtent out of wholeExtent'. Just updated the wholeExtent for GenerateData(), because it seemed to be one step behind updateExtent.