Volume extraction

Hello, everyone,

I need to extract a volume of spherical shape in a file.pvd at my disposal, how can I do this? I need to be able to choose both the centre of the sphere and the radius.
I also have associated with my file an.xml file which contains the info of the values of the individual voxels. Is there any way I can extract those as well?
Thanks in advance.

Hi Lorenzo,

Please share your data.


This is the beginning of the xml file associated with the pvd file:

<?xml version="1.0"?>
<dolfin xmlns:dolfin="http://fenicsproject.org">
    <mesh_value_collection name="f" type="double" dim="3" size="316803">
      <value cell_index="0" local_entity="0" value="0.340542" />
      <value cell_index="1" local_entity="0" value="0.479969" />
      <value cell_index="2" local_entity="0" value="0.985618" />
      <value cell_index="3" local_entity="0" value="0.000000" />
      <value cell_index="4" local_entity="0" value="0.392166" />
      <value cell_index="5" local_entity="0" value="0.000000" />
      <value cell_index="6" local_entity="0" value="0.000000" />
      <value cell_index="7" local_entity="0" value="0.402671" />
      <value cell_index="8" local_entity="0" value="0.841263" />
      <value cell_index="9" local_entity="0" value="0.642589" />
      <value cell_index="10" local_entity="0" value="0.465866" />
      <value cell_index="11" local_entity="0" value="0.552327" />

And this is a image of the file .pvd

Do you want to extract cells by value of by index ?

I would need to extract a region to know the values of individual cells and keep the original index that these cells have in the complete mesh

Sorry @Lorenzo11 , I dont understand what you want to do. Please clarify your request.

I have 3 meshes of the same type (brain with the same grid) to which 3 different types of values are associated: value a, value b and value c.
I should compare the individual cell values of a specific region (within a sphere centred at a specific point), so I was thinking of extracting that region from the total mesh. is that possible? Only I would have to keep the original indices identifying the cells because otherwise they might not match those of mesh b or mesh c. Then get an xml file (or something similar) with the list of cell indices together with the value.

  • If the meshes have the same exact geometry: AppendAttributes
  • If the meshes are different: ResampleWithDataset
  • If you want to extract the cells: Selection + ExtractSelection

I think that should cover your needs ?

1 Like

OK I will try as indicated, thank you!!! I should also be able to extract a list with values, shouldn’t I?

Yes, values will be extracted.

With AppendAttribute I can currently only extract the cell to which the point appears which I would like to use as the centre of my sphere. How do I indicate the radius of the region to be extracted?

Clip with sphere ?

That would be much easier if you provided an example of what you are trying to achieve.



From my whole brain I need to extract the list of values associated with the cells in the extracted region (the one in the image was extracted with Extract cell by region → clip sphere and then choosing centre and radius).
From this region I need to extract a list of paired values (cell id + Value (f)) with information about all the tetrahedra in the mesh. (The cell ids must clearly be the original ones for the whole brain as I then have to compare the values obtained from mesh a with mesh b).

Unfortunately I don’t have any examples already done.

From the section obtained I could simply, using find data, select the boxes that have value f within a range and put maximum and minimum values as limits (in the case of Brain A [0,1]) to see what they are worth.
However, the list that will be formed will have a different indexing of the cells than the one I started with, so it may be different when I do the same procedure on Brain B. This would not allow me to compare the A and B values in the specific N cell.

I hope my objective is clearer

The field “OriginalCellIds” should contain the original indexes. Maybe you can use that.

Ok, where can I find it?

Please share actual data.

I got a list like this

I’m afraid I need the data to be able to open it in ParaView to help you

FA.pvd (164 Bytes)