vtkResliceImageViewer Mode Oblique bug

Hello,

I am using VTK 9.2 on windows 10 with MSVC 2019 with the code :

    vtkObject::GlobalWarningDisplayOff();
    vtkOpenGLRenderWindow::SetGlobalMaximumNumberOfMultiSamples(0);
    std::string inputFilename = "C:\\Lib\\I0";

    vtkNew<vtkDICOMImageReader> reader;
    reader->SetFileName(inputFilename.c_str());
    reader->Update();

    vtkNew<vtkResliceImageViewer> imageViewer;
    imageViewer->SetInputData(reader->GetOutput());
    vtkNew<vtkRenderWindowInteractor> renderWindowInteractor;
    imageViewer->SetupInteractor(renderWindowInteractor);
    imageViewer->SetResliceModeToOblique();

    imageViewer->Render();
    imageViewer->GetRenderer()->ResetCamera();
    imageViewer->Render();

    renderWindowInteractor->Start();

But I have the following error when I try to do a render :

Run-Time Check Failure #2 - Stack around the variable ‘worldFocalPoint’ was corrupted.

Here is the stack trace :
image

Any ideas how to solve this problem ? This code works on macOS and the problem only occurs if I enable the oblique mode.

Thank you for your help.

do you solve this prolem now?

Yes

Nicolas,

I’'m having the same problem - could you care to elaborate as to how you resolved it?

thank you in advance

I don’t know if this will work for someone…but my problem was related with anything which implies “SetResliceModeToOblique()” or ResliceCursorWidget.
Downgrade from VTK9 to VTK8 works for me (not perfect, but its functional).

I observed this bug, which has been fixed now, but it hasn’t been released in the latest official version (v9.2.6) yet.
Here is the closed issus
https://gitlab.kitware.com/vtk/vtk/-/issues/18716