Setting of MarkerStyle does NOT work!

Operating system: Windows
Slicer version: 4.11.0-2009-06.23
Expected behavior: vtkMRMLPlotSeriesNode --> Marker-Style
Actual behavior: Only square works with the selection of Marker-style

Hi I am using 4.11.0 nightly version and it found that the plotting lines canNOT be set in a right way with the options of Markers Styles.

MarkerStyleCross --> shows square-shape
MarkerStylePlus --> not working
MarkerStyleSquare–> the one working only
MarkerStyleCircle --> not working
MarkerStyleDiamond --> not working

Anyone has the same issue? or a new version has fixed such problems?

Screenshots to show the issue:

image

Thanks a lot.

I’ve tested this now and it works well. You don’t see the marker because you have set the marker size to a small value line thickness to a large value.

Thanks a lot for your quick reply, Andras.

I did as you mentioned the values settings. But it’s not working. Which version are you using? maybe I need think about trying to update it.


To get a comparison:

image

Best,
Aiden

Does it work well if you create a plot using this script?

# Get a volume from SampleData and compute its histogram
import SampleData
import numpy as np
volumeNode = SampleData.SampleDataLogic().downloadMRHead()
histogram = np.histogram(arrayFromVolume(volumeNode), bins=50)

chartNode = slicer.util.plot(histogram, xColumnIndex = 1)
chartNode.SetYAxisRangeAuto(False)
chartNode.SetYAxisRange(0, 4e5)

Always use latest stable or latest preview release.

Yes, but no circles as markers there, Andras.

Here is the screenshot:


Thanks,
Aiden

PS: I just did a quick check with the newly version of 4.11.0-2019-11-05 (nightly). I got exactly the same results as mentioned in the beginning.

Does that mean something wrong (or not that right) with my computer?
Here is some basic info of my desktop:
image

I was able to reproduce the problem on one computer while it works well on another.

Can you try if it works well if you

  • open a terminal window where Slicer.exe is located
  • type set SLICER_OPENGL_PROFILE=core
  • type Slicer.exe to start the application

Copy-paste this to the Python console:

import SampleData
import numpy as np
volumeNode = SampleData.SampleDataLogic().downloadMRHead()
histogram = np.histogram(arrayFromVolume(volumeNode), bins=50)

chartNode = slicer.util.plot(histogram, xColumnIndex = 1)
chartNode.SetYAxisRangeAuto(False)
chartNode.SetYAxisRange(0, 4e5)

chartNode.GetNthPlotSeriesNode(0).SetMarkerStyle(slicer.vtkMRMLPlotSeriesNode.MarkerStyleCircle)
chartNode.GetNthPlotSeriesNode(0).SetMarkerSize(15)

You may also try updating your graphics card drivers. What graphics card and driver version do you use?

Super!!! It works after setting Slicer_OpenGL_Profile=core! Thanks a lot, Andras.

How to check or make sure of SLICER_OPENGL_PROFILE=core if I run by python?

Best,
Aiden

Solution-1:
Start Slicer.exe from a terminal after “set SLICER_OPENGL_PROFILE=core”

Solution-2:
Go to system’s “Advanced System Settings”–> “Environment Variables”–>Make a new variable as “SLICER_OPENGL_PROFILE” and set its value as “core”; then run Slicer as normal.

This is a system environment variable, so you can query its value from Python easily.

It is probably a bug in VTK library. Using OpenGL core profile causes rendering errors (e.g., render window update is delayed) on some computers with Intel graphics cards, so we had to force using OpenGL compatibility profile. However, apparently, this causes this issue on some high-end NVidia graphics cards.

Hopefully this problem will go away if we update to latest VTK version. Until then you may use this workaround of explicitly setting OpenGL profile.

Yeah, just feel that render window update is really delayed too much due to this re-setting for OpenGL core profile. Thanks a lot, and looking forward to a new version after newly-updates with VTK.

Aiden

The delayed update bug only affects certain Intel graphics cards and driver versions (but those don’t have the MarkerStyle issue). If yours is not among those graphics cards then you can safely use a core profile without any adverse affects.

What graphics card do you have? Do you see any problems when you enable OpenGL core profile?

I do have a NVIDIA Quadro P5000.
It seems no problem for re-setting SLICER_OPENGL_PROFILE as core.

I was mis-led by a pixel-spacing setting, which I was trying to figure out what happens but failed.
You see, now I have an image which has a pixel-spacing 15nm (that means, 1.5e-5mm). I load this image to Slicer and it seems fine. But the mouse-scroll to change slices along views does not work (slower than usual, the slice-bar on the top of each view work fine though). So I try to put a fake pixel-spacing value as 1.5mm or even 0.015mm, it works fine to middle-mouse-button-scroll to browse slices along views.
This is what I was trying to ask you expertise to figure out in my next question. This issue may be reproduced by yourself , trying to use that famous MRHead image, if you set image pixel spacing as 0.001mm, it’s fine. but if you set image pixel spacing as 0.0001 mm, then you try mouse-scrolling where you may see my issue.

Thanks a lot again.

PS: I guess it’s better for me to open a new topic here: View displays lag if pixel-spacing is small.

Yes, using OpenGL core profile has not been an issue for NVidia graphics cards, so there should be no drawback for you to use it.