我有一个我运行的自动剪辑脚本,作为它的一部分,我想拥有并选择将配色方案重新缩放为范围内的可见数据 - 布尔值。
我clipDisplay.SetScalarBarVisibility(renderView1, True)
在Paraview 用户指南(第 10.1.2 章)中找到了此命令,并将其放置在剪辑的 paraview 跟踪脚本中的颜色转移函数的末尾。
运行脚本不会给出任何错误,但与在 GUI 中完成的相同操作相比,它不会重新调整配色方案。
我想普遍使用代码,所以手动选择具有数字定义的范围内的数据是不可能的......
编辑
使用跟踪你会得到:
# trace generated using paraview version 5.7.0
#
# To ensure correct image size when batch processing, please search
# for and uncomment the line `# renderView*.ViewSize = [*,*]`
#### import the simple module from the paraview
from paraview.simple import *
#### disable automatic camera reset on 'Show'
paraview.simple._DisableFirstRenderCameraReset()
# get color transfer function/color map for 'p'
pLUT = GetColorTransferFunction('p')
pLUT.AutomaticRescaleRangeMode = "Grow and update on 'Apply'"
pLUT.InterpretValuesAsCategories = 0
pLUT.AnnotationsInitialized = 0
pLUT.ShowCategoricalColorsinDataRangeOnly = 0
pLUT.RescaleOnVisibilityChange = 0
pLUT.EnableOpacityMapping = 0
pLUT.RGBPoints = [-714.7062377929688, 0.231373, 0.298039, 0.752941, -259.51192474365234, 0.865003, 0.865003, 0.865003, 195.68238830566406, 0.705882, 0.0156863, 0.14902]
pLUT.UseLogScale = 0
pLUT.ColorSpace = 'Diverging'
pLUT.UseBelowRangeColor = 0
pLUT.BelowRangeColor = [0.0, 0.0, 0.0]
pLUT.UseAboveRangeColor = 0
pLUT.AboveRangeColor = [0.5, 0.5, 0.5]
pLUT.NanColor = [1.0, 1.0, 0.0]
pLUT.NanOpacity = 1.0
pLUT.Discretize = 1
pLUT.NumberOfTableValues = 256
pLUT.ScalarRangeInitialized = 1.0
pLUT.HSVWrap = 0
pLUT.VectorComponent = 0
pLUT.VectorMode = 'Magnitude'
pLUT.AllowDuplicateScalars = 1
pLUT.Annotations = []
pLUT.ActiveAnnotatedValues = []
pLUT.IndexedColors = []
pLUT.IndexedOpacities = []
# Rescale transfer function
pLUT.RescaleTransferFunction(-413.7960510253906, 192.35369873046875)
# get opacity transfer function/opacity map for 'p'
pPWF = GetOpacityTransferFunction('p')
pPWF.Points = [-714.7062377929688, 0.0, 0.5, 0.0, 195.68238830566406, 1.0, 0.5, 0.0]
pPWF.AllowDuplicateScalars = 1
pPWF.UseLogScale = 0
pPWF.ScalarRangeInitialized = 1
# Rescale transfer function
pPWF.RescaleTransferFunction(-413.7960510253906, 192.35369873046875)
请问有什么想法吗?干杯