Hi Dave,
Thanks for the tips! I was able to (I think) implement your suggestions. The problem I still see though is that the integrateVariables is just showing (once I switch view to SpreadSheet) one line with a single point ID and a single RegionID,
although in the rendered view I can see all my islands as expected.
What am I missing?
Thanks again for all the suggestions!
from paraview.simple import *
import sys
#reader = LegacyVTKReader(FileNames=[str(sys.argv[1])])
reader = LegacyVTKReader(FileNames=[“Current_density-m3-mag-xyz_slice.vtk”])
Show(reader)
connectivity1 = Connectivity(Input=reader)
Hide(reader)
Show(connectivity1)
##dp1 = GetDisplayProperties(reader)
##dp1.Representation(‘Wireframe’)
thresholdFilter = Threshold(Input=connectivity1)
#thresholdFilter = Threshold(reader)
thresholdFilter.Scalars = “scalars”
#thresholdFilter.ThresholdRange
thresholdFilter.ThresholdRange = [2.77e09, 2e10]
##thresholdFilter.ThresholdRange = [3.5e09, 2e10]
#Hide(reader)
Hide(connectivity1)
Show(thresholdFilter)
dp2 = GetDisplayProperties(thresholdFilter)
thresholdFilter.PointData[:]
hotSpots = thresholdFilter.PointData[0]
range = hotSpots.GetRange()
scalars_PVLookupTable = GetColorTransferFunction(“scalars”)
scalars_PVLookupTable.RescaleTransferFunction(range[0], range[1])
scalars_PVLookupTable.ApplyPreset(‘jet’, True)
ScalarBarWidgetRepresentation1 = CreateScalarBar( Title=“scalars”, LabelFontSize=12, Enabled=1, LookupTable=scalars_PVLookupTable, TitleFontSize=12 )
GetRenderView().Representations.append(ScalarBarWidgetRepresentation1)
extractSurface1 = ExtractSurface(Input=thresholdFilter)
get display properties
#extractSurface1Display = GetDisplayProperties(extractSurface1, view=renderView2)
extractSurface1Display = GetDisplayProperties(extractSurface1)
set scalar coloring
ColorBy(extractSurface1Display, (‘POINTS’, ‘scalars’))
get color transfer function/color map for ‘RegionId’
regionIdLUT = GetColorTransferFunction(‘RegionId’)
Hide the scalar bar for this color map if no visible data is colored by it.
#HideScalarBarIfNotNeeded(regionIdLUT, renderView2)
HideScalarBarIfNotNeeded(regionIdLUT)
rescale color and/or opacity maps used to include current data range
extractSurface1Display.RescaleTransferFunctionToDataRange(True, False)
show color bar/color legend
#extractSurface1Display.SetScalarBarVisibility(renderView2, True)
get color transfer function/color map for ‘scalars’
scalarsLUT = GetColorTransferFunction(‘scalars’)
get opacity transfer function/opacity map for ‘scalars’
scalarsPWF = GetOpacityTransferFunction(‘scalars’)
extractSurface1.Input.Scalars = “scalars”
Hide(thresholdFilter)
Show(extractSurface1)
integrate = IntegrateVariables(Input=extractSurface1)