Overlaying images and pore network in Paraview #2765
-
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
This is because paraview and numpy don't agree on axis conventions. There is a function in porespy called align_with_openpnm which will rotate the image for you. You can also use |
Beta Was this translation helpful? Give feedback.
-
Hi @qingqi-code. The problem is with the boundary_width that SNOW adds for dealing with boundary pores. This offsets your network by the number of voxels given to the boundary_width argument. The default is 3. To correct for this, you can add 3 voxels (or whatever the boundary width is) to pn['pore.coords']. This works for tiff images, however, to get the example image you showed, I typically use stl. This may be a different approach but it has worked for me. I wrote a code snippet for you that does this in stl and shifts the pore.coords accordingly. Although I set the boundary_width to zero, that is no boundary pores, I still shifted the network by 10 voxels because, for some reason, the origin of the stl file starts at (10, 10, 10). I show the resulting network visualized in paraview with the stl image. Notice how the stl file starts at (10, 10, 10) in the bottom left corner! Also, please see my example code below that I adapted from yours.
|
Beta Was this translation helpful? Give feedback.
Hi @qingqi-code. The problem is with the boundary_width that SNOW adds for dealing with boundary pores. This offsets your network by the number of voxels given to the boundary_width argument. The default is 3. To correct for this, you can add 3 voxels (or whatever the boundary width is) to pn['pore.coords']. This works for tiff images, however, to get the example image you showed, I typically use stl. This may be a different approach but it has worked for me. I wrote a code snippet for you that does this in stl and shifts the pore.coords accordingly. Although I set the boundary_width to zero, that is no boundary pores, I still shifted the network by 10 voxels because, for some reason, the…