View Issue Details

IDProjectCategoryView StatusLast Update
0004600Slicer4Core: Renderingpublic2018-10-01 18:26
ReporterjcfrAssigned Toallison.vacanti 
PrioritynormalSeverityminorReproducibilityhave not tried
Status resolvedResolutionfixed 
Product Version 
Target VersionSlicer 4.9.0Fixed in VersionSlicer 4.9.0 
Summary0004600: VTK OpenGL2 Backend: Toggling surface smoothing hide/show GPU volume rendering instead of effectively updating the smoothing
Description

Using the latest version of VTK (based of kitware/VTK@6b3c41c).

This was observer with or without replacing QVTKOpenGLWidget by QVTKOpenGLSimpleWidget in CTK

Considering that 0004598 is still pending, it is not clear what is the root cause of the problem. That said, I wanted to document my observation.

TagsNo tags attached.

Relationships

related to 0004615 resolvedjcfr VTK OpenGL2 Backend: Warnings about error in cache state for GL_SCISSOR_TEST 

Activities

jcfr

jcfr

2018-08-29 11:15

administrator   ~0015982

I confirm that this regression is independent of 0004598, @allison.vacanti would you be able to help address this ?

allison.vacanti

allison.vacanti

2018-08-29 12:01

developer   ~0015983

Sure, I can take a look next week as long as I can still charge the same project as last time.

Can you provide some more details about the bug? I'm not sure what is meant by surface smoothing.

jcfr

jcfr

2018-08-29 12:36

administrator   ~0015984

To put things in context, toggling the "Surface smoothing" option was added in Slicer in here and is available only with GPU mapper and only when the quality is set to Maximum.

Here is the corresponding code ...

void vtkMRMLVolumeRenderingDisplayableManager
::UpdateGPURaycastMapper(
  vtkGPUVolumeRayCastMapper* mapper,
  vtkMRMLGPURayCastVolumeRenderingDisplayNode* vspNode)
{
  this->UpdateMapper(mapper, vspNode);
  const bool maximumQuality = vspNode->GetPerformanceControl() ==
    vtkMRMLVolumeRenderingDisplayNode::MaximumQuality;
  if (maximumQuality)
    {
    mapper->SetAutoAdjustSampleDistances(0);
    mapper->SetLockSampleDistanceToInputSpacing(0);
    mapper->SetUseJittering(0);
    }
  else
    {
    const bool lockSampleDistance = (bool)vspNode->GetLockSampleDistanceToInputSpacing();
    // AutoAdjustSampleDistances disables LockSampleDistanceToInputSpacing, so if
    // LockSampleDistanceToInputSpacing is on then disable AutoAdjustSampleDistances
    mapper->SetAutoAdjustSampleDistances(maximumQuality || lockSampleDistance ? 0 : 1);
    mapper->SetLockSampleDistanceToInputSpacing(lockSampleDistance);
    mapper->SetUseJittering(vspNode->GetUseJittering());
    }
  mapper->SetSampleDistance(this->GetSampleDistance(vspNode));
  mapper->SetImageSampleDistance(1.0);
  mapper->SetMaxMemoryInBytes(this->GetMaxMemoryInBytes(mapper, vspNode));

  switch(vspNode->GetRaycastTechnique())
    {
    case vtkMRMLVolumeRenderingDisplayNode::MaximumIntensityProjection:
      mapper->SetBlendMode(vtkVolumeMapper::MAXIMUM_INTENSITY_BLEND);
      break;
    case vtkMRMLVolumeRenderingDisplayNode::MinimumIntensityProjection:
      mapper->SetBlendMode(vtkVolumeMapper::MINIMUM_INTENSITY_BLEND);
      break;
    case vtkMRMLVolumeRenderingDisplayNode::Composite:
    default:
      mapper->SetBlendMode(vtkVolumeMapper::COMPOSITE_BLEND);
      break;
    }
}
allison.vacanti

allison.vacanti

2018-09-04 13:38

developer   ~0015985

I'm having trouble reproducing this one -- jittering works as expected in VTK tests.

Is this consistently reproducible, or only happening on some datasets? What are the other parameters used on the mapper, and the dimensions of the volume?

mapper->Print(std::cout) should give a nice summary of the mapper settings.

lassoan

