Skip to content

Mesh

See mesh zonation for boundary labels, volume requirements, position direction, normalization, and the current single-cell-block assumption.

Zonation

Helpers for zonated meshes.

ZonationPatterns

Definition of standard zonation patterns.

This calculates zonated variables based on the position of the mesh nodes.

position staticmethod

position(p, value=1.0, f_scale=1.0)

Pattern based on position information.

constant staticmethod

constant(p, value=0.5, f_scale=1.0)

Constant zonation with value.

random staticmethod

random(p, value_min=0.0, value_max=1.0, f_scale=1.0, *, rng=None)

Draw random zonation using a local or caller-supplied generator.

linear_increase staticmethod

linear_increase(p, value_min=0.0, value_max=1.0, f_scale=1.0)

Linear increasing pattern in [min_value, max_value].

linear_decrease staticmethod

linear_decrease(p, value_min=0.0, value_max=1.0, f_scale=1.0)

Linear decreasing pattern in [min_value, max_value].

exp_increase staticmethod

exp_increase(p, value_min=0.0, value_max=1.0, f_scale=1.0)

Exponential increasing pattern in [0, 1].

exp_decrease staticmethod

exp_decrease(p, value_min=0.0, value_max=1.0, f_scale=1.0)

Exponential decreasing pattern in [0, 1].

only_periveneous staticmethod

only_periveneous(p, value_min=0.0, value_max=1.0, f_scale=1.0)

Only periveneous pattern in [0, 1].

only_periportal staticmethod

only_periportal(p, value_min=0.0, value_max=1.0, f_scale=1.0)

Only periportal pattern in [0, 1].

sharp_periportal staticmethod

sharp_periportal(p, value_min=0.0, value_max=1.0, n=10.0, f_scale=1.0)

Sharp periportal pattern in [0, 1].

sharp_periveneous staticmethod

sharp_periveneous(p, value_min=0.0, value_max=1.0, n=10.0, f_scale=1.0)

Sharp periveneous pattern in [0, 1].

ZonatedMesh

Class for zonated meshes.

create_zonated_mesh_from_vtk classmethod

create_zonated_mesh_from_vtk(vtk_path, patterns=None, remove_point_data=True, remove_cell_data=True, copy_mesh=True, *, rng=None)

Return a zonated mesh; use rng for reproducible random patterns.

create_zonated_mesh staticmethod

create_zonated_mesh(mesh, remove_point_data=True, remove_cell_data=True, copy_mesh=True)

Calculate positions using nearest boundary centers across all cell blocks.

cell_type labels interior, periportal, and perivenous cells as 0, 1, and 2. Both boundary types are required. Supply finite nonnegative volumes as volume or element_volume_point_TPM, with a positive total. Geometry and fields are validated before modifying a mesh in place.

visualize_zonation_patterns

visualize_zonation_patterns(mesh, results_path, image_name, data_layers, direction='horizontal', drange_type=None)

Visualize patterns with local ranges by default, importing rendering lazily.

example_mesh_zonation

example_mesh_zonation(results_dir, visualize=True)

Export the zonation example, optionally rendering its patterns.

Serialization

These helpers serialize static meshes. Use the time-series conversion helpers in the data API for simulation time courses.

Tools to manipulate and work with meshes.

mesh_to_xdmf

mesh_to_xdmf(m, xdmf_path, test_read=False)

Serialize mesh to XDMF.

mesh_to_vtk

mesh_to_vtk(m, vtk_path, test_read=False)

Serialize mesh to VTK.

FIXME: must handle the special case of timecourse data; i.e. only serialze part of it