HemoFlow - Hands-on with Simple Geometry
Why convert npz to xmf?
A unique feature of HemoFlow, a Palabos-based application, is the handling of "openings" on the sides of geometry tubes. These tubes are typically curved and complex, reflecting the essential nature of human blood vessels.
We expect to define the geometry by specifying the openings': 1. Location, defined by either voxel indices or spatial coordinates. 2. Attachment method to the vessels. 3. Dimensions.
After defining the geometry, we assign dynamics to connect the "pure" geometry (readable by XMF readers like ParaView) to Palabos objects. This post focuses on the hands-on manipulation of the pure geometry; we will discuss dynamics assignment in a future post.
For XMF beginners, typical human vessel tubes are too complex for a hands-on introduction. Instead, let's create a simple cylindrical tube to easily understand the three items mentioned above. This allows us to easily count voxels and render the result in viewers like ParaView to efficiently verify our understanding. We can then seamlessly translate this knowledge to more complex geometries.
The overall data flow for the geometry is:
- An .npz file represents the voxels as a NumPy array, where the array elements represent the flags for each voxel.
- This data is loaded into a Palabos object, which is then translated into XMF (or other formats) by Palabos.
In real-world cases, the .npz file is generated by the HemoFlow preprocessor from STL files, which are widely used in medical imaging. We will skip that part here and focus on the process of converting .npz to XMF.
How to convert npz to xmf
- Read the
.npzfile. - Fill in the voxels.
- Run the simulation.
- Output as XMF.