Skip to content
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

[REF] Modularize io #692

Merged
merged 42 commits into from
Apr 1, 2021
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
aa1ba7c
Covers non-verbose non-global mod
Feb 23, 2021
685a162
Adds .swp to gitignore
Feb 23, 2021
8f2c648
Merge remote-tracking branch 'tsalo/ref/filenames-and-variables' into…
Feb 23, 2021
83ffe2e
Adds full image functionality
Feb 23, 2021
a82f6f6
Revert z-scoring fix
Feb 24, 2021
8d08f71
Fixes ICA component miss
Feb 24, 2021
1c395ef
Fix style
Feb 24, 2021
a5490a0
Merge remote-tracking branch 'tsalo/ref/filenames-and-variables' into…
Feb 24, 2021
3ea7ba4
Adds --prefix, --convention to t2map.py
Mar 12, 2021
daf16ce
Fix io tests
Mar 12, 2021
fe67e02
Adds clarifying comment
Mar 12, 2021
2403af8
Nest dict, move to new file constants.py
Mar 15, 2021
fad0845
Switches bids pointer method
Mar 15, 2021
7b0af33
Adds tsv and json tables
Mar 15, 2021
e479836
Adds tables for json/tsv
Mar 15, 2021
1135968
Address @handwerkerd comments
Mar 16, 2021
01ceae9
Add documentation and rearrange module
Mar 17, 2021
8df1331
Adds module text for constants.py
Mar 18, 2021
d5ce0f3
Adds set_convention
Mar 18, 2021
61ba799
Adds set_prefix function
Mar 18, 2021
e55a5ca
Fixes style
Mar 18, 2021
0f52846
Actually fix things
Mar 18, 2021
7b955b2
Clarifies PCA docstring
Mar 19, 2021
b93071a
Update tedana/decomposition/pca.py
jbteves Mar 19, 2021
5fdcd88
Update tedana/io.py
jbteves Mar 19, 2021
cdbe1e4
Update tedana/io.py
jbteves Mar 19, 2021
6d93468
Update tedana/io.py
jbteves Mar 19, 2021
02726df
Update tedana/io.py
jbteves Mar 19, 2021
c349c0d
Update tedana/io.py
jbteves Mar 19, 2021
fff9c61
Merge branch 'modularize-io' of github.com:jbteves/tedana into modula…
Mar 19, 2021
63903a4
Addresses some review concerns
Mar 19, 2021
482851d
Switches tables to json files
Mar 19, 2021
c3aba1c
Revert "Addresses some review concerns"
Mar 19, 2021
b2a4b09
Fix global issue
Mar 22, 2021
dc1bb63
Work around 3.5
Mar 22, 2021
017c861
Actually fix the string conversion
Mar 22, 2021
84aa513
Fixes missing desc-
Mar 22, 2021
6b6cdff
Revert "Fixes missing desc-"
Mar 22, 2021
9ba0ec9
Replace hard-coded T2starmap with io call
Mar 22, 2021
0c87c74
Fixes docstring for io.py
Mar 23, 2021
9d15926
Fix space
Mar 23, 2021
1b61d7f
Fix space
Mar 23, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -108,4 +108,7 @@ ENV/

# jupyter notebooks
.ipynb_checkpoints/
*.ipynb
*.ipynb