lassoan

2018-09-13 11:02

developer   ~0016003

Last edited: 2018-09-13 11:13

View 2 revisions

I can consistently reproduce it using latest nightly version of Slicer on Windows.

How to test:

  • Load CTChest sample data set
  • In Volume rendering module, show volume using GPU volume rendering
  • Check Surface smoothing checkbox => surface smoothing is enabled
  • Uncheck Surface smoothing checkbox => ERROR: volume disappeared!
  • Check Surface smoothing checkbox => volume reappeared

For reference, current code that enables/disables jittering is here. I don't see anything messy or suspicious there and this used to work well before the VTK update (there was no change in Slicer related to this).

allison.vacanti

allison.vacanti

2018-09-18 15:18

developer   ~0016026

I've downloaded the nightly (linux version), but can't seem to get the volume to appear at all. I assume it should show up in the upper right renderer?

What I did was:

  1. Download Sample Data > CTChest. Image slices show up, volume outline + labels appear, but no actual volume.
  2. Modules > Volume Rendering, still no volume.
  3. Rendering > VTK GPU Ray Cast, no volume.
  4. Advanced > Techniques > Surface smoothing, no volume either way.

I played around with the other settings and couldn't get anything to appear, even with the CPU ray caster. Did I miss a step somewhere?

allison.vacanti

allison.vacanti

2018-09-18 16:31

developer   ~0016027

JC helped me get it working -- I can now reproduce this and will see what I can find.

lassoan

lassoan

2018-09-19 01:18

developer   ~0016032

I don't know if this might be related, but when I build latest Slicer in debug mode then these errors are logged (this is new, this did not happen before we switched to latest VTK):

