ExtractCellsByRegion() via pvpython

Hello,

I am searching for a way to select a part of my data. I have a dataset that consists of a small geometry (has volume) enclosed by a cylindrical boundary surface (hollow aside from the small geometry inside). I want to select only the internal geometry.

In the ParaView GUI, using Select Cells On, I manually select the boundary cells, rotate the render view, and repeatedly add to the current selection until all boundary cells are selected. Then I click Find Data > Invert selection so that only the small geometry/volume inside is selected.

What is the best way to program this?

I discovered that the ExtractCellsByRegion() filter works perfectly if I extract using a box. I want to set the properties to the following:
image

However, I still do not know how to specify those parameters when calling the function.

I tried to create a separate box object to use as a property when I call the function:

>>> reader = ExtractRegionSurface(reader)
>>> box = Box(XLength=0.006, YLength=0.025, ZLength=0.006)
>>> swimmer = ExtractCellsByRegion(Input=reader, IntersectWith=box)

I get this error. I know I am probably assigning the IntersectWith property incorrectly, but I do not know the correct syntax. What is the right way to do it?

(  72.795s) [paraview        ]   vtkPVSessionCore.cxx:371    ERR| vtkPVSessionCore (0000020C1E1DD660): Object type: vtkExtractGeometry, could not find requested method: "SetImplicitFunction"
or the method was called with incorrect arguments.

while processing
Message 0 = Invoke
  Argument 0 = vtk_object_pointer {vtkExtractGeometry (0000020C22785000)}
  Argument 1 = string_value {SetImplicitFunction}
  Argument 2 = vtk_object_pointer {vtkCubeSource (0000020C213E5BE0)}

(  72.893s) [paraview        ]   vtkPVSessionCore.cxx:372    ERR| vtkPVSessionCore (0000020C1E1DD660): Aborting execution for debugging purposes.
############ ABORT #############
(  72.905s) [paraview        ]         vtkSIProxy.cxx:155    ERR| vtkSISourceProxy (0000020C22612E10): Error pushing property state: ImplicitFunction
global_id: 354
location: 1
[paraview_protobuf.ProxyState.property] {
  name: "ImplicitFunction"
  value {
    type: INPUT
    proxy_global_id: 342
    port_number: 0
  }
  user_data {
    key: "ProxyListDomain"
    variant {
      type: PROXY
      proxy_global_id: 365
      proxy_global_id: 366
      proxy_global_id: 367
    }
  }
}

Do you consider clip your data first? For example using type
Cylinder to confine the data of your interest?

Thanks for your idea! I actually solved it by using the Select Cells by Region and used the box to do so. I figured out the syntax as well.