-
Notifications
You must be signed in to change notification settings - Fork 95
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
[ENH] Post-ICA automatic components selection #344
Conversation
Codecov Report
@@ Coverage Diff @@
## master #344 +/- ##
==========================================
- Coverage 49.22% 47.56% -1.67%
==========================================
Files 39 40 +1
Lines 2139 2214 +75
==========================================
Hits 1053 1053
- Misses 1086 1161 +75
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #344 +/- ##
=========================================
- Coverage 82.56% 79.7% -2.87%
=========================================
Files 39 42 +3
Lines 2633 2631 -2
=========================================
- Hits 2174 2097 -77
- Misses 459 534 +75
Continue to review full report at Codecov.
|
@smoia would you mind adding the [ENH] tag to the beginning of your PR title? Thanks so much! This looks great, I will review more closely later. |
Sorry @jbteves , I saw the message only now. |
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.
It's looking good. I have some small changes I've requested. In addition to those, could you add numpydoc-format docstrings (e.g., add Parameters and Returns sections) and could you add a test file for this workflow? I think it would be good to test good_ts
, bad_ts
, and both (so three tests).
For some reasons I don't get notifications from this PR. Is there a way to get them? |
docs/usage.rst
Outdated
components. | ||
It overwrites the original comp_table_ica.txt, adding specific rationale labels (I098 and I099). | ||
|
||
.. _Normalised Cross Correlation: https://en.wikipedia.org/wiki/Cross-correlation#Normalized_cross-correlation_(NCC) |
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.
You should add the argparse auto-generated documentation here.
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.
That's where I get kind of lost (i.e. I still don't know ho to do it! But I'm studying it). I'm going to look into it tomorrow and hope I can come back on that.
Thank you!
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.
Ok I think I did it!
@smoia -- let's see if somehow you're "unsubscribed" from the conversation. Can you try "unsubscribing" and then "subscribing" as detailed here ? |
I think we can hold off on writing tests for now, but perhaps it could fit in among the integration tests. It could even be called after the workflow in one of those tests. Just an integration test to make sure everything runs. |
Thank you @emdupre , now it works! |
I need to study more this as well. Let's talk about it (if you can), so I get what to do and maybe I can do it with the test files that are there! |
tedana/workflows/post_taskcorr.py
Outdated
Timeseries of MEICA components. | ||
ctab_fullpath: :obj:`string` | ||
Full path to components table as of tedana output. | ||
!!! It will be overwritten !!! |
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.
Sorry to just jump in here but maybe it would be nice to make a backup copy of the original components table before overwriting it? Just adding in a line like shutil.copy(ctab_fullpath, ctab_fullpath + '.bak')
prior to saving the modified table would be nice!
If this modifies things in a way that a user deems "not great" then they can recover the original comptable without too much hassle rather than having to re-run most of the tedana
workflow.
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.
The original classifications and rationales will be retained in "original_classification" and "original_rationale" columns though.
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.
But if I wanted to use e.g., the tools in tedana.viz
, those primarily pulls from the "classification" column, right? I guess I can go in and just over-write 'original_classification' to 'classification' if I don't like the taskcorr
output...
Alright, sorry about that! 👍 Disregard me just wildly jumping into things 😅
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 think it's pretty easy to fix now (since we use csvs), but once we switch to json files for the decompositions it will probably be a good idea to come back to this and to come up with a programmatic solution.
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.
@rmarkello , I might like your idea more.
@tsalo , @emdupre , what do you think?
tedana/workflows/post_taskcorr.py
Outdated
@@ -0,0 +1,259 @@ | |||
""" | |||
Quick hack for tedana, from HBM Hackathon 2019. |
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.
Can we update the description here to be directly helpful to the user ?
tedana/workflows/post_taskcorr.py
Outdated
""" | ||
Quick hack for tedana, from HBM Hackathon 2019. | ||
TODO: | ||
- let user decide wether they want NCC or simple correlation. |
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.
- let user decide wether they want NCC or simple correlation. | |
- let user decide whether they want NCC or simple correlation. |
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.
You're still missing this correction.
tedana/workflows/post_taskcorr.py
Outdated
Quick hack for tedana, from HBM Hackathon 2019. | ||
TODO: | ||
- let user decide wether they want NCC or simple correlation. | ||
- Better threshold. |
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.
Can we clarify this so it's clearer for future developers ?
tedana/workflows/post_taskcorr.py
Outdated
# https://stackoverflow.com/a/43456577 | ||
optional = parser._action_groups.pop() | ||
required = parser.add_argument_group('required arguments') | ||
required.add_argument('-td', '--ted-dir', |
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.
Let's just call this --dir
and -d
to make things a little more straightforward.
This is still missing tests ! |
This PR was developed during HBM Hackathon 2019.
It's a little script to let the user accept or reject a component in a post-ICA run, based on a input timeseries.
Useful in case a component gets constantly badly categorised (in the scope of a particular study, such as BreathHolding tasks).
tedana has to be run first.
Closes # .
Changes proposed in this pull request: