Kitware / SlicerSALT

An open-source, free comprehensive software that will allow biomedical scientists to precisely locate shape changes in their imaging studies. This software called Slicer Shape AnaLysis Toolbox (SlicerSALT), will enhance the intuitiveness and ease of use for such studies, as well as allow researchers to find shape changes with higher statistical power. Altogether this constitutes a crucial resource for the imaging field that will enable many and important new findings in biomedical imaging studies.
https://salt.slicer.org
Other
57 stars 25 forks source link

COMP: Remove Fortran and LAPACK #294

Closed allemangD closed 1 year ago

allemangD commented 1 year ago

Update SPHARM-PDM and GROUPS to remove dependency on Fortran and LAPACK.

https://github.com/slicersalt/SPHARM-PDM/commits/slicersalt-2023-02-06-dfde14b72

https://github.com/slicersalt/GROUPS/commits/slicersalt-2023-02-06-037ab7dcd

Note that the SPHARM-PDM fork and SHA should be updated after https://github.com/NIRALUser/GROUPS/pull/44 is merged.


Compared results on the hippocampus sample data; maximum absolute distance between correspondent points is 0.00075 (total length is 92.2; something like 1e-6 relative tolerance). Computed via model-to-model distance module.

I will continue to test on more data and post results here; but I am confident that there are no glaring errors in the Eigen translation.

allemangD commented 1 year ago

I ran SPHARM on the correspondence improvement dataset; the tolerance is not so good on the hourglass example.

image

You can see the maximum absolute deflection from the lapack output is 0.65; a relative tolerance of about 5e-3.

Here's an axis aligned anterior view.

image

I'll try switching the solver which SPHARM uses to HouseholderQR as mentioned in https://github.com/NIRALUser/SPHARM-PDM/pull/81 to see if this improves the tolerance.

Visually, the eigen output looks the same as the lapack output.

allemangD commented 1 year ago

Tolerance is slightly better with HouseholderQR, but not significantly (0.56 maximum deflection vs 0.65).

image

allemangD commented 1 year ago

I ran the test on the entireity of the tricuspid valve leaflets dataset; maximum point-to-point deflection across the whole dataset is 0.014, but mean is 0.000 (MeshStatistics doesn't output more than 3 decimals).

Worth noting that outlier is a single point in a single case. The mean and stddev across the dataset are both 0.000.

image


Overall I'm confident switching to Eigen doesn't introduce any regressions. I believe the next effort should be integrating the scripts I developed to do these deflection analyses into integration tests for the SPHARM-PDM module, so that as refactoring continues we can be sure no regressions are introduced.


I will merge https://github.com/NIRALUser/GROUPS/pull/44 and https://github.com/NIRALUser/SPHARM-PDM/pull/81, update git tags, and finally merge this PR.