-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add orthoview AFID plot #45
Merged
Merged
Conversation
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
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #45 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 12 14 +2
Lines 760 838 +78
=========================================
+ Hits 760 838 +78
|
@ataha24 - Added you to review this one since you may have some thoughts about additional features / changes regarding the plotting. |
kaitj
force-pushed
the
enh/plotting
branch
4 times, most recently
from
October 24, 2023 16:59
a3ae407
to
9b1eb1f
Compare
kaitj
force-pushed
the
enh/plotting
branch
2 times, most recently
from
October 28, 2023 20:55
f73b776
to
fa51c70
Compare
kaitj
force-pushed
the
enh/plotting
branch
2 times, most recently
from
November 13, 2023 19:50
2da9def
to
5b339db
Compare
I am merging this in to push development forward. |
- Add nilearn for orthogonal plotting, with matplotlib installation - Separately install plotly (nilearn's plotly version requires another library that does not appear to support py3.10+) - By adding this through extras instead of group dependencies, this should enable the ability to install using `pip install afids-utils[plotting]`
This commit adds the functionality to create a view object with AFIDs overlaid on an nifti image. To do so, a nifti image with just the fiducials are created with an intensity value equal to the labels. This serves as a "segmentation" or "label" map. A custom 32-discrete colormap object is created to visualize these different fiducials. Additionally, to allow for either voxel coordinates or positional coordinates to be passed, a conversion to voxel coordinates is performed when the plotting function is called. Note, plotting is not limited to complete `AfidSet`s. Individual and incomplete `AfidSet`s can also be plotted. Finally stubs have been created for `matplotlib` and `nilearn` to correct for pyright errors. `# pyright: ignore` was added where appropriate to bypass issues false errors.
Also fix type to afids_utils/afids.py
Issue with matplotlib installation that prevented the plotting page to be loaded. This was due to a `poetry` installation command. Also added intersphinx mappings for plotting functionality and made some text changes to docstrings.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Proposed changes
This PR adds some plotting functionality to visualize the AFIDs provided by returning a view object with N number of AFIDs (up to 32) overlaid on a nifti image. The one caveat is that AFIDs are assumed to be in the same space as the provided image.
This plotting functionality is also setup as an extra dependency - that is by default, installing
afids-utils
will not provide plotting capabilities. To do so, one would have to specify it (e.g. usingpip
-pip install afids-utils[plotting]
). This choice was made to avoid installation of extra libraries if the end-user does not intend to use it.Types of changes
What types of changes does your code introduce? Put an
x
in the boxes that applyChecklist
Put an
x
in the boxes that apply. You can also fill these out after creating the PR. If you are unsure about any of the choices, don't hesitate to ask!poe quality
taskNotes
All PRs will undergo the unit testing before being reviewed. You may be requested to explain or make additional changes before the PR is accepted.