Open kevinyamauchi opened 2 years ago
What do you think, @haesleinhuepf and @jo-mueller?
Can we depend on numba? @MaksHess and I noticed pretty significant speedups when using numba for the aggregation functions (~10x).
Could we instead define an interface for aggregations (with and without neighbors)? I'm asking because clesperanto also offers neighborhood aggregation functionality: https://clesperanto.github.io/pyclesperanto_prototype/docs/_build/html/search.html?q=Of+neighbors+&check_keywords=yes&area=default
This issue is to discuss expanding the measurement API to include surface measurements and neighborhood aggregation functions. Surface measurements are performed on either vertices or faces of a mesh. Neighborhood aggregation functions take any measurement table and aggregate the measurements using neighborhoods defined by an adjacency matrix (can be binary or weighted).
A few principles I would like to propose:
label_measurements
take aLabelImage
+ optionalIntensityImage
and return aLabelMeasurementTable
.surface_vertex_measurements
take aSurface
+ optionalIntensityImage
and return aVertexMeasurementTable
. Measurements are performed on the vertices of the surface mesh.surface_face_measurements
take aSurface
+ optionalIntensityImage
and return aFaceMeasurementTable
. Measurements are performed on theneighborhood_aggregation
takes aLabelMeasurementTable
,VertexMeasurementTable
, or aFaceMeasurementTable
, and an adjacency graph and returns the measurement table with the neighborhood aggregations performed (e.g.,A few questions:
numba
? @MaksHess and I noticed pretty significant speedups when usingnumba
for the aggregation functions (~10x). While numba can be annoying due to relatively strict numpy and python version requirements, I think it is reliable when the correct numpy pins are in place and many analysis packages are starting to use it for acceleration anyway. Since not all measurements can be jit-ed, we can make separate runners that use numba.morphometrics-engine
(e.g., mean, standard deviation, median)?Related issues:
Next steps:
label_measurement
, etc.