3D view ruler doesn't change units suffix

Hi,

When I add volume and change units from mm to say m I can see no difference on the ruler but in the same time the slice control widget’s spinbox changes units to meter. I suspect this is a bug?
Screenshot from 2021-11-18 01-39-16

Here is the code to create a volume:

nodeName = "MyNewVolume"
imageSize = [10, 10, 10]
imageOrigin = [10.0, 0.0, 0.0]
imageSpacing = [1, 1.0, 1.0] 

scalars = vtk.vtkDoubleArray()
scalars.SetName("my_scalars")

for i in range(0, imageSize[0]*imageSize[1]*imageSize[2]):
    v = scalars.InsertNextValue(i)

# Create an image volume
imageData = vtk.vtkImageData()
imageData.SetDimensions(imageSize)
imageData.GetPointData().SetScalars(scalars)
# Create volume node
volumeNode = slicer.mrmlScene.AddNewNodeByClass("vtkMRMLScalarVolumeNode", nodeName)
volumeNode.SetOrigin(imageOrigin)
volumeNode.SetSpacing(imageSpacing)
volumeNode.SetAndObserveImageData(imageData)
volumeNode.CreateDefaultDisplayNodes()
volumeNode.CreateDefaultStorageNode()

Slicer 4.11.2

Not all widgets are unit-aware. See list of widgets that require update in this issue:

It would be great if you could work on this.

1 Like

Thank you, I will keep in mind