# vim swap files
*.swp
5 changes: 5 additions & 0 deletions .zenodo.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@
"affiliation": "Montreal Neurological Institute, McGill University",
"orcid": "0000-0003-1358-196X"
},
{
"name": "Gonzalez-Castillo, Javier",
"affiliation": "National Institutes of Health",
"orcid": "0000-0002-6520-5125"
},
{
"name": "Handwerker, Dan",
"affiliation": "National Institutes of Health",
Expand Down
16 changes: 11 additions & 5 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,19 +49,25 @@ representative at an online or offline event.
## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting Elizabeth DuPre at <elizabeth.dupre@mail.mcgill.ca>.
reported by contacting our
[Code of Conduct Enforcement Team](https://tedana.readthedocs.io/en/stable/governance.html#leadership):
[Elizabeth Dupre](https://github.com/emdupre),
[Dan Handwerker](https://github.com/handwerkerd),
and [Stefano Moia](https://github.com/smoia).
Confidentiality will be respected in reporting.

As the first interim [Benevolent Dictator for Life (BDFL)](https://en.wikipedia.org/wiki/Benevolent_dictator_for_life),
Elizabeth DuPre can take any action she deems appropriate
for the safety of the `tedana` community, including but not limited to:
The Code of Conduct Enforcement Team any take any action they deem
necessary for the safety of the `tedana` community, including but not
limited to:

* facilitating a conversation between the two parties involved in the violation of the code of conduct
* requesting a contributor apologize for their behaviour
* asking a contributor or multiple contributors to enter a cooling off period that puts a
time-limited pause on a particular discussion topic
* asking a contributor to no longer participate in the development of `tedana`

For more details on the enforcement process, please see our documentation
on [governance](https://tedana.readthedocs.io/en/stable/governance.html).

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
Expand Down
3 changes: 3 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,9 @@ You can see a list of current contributors in the README
(kept up to date by the [all contributors bot][link_all-contributors-bot]).
You can see [here][link_all-contributors-bot-usage] for instructions on
how to use the bot.
We encourage all contributors to write a brief statement and self-describe how they feel they've
contributed, showcased [here][contributions.md].
Thanks to all of our wonderful contributors!

## Thank you!

Expand Down
1 change: 0 additions & 1 deletion tedana/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
__version__,
__author__,
__copyright__,
__credits__,
__license__,
__maintainer__,
__email__,
Expand Down
2 changes: 1 addition & 1 deletion tedana/decomposition/pca.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ def tedpca(data_cat, data_oc, combmode, mask, adaptive_mask, t2sG,

# write component maps to 4D image
comp_maps = utils.unmask(computefeats2(data_oc, comp_ts, mask), mask)
io.filewrite(comp_maps, op.join(out_dir, 'desc-PCA_stat-z_components.nii.gz'), ref_img)
io.filewrite(comp_maps, 'z-scored PCA components', ref_img)

# Select components using decision tree
if algorithm == 'kundu':
Expand Down
16 changes: 9 additions & 7 deletions tedana/gscontrol.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def gscontrol_raw(catd, optcom, n_echos, ref_img, out_dir='.', dtrank=4):
sphis -= sphis.mean()
io.filewrite(
utils.unmask(sphis, Gmask),
op.join(out_dir, 'desc-globalSignal_map.nii.gz'),
'gs map',
ref_img
)

Expand All @@ -102,13 +102,13 @@ def gscontrol_raw(catd, optcom, n_echos, ref_img, out_dir='.', dtrank=4):

io.filewrite(
optcom,
op.join(out_dir, 'desc-optcomWithGlobalSignal_bold.nii.gz'),
'has gs combined',
ref_img
)
dm_optcom = utils.unmask(tsoc_nogs, Gmask)
io.filewrite(
dm_optcom,
op.join(out_dir, 'desc-optcomNoGlobalSignal_bold.nii.gz'),
'removed gs combined',
ref_img
)

Expand Down Expand Up @@ -219,7 +219,9 @@ def minimum_image_regression(optcom_ts, mmix, mask, comptable, ref_img, out_dir=
t1_map = mehk_ts.min(axis=-1) # map of T1-like effect
t1_map -= t1_map.mean()
io.filewrite(
utils.unmask(t1_map, mask), op.join(out_dir, "desc-T1likeEffect_min.nii.gz"), ref_img
utils.unmask(t1_map, mask),
't1 like',
ref_img
)
t1_map = t1_map[:, np.newaxis]

Expand All @@ -233,15 +235,15 @@ def minimum_image_regression(optcom_ts, mmix, mask, comptable, ref_img, out_dir=
hik_ts = mehk_noT1gs * optcom_std # rescale
io.filewrite(
utils.unmask(hik_ts, mask),
op.join(out_dir, "desc-optcomAcceptedMIRDenoised_bold.nii.gz"),
'ICA accepted mir denoised',
ref_img,
)

# Make denoised version of T1-corrected time series
medn_ts = optcom_mean + ((mehk_noT1gs + resid) * optcom_std)
io.filewrite(
utils.unmask(medn_ts, mask),
op.join(out_dir, "desc-optcomMIRDenoised_bold.nii.gz"),
'mir denoised',
ref_img,
)

Expand All @@ -258,7 +260,7 @@ def minimum_image_regression(optcom_ts, mmix, mask, comptable, ref_img, out_dir=
comp_pes_norm = np.linalg.lstsq(mmix_noT1gs_z.T, optcom_z.T, rcond=None)[0].T
io.filewrite(
utils.unmask(comp_pes_norm[:, 2:], mask),
op.join(out_dir, "desc-ICAAcceptedMIRDenoised_components.nii.gz"),
'ICA accepted mir component weights',
ref_img,
)
mixing_df = pd.DataFrame(data=mmix_noT1gs.T, columns=comptable["Component"].values)
Expand Down
2 changes: 0 additions & 2 deletions tedana/info.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@

__author__ = 'tedana developers'
__copyright__ = 'Copyright 2018, tedana developers'
__credits__ = ['Elizabeth DuPre', 'Prantik Kundu', 'Ross Markello',
'Taylor Salo', 'Kirstie Whitaker', 'Dan Handwerker']
__license__ = 'LGPL 2.1'
__maintainer__ = 'Elizabeth DuPre'
__email__ = 'emd222@cornell.edu'
Expand Down
Loading