Adjust opacity of scalar value

Hello,

Just wondering if it’s possible to adjust the opacity of a model’s scalar (not the opacity of the model display node) programmatically?

For example, something like:
model.GetDisplayNode().SetScalarOpacity(x)
NOT model.GetDisplayNode().SetOpacity(x)

Thanks in advance

You can specify opacity in the color node that you use for displaying the scalars. See complete example here. The last argument of SetColor method is the alpha (opacity) value.