# Setting of MarkerStyle does NOT work!

**URL:** <https://discourse.slicer.org/t/setting-of-markerstyle-does-not-work/9073>\
**Category:** Support\
**Created:** [November 7, 2019, 11:07pm UTC](https://discourse.slicer.org/t/setting-of-markerstyle-does-not-work/9073 "2019-11-07T23:07:23Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![aiden.zhu](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/aiden.zhu/32/67145_2.png) [@aiden.zhu](https://discourse.slicer.org/u/aiden.zhu)\
**Post date:** [November 7, 2019, 11:07pm UTC](https://discourse.slicer.org/t/setting-of-markerstyle-does-not-work/9073/1 "2019-11-07T23:07:23Z")

</div>

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](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/d/9/d9938ad8e225102311d752b081e70b9d023aadad.png)

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/d/4/d412338329ab092b4145d3ba3757549b604aa560.png)

Thanks a lot.

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [November 8, 2019, 12:00am UTC](https://discourse.slicer.org/t/setting-of-markerstyle-does-not-work/9073/2 "2019-11-08T00:00:29Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![aiden.zhu](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/aiden.zhu/32/67145_2.png) [@aiden.zhu](https://discourse.slicer.org/u/aiden.zhu)\
**Post date:** [November 8, 2019, 12:07am UTC](https://discourse.slicer.org/t/setting-of-markerstyle-does-not-work/9073/3 "2019-11-08T00:07:01Z")

</div>

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.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/3/d/3dbd76829b29b8a5cb74186e6ebf831eca2e07a3.png)  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/7/c/7cf449f38004276403fbb06342f69bc3d2e66daf.png)

To get a comparison:

![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/2/a/2ac4a69a94161f2e6918c26b0f56eb16b7ff0cd1.png)

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/9/c/9c8e6d8b3fab835e78b83188505710667ea46435.png)

Best,  
Aiden

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [November 8, 2019, 12:28am UTC](https://discourse.slicer.org/t/setting-of-markerstyle-does-not-work/9073/4 "2019-11-08T00:28:04Z")

</div>

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

```auto
# 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.

---

<div class="post-metadata">

**Author:** ![aiden.zhu](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/aiden.zhu/32/67145_2.png) [@aiden.zhu](https://discourse.slicer.org/u/aiden.zhu)\
**Post date:** [November 8, 2019, 12:32am UTC](https://discourse.slicer.org/t/setting-of-markerstyle-does-not-work/9073/5 "2019-11-08T00:32:32Z")

</div>

> [@lassoan](#):
>
> 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)

Yes, but no circles as markers there, Andras.

Here is the screenshot:

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/c/8/c87535bdb0980775e78417025e4b842223d82625.png)  
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](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/1/1/11dc8cbdd7fe2abb818179c088274f7fea35c9f1.png)

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [November 8, 2019, 1:30am UTC](https://discourse.slicer.org/t/setting-of-markerstyle-does-not-work/9073/6 "2019-11-08T01:30:50Z")

</div>

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:

```python
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?

---

<div class="post-metadata">

**Author:** ![aiden.zhu](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/aiden.zhu/32/67145_2.png) [@aiden.zhu](https://discourse.slicer.org/u/aiden.zhu)\
**Post date:** [November 8, 2019, 1:37pm UTC](https://discourse.slicer.org/t/setting-of-markerstyle-does-not-work/9073/7 "2019-11-08T13:37:45Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![aiden.zhu](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/aiden.zhu/32/67145_2.png) [@aiden.zhu](https://discourse.slicer.org/u/aiden.zhu)\
**Post date:** [November 8, 2019, 1:49pm UTC](https://discourse.slicer.org/t/setting-of-markerstyle-does-not-work/9073/8 "2019-11-08T13:49:53Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [November 8, 2019, 2:33pm UTC](https://discourse.slicer.org/t/setting-of-markerstyle-does-not-work/9073/9 "2019-11-08T14:33:12Z")

</div>

> [@aiden.zhu](#):
>
> How to check or make sure of SLICER\_OPENGL\_PROFILE=core if I run by python?

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](https://discourse.slicer.org/t/building-slicer-with-latest-vtk/9083). Until then you may use this workaround of explicitly setting OpenGL profile.

---

<div class="post-metadata">

**Author:** ![aiden.zhu](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/aiden.zhu/32/67145_2.png) [@aiden.zhu](https://discourse.slicer.org/u/aiden.zhu)\
**Post date:** [November 8, 2019, 3:49pm UTC](https://discourse.slicer.org/t/setting-of-markerstyle-does-not-work/9073/10 "2019-11-08T15:49:53Z")

</div>

> [@lassoan](#):
>
> 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)

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

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [November 8, 2019, 3:53pm UTC](https://discourse.slicer.org/t/setting-of-markerstyle-does-not-work/9073/11 "2019-11-08T15:53:41Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![aiden.zhu](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/aiden.zhu/32/67145_2.png) [@aiden.zhu](https://discourse.slicer.org/u/aiden.zhu)\
**Post date:** [November 8, 2019, 4:05pm UTC](https://discourse.slicer.org/t/setting-of-markerstyle-does-not-work/9073/12 "2019-11-08T16:05:37Z")

</div>

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](https://discourse.slicer.org/t/view-displays-lag-if-pixel-spacing-is-small/9087).

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [November 8, 2019, 5:48pm UTC](https://discourse.slicer.org/t/setting-of-markerstyle-does-not-work/9073/13 "2019-11-08T17:48:16Z")

</div>

> [@aiden.zhu](#):
>
> I do have a NVIDIA Quadro P5000.

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.
