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
WIP: STC baseline correction #8452
WIP: STC baseline correction #8452
Conversation
mne/tests/test_source_estimate.py
Outdated
|
||
times = stc.times | ||
|
||
for baseline in baselines: |
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.
I would do
for baseline in baselines: | |
for (start, stop) in baselines: |
mne/tests/test_source_estimate.py
Outdated
# test on different source estimates | ||
stcs = [] | ||
stcs.append(read_source_estimate(fname_stc)) | ||
stcs.append(read_source_estimate(fname_vol, 'sample')) |
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.
stcs.append(read_source_estimate(fname_vol, 'sample')) | |
stcs = [read_source_estimate(fname_stc), read_source_estimate(fname_vol, 'sample')] |
mne/tests/test_source_estimate.py
Outdated
if baseline[1] is None: | ||
t1 = stc.times[-1] | ||
else: | ||
t1 = baseline[1] |
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.
I would do t1 = baseline or stc.times[-1]
mne/tests/test_source_estimate.py
Outdated
else: | ||
t1 = baseline[1] | ||
|
||
# indec for baseline interval (include boundary latencies) |
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.
# indec for baseline interval (include boundary latencies) | |
# index for baseline interval (include boundary latencies) |
@jona-sassenhagen Thanks a lot - I hope I managed to implement all your suggestions. I cannot make sense of the following build_docs complaints: /home/circleci/project/mne/source_estimate.py:docstring of mne.MixedSourceEstimate.apply_baseline:31: WARNING: Explicit markup ends without a blank line; unexpected unindent. |
Merge branch 'master' into stc_baseline_correction
I don't think the remaining errors have anything to do with me - please let me know. |
I restarted Azure and it's green now. |
@olafhauk You need to mark this PR as ready for review so it can be merged |
@jona-sassenhagen Merge if you're happy |
was missing a what's new entry... @olafhauk can you make a PR to get credit for this work? |
Thanks for contributing a pull request! Please make sure you have read the
contribution guidelines
before submitting.
Please be aware that we are a loose team of volunteers so patience is
necessary. Assistance handling other issues is very welcome. We value
all user contributions, no matter how minor they are. If we are slow to
review, either the pull request needs some benchmarking, tinkering,
convincing, etc. or more likely the reviewers are simply busy. In either
case, we ask for your understanding during the review process.
Again, thanks for contributing!
Reference issue
#8232
What does this implement/fix?
Baseline-correction for source estimates is recommended/necessary for some processing steps. For example, for unsigned source estimates, differences in noise levels may result in differences in intensities (e.g. for conditions with very different numbers of trials). This can be compenstated for by baseline-correction.
I will add a method appy_baseline() to source_estimate.py, analogous to evoked.py. I will add documentation to highlight the caveats of baseline correction for source estimates.
Additional information
Any additional information you think is important.