Unable to add scalars to `vtkMRMLMarkupsCurveNode`

Hi,

I’m trying to create scalars and add it to the vtkMRMLMarkupsCurveNode. Then I go to the Markups module and I cant find any scalars except PedigreeIDs. Probably I do something wrong… here is the script I use:

# Create random numpy array to use as input
import numpy as np
pointPositions = np.random.uniform(-10,10,size=[4,3])

# Create curve from numpy array
curveNode = slicer.mrmlScene.AddNewNodeByClass("vtkMRMLMarkupsCurveNode")
slicer.util.updateMarkupsControlPointsFromArray(curveNode, pointPositions)

# Create scalars
scalars = vtk.vtkDoubleArray()
scalars.SetName('MyScalars')
scalars.InsertNextValue(0)
scalars.InsertNextValue(1)
scalars.InsertNextValue(-1)
scalars.InsertNextValue(3)

# Add scalars to curve node
curveNode.GetCurve().GetPointData().SetScalars(scalars)