-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
MRG: Add initial arguments to vol viz #6046
Conversation
Codecov Report
@@ Coverage Diff @@
## master #6046 +/- ##
=========================================
Coverage ? 89.62%
=========================================
Files ? 421
Lines ? 76110
Branches ? 12441
=========================================
Hits ? 68211
Misses ? 5100
Partials ? 2799 |
@larsoner what is the image we are looking at? Is it the max? I remember being confused by this in the beginning. If you click on a certain slice that looks like the max, it does not necessarily give you the max in the time course. Because you are looking at the time course for that particular slice, not the time course for the slice corresponding to the global max. How does the image look when you click at t = 0.16? |
Try the example here morphed to fsaverage in either mode, clicking and the maps/time course should be broken |
@jasmainak why in We might want to use the given subject's This doesn't really tell us why the |
sorry for this. I will need to dig up a bit to figure out what was the exact reasoning at the time. But from what I seem to remember, the stc image was not in the same coordinate space as the T1, which is why you need to do this. Once you are in the same space as T1, then plot_stat_map and plot_glass_brain become equivalent.
sure. I am always confused about the different coordinate systems. From what I can recall there was an interplay between 3 coordinate systems -- the one that the STC was in, then the T1 and then the one that nilearn expects the images to be in -- which is MNI? So, the talxfm is the transform that takes you from T1 to MNI, and is stored in the metadata of the T1 image? |
@jasmainak and @larsoner I went through quite some transformation matrix and coordinate system fun lately and would be happy to share my 2 cents at the sprint if desired? I also wrote a little snippet to add markers to volume plots (e.g., for marking simulation voxels etc.; however, with |
Yes let's figure this out at the sprint after we complete The Great Beamformer Unification of 2019™ |
This pull request introduces 1 alert when merging e7788e5 into 5d80e26 - view on LGTM.com new alerts:
Comment posted by LGTM.com |
This pull request introduces 1 alert and fixes 1 when merging 0a44aa8 into d1730ca - view on LGTM.com new alerts:
fixed alerts:
|
7f8e9d6
to
998e936
Compare
This pull request fixes 1 alert when merging 998e936 into 63e9ad2 - view on LGTM.com fixed alerts:
|
This monster is finally done. There were several bugs (see
Ready for review/merge from my end. Modified example showing correct plots for different combinations of |
This pull request introduces 3 alerts and fixes 1 when merging 773566a into 13c8e69 - view on LGTM.com new alerts:
fixed alerts:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe @jasmainak can have a look or test to confirm it works as expected? thanks !
MIP can look that way when a lot of the brain is active. Center on the N100 peak and it looks more like what you're probably expecting.
I can try some heuristic like 0.5 and 99.5th percentile of the data or something. I'll try some stuff and see if I can come up with something reasonable. Eventually we might want a |
Rebased and pushed a commit to use the same ticks as the colorbar (improved consistency), and fix the ylim while browsing. If people want it to change to something else, they can use |
This pull request fixes 1 alert when merging b8c52cb into 9585e93 - view on LGTM.com fixed alerts:
|
@jasmainak can you have another look? |
I'll take a look tomorrow! |
Removed the problematic |
This pull request fixes 1 alert when merging 5ce5f19 into d9e2788 - view on LGTM.com fixed alerts:
|
stc.copy().crop(0.05, 0.18).plot( | ||
src=morph, subject='fsaverage', subjects_dir=subjects_dir, | ||
mode='stat_map', clim=dict(kind='value', pos_lims=lims), | ||
initial_time=0.1, verbose=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this so slow compared to the other two plots? Does the morph do some computation on demand? It's a bit hard to interact with the time series on this one, specially if you click on a time point very close to the vertical line (maybe because the samples are far apart?).
That said, this PR is already a big improvement over what exists. So, feel free to merge it. I won't have time to look again the next 2 days.
thx @larsoner ! |
* ENH: Add initial arguments to vol viz * DOC: Links * FIX: Fix for deprecation * WIP * FIX: Fix affine treatment and vertices order * FIX: Adjust tests * FIX: Flake * FIX: Check * BUG: Fix axis limits * FIX: Clip and desc
`Forward` keys added by: * 6d84371 / mne-tools#5840 / 2019-01-29 `SourceMorph` keys added by: * 6d84371 / mne-tools#5840 / 2019-01-29 * b65a045 / mne-tools#6046 / 2019-09-15
dictionary key `name` repeated with different values `Forward` keys added by: * 6d84371 / mne-tools#5840 / 2019-01-29 `SourceMorph` keys added by: * 6d84371 / mne-tools#5840 / 2019-01-29 * b65a045 / mne-tools#6046 / 2019-09-15
When using
VolSourceEstimate.plot()
I found myself wanting a way to specify the initial time and initial position. This PR thus:initial_time
(like in surf source est plotting)initial_position
morph
instead ofSourceSpaces
assrc
(see Notes for details/rationale)My particular use case involved replicating a figure someone sent me with
initial_time=0.2
andinitial_pos=(-0.04, -0.034, -0.002)
and now I can script it to give:Not ready for merge because there is some bug with indexing the morphed STC.