[WARNING][VTK] 19.09.2018 01:16:05 [] (unknown:0) - Generic Warning: In C:\D\S4D\VTKv9\Rendering\OpenGL2\vtkOpenGLState.cxx, line 138
Error in cache state for GL_SCISSOR_TEST
[WARNING][VTK] 19.09.2018 01:16:05 [] (unknown:0) - Generic Warning: In C:\D\S4D\VTKv9\Rendering\OpenGL2\vtkOpenGLState.cxx, line 229
at stack loc
at vtkOpenGLState::CheckState in c:\d\s4d\vtkv9\rendering\opengl2\vtkopenglstate.cxx line 228
at vtkOpenGLState::SetEnumState in c:\d\s4d\vtkv9\rendering\opengl2\vtkopenglstate.cxx line 552
at vtkOpenGLState::vtkglDisable in c:\d\s4d\vtkv9\rendering\opengl2\vtkopenglstate.cxx line 821
at QVTKOpenGLNativeWidget::paintGL in c:\d\s4d\vtkv9\guisupport\qt\qvtkopenglnativewidget.cxx line 534
SymGetLineFromAddr64 returned error code 487
at QLabel::setNum
SymGetLineFromAddr64 returned error code 487
at QLabel::setNum
SymGetLineFromAddr64 returned error code 487
at QLabel::setNum
SymGetLineFromAddr64 returned error code 487
at QLabel::setNum
SymGetLineFromAddr64 returned error code 487
at QLabel::setNum
at QVTKOpenGLNativeWidget::event in c:\d\s4d\vtkv9\guisupport\qt\qvtkopenglnativewidget.cxx line 696
SymGetLineFromAddr64 returned error code 487
at QLabel::setNum
SymGetLineFromAddr64 returned error code 487
at QLabel::setNum
at qSlicerApplication::notify in c:\d\s4\base\qtgui\qslicerapplication.cxx line 396
SymGetLineFromAddr64 returned error code 487
at QStringRef::toUInt
SymGetLineFromAddr64 returned error code 487
at QStringRef::toUInt
SymGetLineFromAddr64 returned error code 487
at QLabel::setNum
SymGetLineFromAddr64 returned error code 487
at QLabel::setNum
SymGetLineFromAddr64 returned error code 487
at QLabel::setNum
SymGetLineFromAddr64 returned error code 487
at QLabel::setNum
SymGetLineFromAddr64 returned error code 487
at QLabel::setNum
SymGetLineFromAddr64 returned error code 487
at QLabel::setNum
SymGetLineFromAddr64 returned error code 487
at QLabel::setNum
SymGetLineFromAddr64 returned error code 487
at QLabel::setNum
at qSlicerApplication::notify in c:\d\s4\base\qtgui\qslicerapplication.cxx line 396
SymGetLineFromAddr64 returned error code 487
at QStringRef::toUInt
SymGetLineFromAddr64 returned error code 487
at QStringRef::toUInt
SymGetLineFromAddr64 returned error code 487
at QStringRef::toUInt
SymGetLineFromAddr64 returned error code 487
at QStringRef::toUInt
SymGetLineFromAddr64 returned error code 487
at qt_plugin_query_metadata
SymGetLineFromAddr64 returned error code 487
at QStringRef::toUInt
SymGetLineFromAddr64 returned error code 487
at CallWindowProcW
SymGetLineFromAddr64 returned error code 487
at DispatchMessageW
SymGetLineFromAddr64 returned error code 487
at QStringRef::toUInt
SymGetLineFromAddr64 returned error code 487
at qt_plugin_query_metadata
SymGetLineFromAddr64 returned error code 487
at QStringRef::toUInt
SymGetLineFromAddr64 returned error code 487
at QStringRef::toUInt
SymGetLineFromAddr64 returned error code 487
at QStringRef::toUInt
SymGetLineFromAddr64 returned error code 487
at QOpenGLFunctions_3_0::glCopyConvolutionFilter2D
SymGetLineFromAddr64 returned error code 487
at QLabel::setNum
at `anonymous namespace'::SlicerAppMain in c:\d\s4\applications\slicerapp\main.cxx line 58
at main in c:\d\s4\base\qtapp\qslicerapplicationmainwrapper.cxx line 57
at invoke_main in f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl line 65
at scrt_common_main_seh in f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl line 253
at
scrt_common_main in f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl line 296
at mainCRTStartup in f:\dd\vctools\crt\vcstartup\src\startup\exe_main.cpp line 17

allison.vacanti

allison.vacanti

2018-09-19 10:25

developer   ~0016033

That looks like a separate issue from this one. Might be best to create a new bug or report it on the VTK mailing list with instructions to reproduce.

allison.vacanti

allison.vacanti

2018-09-19 17:01

developer   ~0016036

https://gitlab.kitware.com/vtk/vtk/merge_requests/4688 fixes the original bug reported in this issue for me.

lassoan

lassoan

2018-09-20 01:16

developer   ~0016037

Thank you! I confirm the proposed change fixes the issue (tested on Windows). We just need to get this integrated into VTK and update Slicer's VTK before we can close this issue.

I'll create a new issue for the GL_SCISSOR_TEST warning.

jcfr

jcfr

2018-10-01 18:26

administrator   ~0016061

Closing. Fix integrated in http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&revision=27440

Issue History

Date Modified Username Field Change
2018-08-22 12:17 jcfr New Issue
2018-08-22 12:17 jcfr Status new => assigned
2018-08-22 12:17 jcfr Assigned To => jcfr
2018-08-22 12:18 jcfr Assigned To jcfr => allison.vacanti
2018-08-22 12:21 jcfr Description Updated View Revisions
2018-08-29 11:15 jcfr Note Added: 0015982
2018-08-29 12:01 allison.vacanti Note Added: 0015983
2018-08-29 12:36 jcfr Note Added: 0015984
2018-09-04 13:38 allison.vacanti Note Added: 0015985
2018-09-13 11:02 lassoan Note Added: 0016003
2018-09-13 11:13 lassoan Note Edited: 0016003 View Revisions
2018-09-18 15:18 allison.vacanti Note Added: 0016026
2018-09-18 16:31 allison.vacanti Note Added: 0016027
2018-09-19 01:18 lassoan Note Added: 0016032
2018-09-19 10:25 allison.vacanti Note Added: 0016033
2018-09-19 17:01 allison.vacanti Note Added: 0016036
2018-09-20 01:16 lassoan Note Added: 0016037
2018-09-20 01:28 lassoan Relationship added related to 0004615
2018-10-01 18:26 jcfr Status assigned => resolved
2018-10-01 18:26 jcfr Resolution open => fixed
2018-10-01 18:26 jcfr Fixed in Version => Slicer 4.9.0
2018-10-01 18:26 jcfr Note Added: 0016061