Choose one scalar array from vtkPolyData to apply vtkThresholdPoints

Viewed 37

I have a vtkPolyData object. It holds multiple Point Data Arrays (pressure, density, velocity, etc.). I want to select some points in this vtkPolyData where one of the data, say pressure, is inbetween a range, by applying vtkThresholdPoints.

My question is, does vtkThresholdPoints provide an attribute to set the data on which I want to set the threshold? To my understanding, vtkThresholdPoints uses the "default" Scalars associated with vtkPolyData, which is not the data array I want to use.

I found on https://vtk.org/doc/nightly/html/classvtkThresholdPoints.html#details there is an attribute SetInputArrayComponent(). However, Python interpreter is complaining:

AttributeError: 'vtkFiltersCorePython.vtkThresholdPoints' object has no attribute 'SetInputArrayComponent'

By the way, this is what my vtkPolyData looks like when I print it in Python:

vtkPolyData (0x2bc3bd0)
  Debug: Off
  Modified Time: 16991
  Reference Count: 2
  Registered Events: (none)
  Information: 0x35776e0
  Data Released: False
  Global Release Data: Off
  UpdateTime: 16992
  Field Data:
    Debug: Off
    Modified Time: 16925
    Reference Count: 1
    Registered Events: (none)
    Number Of Arrays: 0
    Number Of Components: 0
    Number Of Tuples: 0
  Number Of Points: 401032
  Number Of Cells: 401032
  Cell Data:
    Debug: Off
    Modified Time: 16974
    Reference Count: 1
    Registered Events: 
      Registered Observers:
        vtkObserver (0x35780f0)
          Event: 33
          EventName: ModifiedEvent
          Command: 0x3577690
          Priority: 0
          Tag: 1
    Number Of Arrays: 0
    Number Of Components: 0
    Number Of Tuples: 0
    Copy Tuple Flags: ( 1 1 1 1 1 1 1 1 )
    Interpolate Flags: ( 1 1 1 1 1 1 0 1 )
    Pass Through Flags: ( 1 1 1 1 1 1 1 1 )
    Scalars: (none)
    Vectors: (none)
    Normals: (none)
    TCoords: (none)
    Tensors: (none)
    GlobalIds: (none)
    PedigreeIds: (none)
    EdgeFlag: (none)
  Point Data:
    Debug: Off
    Modified Time: 16972
    Reference Count: 1
    Registered Events: 
      Registered Observers:
        vtkObserver (0x35775b0)
          Event: 33
          EventName: ModifiedEvent
          Command: 0x3577690
          Priority: 0
          Tag: 1
    Number Of Arrays: 25
    Array 0 name = Pressure
    Array 1 name = Density
    Array 2 name = CFLNumber
    Array 3 name = PhaseVolumeFraction
    Array 4 name = SolidOriginalCoordinateX
    Array 5 name = SolidOriginalCoordinateY
    Array 6 name = SolidOriginalCoordinateZ
    Array 7 name = HydrostaticPressure
    Array 8 name = Time
    Array 9 name = Velocity
    Array 10 name = DiagnosticCoordinate
    Array 11 name = GalerkinProjection
    Array 12 name = GalerkinProjectionInterpolationErrorBound
    Array 13 name = SolidOldCoordinate
    Array 14 name = GridSolidVelocity
    Array 15 name = SolidForce
    Array 16 name = PastSolidForce
    Array 17 name = GravityDirection
    Array 18 name = Viscosity
    Array 19 name = Viscosity_Solid
    Array 20 name = spatial_coordinate
    Array 21 name = vtkGhostLevels
    Array 22 name = StressTenSolid
    Array 23 name = Sigma_Solid
    Array 24 name = Density_Solid
    Number Of Components: 69
    Number Of Tuples: 401032
    Copy Tuple Flags: ( 1 1 1 1 1 0 1 1 )
    Interpolate Flags: ( 1 1 1 1 1 0 0 1 )
    Pass Through Flags: ( 1 1 1 1 1 1 1 1 )
    Scalars: 
      Debug: Off
      Modified Time: 16685
      Reference Count: 2
      Registered Events: (none)
      Name: vtkGhostLevels
      Data type: unsigned char
      Size: 401032
      MaxId: 401031
      NumberOfComponents: 1
      Information: 0
      Name: vtkGhostLevels
      Number Of Components: 1
      Number Of Tuples: 401032
      Size: 401032
      MaxId: 401031
      LookupTable: (none)
    Vectors: 
      Debug: Off
      Modified Time: 16451
      Reference Count: 3
      Registered Events: (none)
      Name: spatial_coordinate
      Data type: double
      Size: 1203096
      MaxId: 1203095
      NumberOfComponents: 3
      Information: 0
      Name: spatial_coordinate
      Number Of Components: 3
      Number Of Tuples: 401032
      Size: 1203096
      MaxId: 1203095
      LookupTable: (none)
    Normals: (none)
    TCoords: (none)
    Tensors: 
      Debug: Off
      Modified Time: 16692
      Reference Count: 2
      Registered Events: (none)
      Name: StressTenSolid
      Data type: double
      Size: 3609288
      MaxId: 3609287
      NumberOfComponents: 9
      Information: 0
      Name: StressTenSolid
      Number Of Components: 9
      Number Of Tuples: 401032
      Size: 3609288
      MaxId: 3609287
      LookupTable: (none)
    GlobalIds: (none)
    PedigreeIds: (none)
    EdgeFlag: (none)
  Bounds: 
    Xmin,Xmax: (-0.0381, 0.0381)
    Ymin,Ymax: (-0.038109, 0.0381058)
    Zmin,Zmax: (-0.0295, 0.2595)
  Compute Time: 17003
  Number Of Points: 401032
  Point Coordinates: 0x2eb37e0
  Locator: 0
  Number Of Vertices: 0
  Number Of Lines: 0
  Number Of Polygons: 401032
  Number Of Triangle Strips: 0
  Number Of Pieces: 1
  Piece: 0
  Ghost Level: 0
1 Answers
Related