-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ENH: Remove dependency on
nibabel.trackvis
Remove dependency on `nibabel.trackvis`: the module was deprecated in `NiBabel` 2.5.0 and removed in version 4.0.0. So this patch set adapts the `tractography.trackvis` code so that it uses the modern API. Add a tolerance when comparing streamline data in `equal_tracts` to account for some precision loss since data is transformed to `float32` (vs `float64`) when applying the operations of the `NiBabel` API. Fixes: ``` tract_querier/tractography/tests/test_tractography.py::test_saveload_trk site-packages/nibabel/deprecated.py:35: DeprecationWarning: The trackvis interface has been deprecated and will be removed in v4.0; please use the 'nibabel.streamlines' interface. mod = __import__(self._module_name, fromlist=['']) ``` and ``` tract_querier/tractography/trackvis.py:7: in <module> from nibabel import trackvis E ImportError: cannot import name 'trackvis' from 'nibabel' (/opt/hostedtoolcache/Python/3.9.20/x64/lib/python3.9/site-packages/nibabel/__init__.py) ``` and related errors raised for example in: https://github.com/demianw/tract_querier/actions/runs/12195905001/job/34022456528#step:6:85 and https://github.com/demianw/tract_querier/actions/runs/12195905001/job/34022456201#step:6:32
- Loading branch information
1 parent
93ab73f
commit c977552
Showing
2 changed files
with
91 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters