Skip to content

Commit 6de7c6d

Browse files
committed
🔀 Merge 'develop' into 'enh/guardrails'
Squashed commit of the following: commit 356dc30 Merge: b1ce64b 55667a2 Author: Steve Giavasis <[email protected]> Date: Fri Oct 14 16:33:28 2022 -0400 Merge pull request #1778 from FCP-INDI/deeper-config-path 🚚 Move C-PAC generated configs into `log/sub-${sub}_ses-${ses}` subdirectory commit b1ce64b Merge: 37a6874 c6ec0a0 Author: Steve Giavasis <[email protected]> Date: Fri Oct 14 16:33:19 2022 -0400 Merge pull request #1769 from FCP-INDI/feature/total_readout_time Ingress and use TotalReadoutTime from epi fmap meta-data in FSL topup commit c6ec0a0 Merge: 8301e3c 37a6874 Author: Steve Giavasis <[email protected]> Date: Fri Oct 14 16:03:28 2022 -0400 Merge branch 'develop' into feature/total_readout_time commit 8301e3c Author: Steve Giavasis <[email protected]> Date: Fri Oct 14 15:56:44 2022 -0400 Revert to using dwell time first to maintain original DCAN script's functionality commit 55667a2 Author: Jon Clucas <[email protected]> Date: Fri Oct 14 15:55:55 2022 -0400 :art: Include minimized pipeline config in hardlinking step commit a641d00 Author: Jon Clucas <[email protected]> Date: Fri Oct 14 15:44:42 2022 -0400 :lock: Make generated config files read-only Co-authored-by: Steve Giavasis <[email protected]> commit 37a6874 Merge: b5d0d1f 5b2465f Author: Steve Giavasis <[email protected]> Date: Fri Oct 14 15:46:39 2022 -0400 Merge pull request #1787 from diegoaper/main 🐛 ✅ Group Runner 1.8 and MDMR Changes commit cb5bc42 Merge: 9c0a89c b5d0d1f Author: Jon Clucas <[email protected]> Date: Fri Oct 14 15:37:53 2022 -0400 :twisted_rightwards_arrows: Merge develop into deeper-config-path commit b5d0d1f Merge: 7f50838 dc3f113 Author: Steve Giavasis <[email protected]> Date: Fri Oct 14 15:19:13 2022 -0400 Merge pull request #1796 from clane9/bugfix/random_seed 🐛 fix type handling in `set_up_random_state` commit dc3f113 Merge: 0ccc40d 7f50838 Author: Steve Giavasis <[email protected]> Date: Fri Oct 14 15:18:31 2022 -0400 Merge branch 'develop' into bugfix/random_seed commit 7f50838 Merge: 8ebf0a7 c2ba9d6 Author: Steve Giavasis <[email protected]> Date: Fri Oct 14 15:17:39 2022 -0400 Merge pull request #1790 from FCP-INDI/backwards-compatibility/default_pipeline.yml ⚰️ Add placeholder default_pipeline.yml for backwards compatibility commit 8ebf0a7 Merge: fd91a42 0182f98 Author: Steve Giavasis <[email protected]> Date: Fri Oct 14 15:16:59 2022 -0400 Merge pull request #1788 from FCP-INDI/rbc-update 🔧 Base `rbc-options` on `fmriprep-options`' preproc commit fd91a42 Merge: 6b402b0 76a4a75 Author: Steve Giavasis <[email protected]> Date: Fri Oct 14 15:16:14 2022 -0400 Merge pull request #1781 from FCP-INDI/fix/FUGUE--dwell 🐛 Fix `FUGUE --dwell` parameterization commit 0ccc40d Author: Connor Lane <[email protected]> Date: Thu Oct 13 16:55:12 2022 -0400 move changelog entry to the unreleased section commit b5c742a Author: Connor Lane <[email protected]> Date: Wed Oct 12 17:43:26 2022 -0400 update changelog commit 6b402b0 Author: Jon Clucas <[email protected]> Date: Wed Oct 12 16:12:59 2022 -0400 fixup! :fast_forward: Bring `develop` up to date with `main` commit 5867210 Author: Connor Lane <[email protected]> Date: Wed Oct 12 09:48:39 2022 -0400 :bug: fix type handling in `set_up_random_state` commit 5b2465f Author: diegoaper <[email protected]> Date: Tue Oct 11 11:48:57 2022 -0400 Removed participant Configuration commit 92f9658 Author: diegoaper <[email protected]> Date: Mon Oct 10 14:09:46 2022 -0400 Update cpac_group_runner.py commit a112d34 Author: diegoaper <[email protected]> Date: Mon Oct 10 10:40:56 2022 -0400 Update CPAC/pipeline/cpac_group_runner.py Co-authored-by: Jon Clucas <[email protected]> commit 031946a Author: diegoaper <[email protected]> Date: Mon Oct 10 10:40:35 2022 -0400 Update CPAC/pipeline/cpac_group_runner.py Co-authored-by: Jon Clucas <[email protected]> commit df2bb33 Author: diegoaper <[email protected]> Date: Mon Oct 10 10:40:00 2022 -0400 Update CPAC/pipeline/cpac_group_runner.py Co-authored-by: Jon Clucas <[email protected]> commit c5d306d Author: diegoaper <[email protected]> Date: Mon Oct 10 10:39:46 2022 -0400 Update CPAC/pipeline/cpac_group_runner.py Co-authored-by: Jon Clucas <[email protected]> commit e903b98 Author: diegoaper <[email protected]> Date: Mon Oct 10 10:39:16 2022 -0400 Update CPAC/pipeline/cpac_group_runner.py Co-authored-by: Jon Clucas <[email protected]> commit 82e2ece Author: diegoaper <[email protected]> Date: Mon Oct 10 10:38:50 2022 -0400 Update CPAC/pipeline/cpac_group_runner.py Co-authored-by: Jon Clucas <[email protected]> commit d75dbe3 Author: diegoaper <[email protected]> Date: Mon Oct 10 10:38:32 2022 -0400 Update CPAC/pipeline/cpac_group_runner.py Co-authored-by: Jon Clucas <[email protected]> commit 9407c63 Author: diegoaper <[email protected]> Date: Mon Oct 10 10:38:11 2022 -0400 Update CPAC/pipeline/cpac_group_runner.py Co-authored-by: Jon Clucas <[email protected]> commit 61097e3 Merge: 0ba271a 750c9ec Author: diegoaper <[email protected]> Date: Mon Oct 10 10:37:40 2022 -0400 Merge branch 'main' of https://github.com/diegoaper/C-PAC_MDMR-Group_Runner commit 0ba271a Author: diegoaper <[email protected]> Date: Mon Oct 10 10:37:29 2022 -0400 Update cpac_group_runner.py commit 750c9ec Author: diegoaper <[email protected]> Date: Mon Oct 10 10:37:04 2022 -0400 Update CPAC/pipeline/cpac_group_runner.py Co-authored-by: Jon Clucas <[email protected]> commit cf81d08 Author: diegoaper <[email protected]> Date: Fri Oct 7 17:36:52 2022 -0400 Update CPAC/pipeline/cpac_group_runner.py Co-authored-by: Jon Clucas <[email protected]> commit e570fbf Author: diegoaper <[email protected]> Date: Fri Oct 7 17:36:38 2022 -0400 Update CPAC/pipeline/cpac_group_runner.py Co-authored-by: Jon Clucas <[email protected]> commit 2eea1f4 Author: diegoaper <[email protected]> Date: Fri Oct 7 17:35:59 2022 -0400 Update CPAC/pipeline/cpac_group_runner.py Co-authored-by: Jon Clucas <[email protected]> commit 99620c6 Author: diegoaper <[email protected]> Date: Fri Oct 7 17:35:44 2022 -0400 Update CPAC/pipeline/cpac_group_runner.py Co-authored-by: Jon Clucas <[email protected]> commit cf8f0d9 Author: diegoaper <[email protected]> Date: Fri Oct 7 17:33:11 2022 -0400 Update CPAC/pipeline/cpac_group_runner.py Co-authored-by: Jon Clucas <[email protected]> commit de6235f Author: diegoaper <[email protected]> Date: Fri Oct 7 17:32:40 2022 -0400 Update CPAC/pipeline/cpac_group_runner.py Co-authored-by: Jon Clucas <[email protected]> commit ebe6a27 Author: diegoaper <[email protected]> Date: Fri Oct 7 17:32:26 2022 -0400 Update CPAC/pipeline/cpac_group_runner.py Co-authored-by: Jon Clucas <[email protected]> commit c50db8d Author: diegoaper <[email protected]> Date: Fri Oct 7 17:30:13 2022 -0400 Update CPAC/pipeline/cpac_group_runner.py Co-authored-by: Jon Clucas <[email protected]> commit 748f376 Author: diegoaper <[email protected]> Date: Fri Oct 7 17:29:26 2022 -0400 Update CPAC/cwas/pipeline.py Co-authored-by: Jon Clucas <[email protected]> commit 6d938f4 Author: diegoaper <[email protected]> Date: Fri Oct 7 17:28:55 2022 -0400 Update CPAC/cwas/pipeline.py Co-authored-by: Jon Clucas <[email protected]> commit 0b2b868 Author: diegoaper <[email protected]> Date: Fri Oct 7 17:28:20 2022 -0400 Update CPAC/cwas/pipeline.py Co-authored-by: Jon Clucas <[email protected]> commit 281427d Author: diegoaper <[email protected]> Date: Fri Oct 7 17:27:24 2022 -0400 Update CPAC/cwas/cwas.py Co-authored-by: Jon Clucas <[email protected]> commit 63c3ad4 Author: diegoaper <[email protected]> Date: Fri Oct 7 17:27:15 2022 -0400 Update CPAC/cwas/cwas.py Co-authored-by: Jon Clucas <[email protected]> commit ca75679 Author: diegoaper <[email protected]> Date: Fri Oct 7 17:27:05 2022 -0400 Update CPAC/cwas/cwas.py Co-authored-by: Jon Clucas <[email protected]> commit 22ed56a Author: diegoaper <[email protected]> Date: Fri Oct 7 17:26:54 2022 -0400 Update CPAC/cwas/cwas.py Co-authored-by: Jon Clucas <[email protected]> commit 490e319 Author: diegoaper <[email protected]> Date: Fri Oct 7 17:26:32 2022 -0400 Update CPAC/cwas/cwas.py Co-authored-by: Jon Clucas <[email protected]> commit 8462865 Author: diegoaper <[email protected]> Date: Fri Oct 7 17:25:57 2022 -0400 Update CPAC/resources/configs/group_config_template.yml Co-authored-by: Jon Clucas <[email protected]> commit 3269c0e Author: diegoaper <[email protected]> Date: Fri Oct 7 17:25:14 2022 -0400 Update CPAC/pipeline/cpac_group_runner.py Co-authored-by: Jon Clucas <[email protected]> commit bb6458b Author: diegoaper <[email protected]> Date: Fri Oct 7 17:22:33 2022 -0400 Update CPAC/pipeline/cpac_group_runner.py Co-authored-by: Jon Clucas <[email protected]> commit fe1dff4 Author: diegoaper <[email protected]> Date: Fri Oct 7 17:22:25 2022 -0400 Update CPAC/cwas/cwas.py Co-authored-by: Jon Clucas <[email protected]> commit 6fcb279 Author: diegoaper <[email protected]> Date: Fri Oct 7 17:22:10 2022 -0400 Update CPAC/cwas/cwas.py Co-authored-by: Jon Clucas <[email protected]> commit f25b604 Author: diegoaper <[email protected]> Date: Fri Oct 7 17:22:04 2022 -0400 Update CPAC/cwas/cwas.py Co-authored-by: Jon Clucas <[email protected]> commit 35318a5 Author: diegoaper <[email protected]> Date: Fri Oct 7 17:21:52 2022 -0400 Update CPAC/cwas/cwas.py Co-authored-by: Jon Clucas <[email protected]> commit 6ccce46 Author: diegoaper <[email protected]> Date: Fri Oct 7 17:20:28 2022 -0400 Update CPAC/cwas/cwas.py Co-authored-by: Jon Clucas <[email protected]> commit 6dc4a2b Author: diegoaper <[email protected]> Date: Fri Oct 7 10:55:53 2022 -0400 Update cpac_outputs.tsv Added 2 lines for MDMR group_analysis output commit b6ed208 Author: diegoaper <[email protected]> Date: Fri Oct 7 10:48:47 2022 -0400 Update group_config_template.yml commit 2ab1d64 Author: diegoaper <[email protected]> Date: Fri Oct 7 10:48:09 2022 -0400 Fixed 1.8.4 image intake Fixed the intake for images to make the 1.8.4 BIDS convention. commit 68e3416 Merge: 32632fa 9586d71 Author: Jon Clucas <[email protected]> Date: Fri Oct 7 10:20:22 2022 -0400 :fast_forward: Bring `develop` up to date with `main` commit c2ba9d6 Author: Jon Clucas <[email protected]> Date: Wed Oct 5 15:16:39 2022 -0400 :coffin: Add placeholder default_pipeline.yml for backwards compatibility [skip ci] commit 76a4a75 Author: Jon Clucas <[email protected]> Date: Wed Oct 5 17:51:41 2022 +0000 :recycle: Send 'desc-mean_bold' as input to `distcor_blip_fsl_topup` Co-authored-by: Steve Giavasis <[email protected]> commit 0182f98 Author: Jon Clucas <[email protected]> Date: Wed Oct 5 11:12:03 2022 -0400 :memo: Add rbc-options update to CHANGELOG [skip ci] Co-authored-by: Greg Kiar <[email protected]> commit 5208944 Author: Jon Clucas <[email protected]> Date: Tue Oct 4 17:00:49 2022 -0400 :wrench: Base rbc-options on fmriprep-options Co-authored-by: Greg Kiar <[email protected]> commit 1ab4086 Author: Jon Clucas <[email protected]> Date: Tue Oct 4 20:48:57 2022 +0000 :recycle: Replumb to prevent wild TOPUP forking Co-authored-by: Steve Giavasis <[email protected]> commit c3ac6ac Author: diegoaper <[email protected]> Date: Tue Oct 4 15:48:30 2022 -0400 MDMR Group Config Template Update to the scripts and config template commit eee5461 Author: Jon Clucas <[email protected]> Date: Fri Sep 30 21:21:15 2022 +0000 :recycle: Fix cyclical imports commit db27851 Author: Jon Clucas <[email protected]> Date: Fri Sep 30 16:37:46 2022 -0400 :alien: Import typehints in function node commit c148153 Author: Jon Clucas <[email protected]> Date: Fri Sep 30 15:41:34 2022 +0000 :loud_sound: Add FSL-`DwellTime` fix to CHANGELOG [skip ci] Co-authored-by: Nathalia Esper <[email protected]> Co-authored-by: Alex Franco <[email protected]> commit e53581b Author: Jon Clucas <[email protected]> Date: Fri Sep 30 15:27:52 2022 +0000 :bug: Fix import path commit 2338585 Author: Jon Clucas <[email protected]> Date: Fri Sep 30 15:24:38 2022 +0000 :page_facing_up: Add/update LGPL-3-or-later notice to modified files [skip ci] commit 109d536 Author: Jon Clucas <[email protected]> Date: Fri Sep 30 15:11:39 2022 +0000 :recycle: Only look for `EffectiveEchoSpacing` in functional sidecar commit 695d29a Author: Jon Clucas <[email protected]> Date: Fri Sep 30 14:41:04 2022 +0000 :rotating_light: Remove duplicate good-name [skip ci] commit c9bea18 Author: Jon Clucas <[email protected]> Date: Fri Sep 30 14:37:12 2022 +0000 :recycle: DRY and let `calc_delta_te_and_asym_ratio` determine EES source commit 55ca4d9 Author: Jon Clucas <[email protected]> Date: Thu Sep 29 14:09:12 2022 +0000 :bug: Fix logic checking for `diffphase-effectiveEchoSpacing` commit d41dc29 Author: Jon Clucas <[email protected]> Date: Wed Sep 28 12:42:26 2022 -0400 :bug: Only connect calc_delta_ratio if diff commit ca86b0b Author: Jon Clucas <[email protected]> Date: Wed Sep 28 09:56:32 2022 -0400 :bug: Fix plumbing for EffectiveEchoSpacing commit f7ca070 Author: Jon Clucas <[email protected]> Date: Tue Sep 27 17:26:49 2022 -0400 :recycle: Get EffectiveEchoSpacing from func metadata if possible commit 376d550 Author: Jon Clucas <[email protected]> Date: Tue Sep 27 15:19:59 2022 -0400 :bug: Update DwellTime → EffectiveEchoSpacing for FSL FUGUE Co-authored-by: Nathalia Esper <[email protected]> Co-authored-by: Alex Franco <[email protected]> commit 32632fa Merge: eed40c5 238f499 Author: Steve Giavasis <[email protected]> Date: Mon Sep 26 13:23:08 2022 -0400 Merge pull request #1777 from FCP-INDI/differentiate-sametime-data-configs 🐛 Differentiate sametime data and pipeline configs commit eed40c5 Merge: 76eb34d a64541e Author: Steve Giavasis <[email protected]> Date: Mon Sep 26 13:22:50 2022 -0400 Merge pull request #1775 from FCP-INDI/deeper-working-path 🚚 Use `f'pipeline_{pipeline_name}'` subdirectories for `log`, `working`, and `output` commit 76eb34d Author: sgiavasis <[email protected]> Date: Mon Sep 26 17:21:02 2022 +0000 Merge resolution for latest nuisance and native/template-space options changes. commit b30a2e0 Merge: 1e24c69 ea18242 Author: sgiavasis <[email protected]> Date: Sun Sep 25 08:30:26 2022 +0000 Merge branch 'dev-fix' into develop commit ea18242 Author: sgiavasis <[email protected]> Date: Sun Sep 25 08:27:49 2022 +0000 Staging changes from template-space derivatives for next release. commit 9c0a89c Author: Jon Clucas <[email protected]> Date: Fri Sep 23 12:48:29 2022 -0400 :bug: Create nested working directory before writing PID to disk commit d50f8da Author: Jon Clucas <[email protected]> Date: Fri Sep 23 12:26:11 2022 -0400 :recycle: Move PID on disk one level deeper in working directory commit 137c482 Author: Jon Clucas <[email protected]> Date: Fri Sep 23 12:17:07 2022 -0400 :recycle: Modularize checking p_name commit 1899c9e Author: Jon Clucas <[email protected]> Date: Fri Sep 23 10:50:41 2022 -0400 :truck: Nest `failedToStart.log` as deeply as possible commit ed554a6 Merge: 0490394 a64541e Author: Jon Clucas <[email protected]> Date: Fri Sep 23 10:33:30 2022 -0400 :twisted_rightwards_arrow: Merge develop into deeper-config-path commit 238f499 Merge: 68ac96a 1e24c69 Author: Jon Clucas <[email protected]> Date: Fri Sep 23 10:19:13 2022 -0400 :twisted_rightwards_arrows: Merge develop into differentiate-sametime-data-configs commit a64541e Merge: e5ec37c 1e24c69 Author: Jon Clucas <[email protected]> Date: Fri Sep 23 10:14:02 2022 -0400 :twisted_rightwards_arrows: Merge develop into deeper-working-path commit 0490394 Author: Jon Clucas <[email protected]> Date: Thu Sep 22 14:38:02 2022 -0400 :pencil2: Set c['subject_id'] commit f3aefca Author: Jon Clucas <[email protected]> Date: Thu Sep 22 12:20:57 2022 -0400 :truck: Move C-PAC-generated data and pipeline configs one level deeper commit 2ed4d6a Author: Jon Clucas <[email protected]> Date: Thu Sep 22 11:21:48 2022 -0400 :truck: Move C-PAC-generated config files into log dir commit 19c3890 Merge: e5ec37c 68ac96a Author: Jon Clucas <[email protected]> Date: Thu Sep 22 10:59:04 2022 -0400 :twisted_rightwards_arrows: Merge differentiate-sametime-data-configs into deeper-config-path commit 68ac96a Author: Jon Clucas <[email protected]> Date: Wed Sep 21 17:37:02 2022 -0400 :white_check_mark: Add unit test for hash_data_config commit 6003194 Author: Jon Clucas <[email protected]> Date: Wed Sep 21 17:07:57 2022 -0400 :loud_sound: Add config hash string update to CHANGELOG commit e5ec37c Merge: e09cfa0 14e1591 Author: Jon Clucas <[email protected]> Date: Wed Sep 21 16:36:39 2022 -0400 :twisted_rightwards_arrows: Merge develop into deeper-working-path commit e09cfa0 Author: Jon Clucas <[email protected]> Date: Wed Sep 21 16:13:35 2022 -0400 :bug: Change working path update location commit 9586d71 Merge: 12c4f74 94d8082 Author: Steve Giavasis <[email protected]> Date: Mon Sep 19 21:31:01 2022 -0400 Merge pull request #1764 from FCP-INDI/fix/pipeline-config-versions 🔖 Hotfix: Update version to 1.8.4 commit 94d8082 Author: sgiavasis <[email protected]> Date: Tue Sep 20 01:27:46 2022 +0000 Fix Neurostars link in the README. commit 8804f61 Author: Jon Clucas <[email protected]> Date: Fri Sep 16 15:23:00 2022 -0400 :art: Rename `f'cpac_{pipeline_name}'` directories to `f'pipeline_{pipeline_name}'` to match `output`, `log`, and `working` subdirectories Co-authored-by: Steve Giavasis <[email protected]> commit 77a1c5c Author: Jon Clucas <[email protected]> Date: Fri Sep 16 15:13:12 2022 -0400 :truck: Add pipeline-config-level directory for participant working directories commit 7718419 Author: Jon Clucas <[email protected]> Date: Fri Sep 16 14:49:31 2022 -0400 :goal_net: Sanitize `pipeline_name` during validation commit ce6dd09 Author: sgiavasis <[email protected]> Date: Fri Sep 9 18:51:27 2022 +0000 Updated changelog. commit 7f42613 Author: sgiavasis <[email protected]> Date: Fri Sep 9 18:45:47 2022 +0000 Improved the error message for missing epi field map meta-data. commit d43aa6c Author: sgiavasis <[email protected]> Date: Fri Sep 9 04:14:31 2022 +0000 Read in TotalReadoutTime from field map metadata, if it exists. Pass TotalReadoutTime to FSL TOPUP if present. commit 9453398 Author: Theodore (Machine User) <[email protected]> Date: Wed Aug 31 17:42:23 2022 +0000 :bookmark: Update version to 1.8.4 (:construction_worker: Differentiate between Git branches and tags for Docker tags)
1 parent e9359c2 commit 6de7c6d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+1395
-1209
lines changed

.pylintrc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ contextmanager-decorators=contextlib.contextmanager
291291
# List of members which are set dynamically and missed by pylint inference
292292
# system, and so shouldn't trigger E1101 when accessed. Python regular
293293
# expressions are accepted.
294-
generated-members=
294+
generated-members=CPAC.utils.configuration.configuration.Configuration.*
295295

296296
# Tells whether missing members accessed in mixin class should be ignored. A
297297
# mixin class is detected if its name ends with "mixin" (case insensitive).
@@ -435,6 +435,7 @@ good-names=c,
435435
ex,
436436
nb,
437437
Run,
438+
TR,
438439
v,
439440
wf,
440441
_,
@@ -443,6 +444,7 @@ good-names=c,
443444
# they will always be accepted
444445
good-names-rgxs=^_version_(extra|m[a-n]{2}[or]{2})$, # version parts in info.py
445446
.*EPI.*,
447+
.*TE.*,
446448
.*T1.*,
447449
.*T2.*
448450

CHANGELOG.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,31 @@ All notable changes to this project will be documented in this file.
1414
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
1515
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
1616

17-
## [Unreleased]
17+
## [unreleased]
1818

1919
### Added
2020
- Added the ability to downsample to 10K or 2K resolution for freesurfer runs
21+
- Added the ability to ingress TotalReadoutTime from epi field map meta-data from the JSON sidecars.
22+
- Added the ability to use TotalReadoutTime of epi field maps in the calculation of FSL topup distortion correction.
2123
- Added ability to set minimum quality measure thresholds to all registration steps
2224
- Difference method (``-``) for ``CPAC.utils.configuration.Configuration`` instances
2325

2426
### Changed
27+
- Added a level of depth to `working` directories to match `log` and `output` directory structure
28+
- Renamed participant-pipeline-level `output` directory prefix to `pipeline_` to match `log` and `working` paths
2529
- Changed the 1mm atlases chosen in the rbc-options preconfig to the 2mm versions
2630
- For Nilearn-generated correlation matrices, diagonals are now set to all `1`s (were all `0`s)
2731
- Added ability to apply nusiance correction to template-space BOLD images
2832
- Removed ability to run single-step-resampling on motion-corrected BOLD data
2933
- Moved default pipeline config into directory with other preconfigs
3034
- Added crash messages from during and before graph building to logs
35+
- Added data-config-specific hash string to C-PAC-generated config files
36+
- Updated `rbc-options` preconfig to use `fmriprep-options` preprocessing
3137

3238
### Fixed
39+
- Fixed [bug](https://github.com/FCP-INDI/C-PAC/issues/1795) that was causing `cpac run` to fail when passing a manual random seed via `--random_seed`.
40+
- Replaces ``DwellTime`` with ``EffectiveEchoSpacing`` for FSL usage of the term
41+
- Fixed an issue that was causing some epi field maps to not be ingressed if the BIDS tags were not in the correct order.
3342

3443
## [v1.8.4] - 2022-06-27
3544

CPAC/alff/alff.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -246,8 +246,8 @@ def alff_falff(wf, cfg, strat_pool, pipe_num, opt=None):
246246
"switch": ["run"],
247247
"option_key": "None",
248248
"option_val": "None",
249-
"inputs": [["desc-cleaned_bold", "desc-brain_bold", "desc-preproc_bold",
250-
"bold"],
249+
"inputs": [["desc-cleanedNofilt_bold", "desc-brain_bold",
250+
"desc-preproc_bold", "bold"],
251251
"space-bold_desc-brain_mask"],
252252
"outputs": ["alff",
253253
"falff"]}
@@ -262,7 +262,7 @@ def alff_falff(wf, cfg, strat_pool, pipe_num, opt=None):
262262
alff.get_node('hp_input').iterables = ('hp', alff.inputs.hp_input.hp)
263263
alff.get_node('lp_input').iterables = ('lp', alff.inputs.lp_input.lp)
264264

265-
node, out = strat_pool.get_data(["desc-cleaned_bold", "desc-brain_bold",
265+
node, out = strat_pool.get_data(["desc-cleanedNofilt_bold", "desc-brain_bold",
266266
"desc-preproc_bold", "bold"])
267267
wf.connect(node, out, alff, 'inputspec.rest_res')
268268

CPAC/cwas/cwas.py

Lines changed: 34 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
import nibabel as nb
44
import numpy as np
55
import pandas as pd
6+
import scipy.stats
7+
from scipy.stats import t
8+
from numpy import inf
69

710
from CPAC.cwas.mdmr import mdmr
811
from CPAC.utils import correlation
@@ -35,7 +38,6 @@ def joint_mask(subjects, mask_file=None):
3538
mask_file = os.path.join(os.getcwd(), 'joint_mask.nii.gz')
3639
create_merged_copefile(files, cope_file)
3740
create_merge_mask(cope_file, mask_file)
38-
3941
return mask_file
4042

4143

@@ -48,7 +50,6 @@ def calc_mdmrs(D, regressor, cols, permutations):
4850
def calc_subdists(subjects_data, voxel_range):
4951
subjects, voxels, _ = subjects_data.shape
5052
D = np.zeros((len(voxel_range), subjects, subjects))
51-
5253
for i, v in enumerate(voxel_range):
5354
profiles = np.zeros((subjects, voxels))
5455
for si in range(subjects):
@@ -67,6 +68,12 @@ def calc_cwas(subjects_data, regressor, regressor_selected_cols, permutations, v
6768
D, regressor, regressor_selected_cols, permutations)
6869
return F_set, p_set
6970

71+
def pval_to_zval(p_set, permu):
72+
inv_pval = 1 - p_set
73+
zvals = t.ppf(inv_pval, (len(p_set) - 1))
74+
zvals[zvals == -inf] = permu / (permu + 1)
75+
zvals[zvals == inf] = permu / (permu + 1)
76+
return zvals
7077

7178
def nifti_cwas(subjects, mask_file, regressor_file, participant_column,
7279
columns_string, permutations, voxel_range):
@@ -130,7 +137,7 @@ def nifti_cwas(subjects, mask_file, regressor_file, participant_column,
130137
for sub_id in subject_ids:
131138
if str(sub_id).lstrip('0') == str(pheno_sub_id):
132139
regressor_data.at[index, participant_column] = str(sub_id)
133-
140+
134141
regressor_data.index = regressor_data[participant_column]
135142

136143
# Keep only data from specific subjects
@@ -144,33 +151,27 @@ def nifti_cwas(subjects, mask_file, regressor_file, participant_column,
144151
if len(regressor_selected_cols) == 0:
145152
regressor_selected_cols = [i for i, c in enumerate(regressor_cols)]
146153
regressor_selected_cols = np.array(regressor_selected_cols)
147-
148154
# Remove participant id column from the dataframe and convert it to a numpy matrix
149155
regressor = ordered_regressor_data \
150156
.drop(columns=[participant_column]) \
151157
.reset_index(drop=True) \
152158
.values \
153159
.astype(np.float64)
154-
155160
if len(regressor.shape) == 1:
156161
regressor = regressor[:, np.newaxis]
157162
elif len(regressor.shape) != 2:
158163
raise ValueError('Bad regressor shape: %s' % str(regressor.shape))
159-
160164
if len(subject_files) != regressor.shape[0]:
161165
raise ValueError('Number of subjects does not match regressor size')
162-
163-
mask = nb.load(mask_file).get_data().astype('bool')
166+
mask = nb.load(mask_file).get_fdata().astype('bool')
164167
mask_indices = np.where(mask)
165-
166168
subjects_data = np.array([
167-
nb.load(subject_file).get_data().astype('float64')[mask_indices].T
169+
nb.load(subject_file).get_fdata().astype('float64')[mask_indices]
168170
for subject_file in subject_files
169171
])
170172

171173
F_set, p_set = calc_cwas(subjects_data, regressor, regressor_selected_cols,
172174
permutations, voxel_range)
173-
174175
cwd = os.getcwd()
175176
F_file = os.path.join(cwd, 'pseudo_F.npy')
176177
p_file = os.path.join(cwd, 'significance_p.npy')
@@ -182,7 +183,7 @@ def nifti_cwas(subjects, mask_file, regressor_file, participant_column,
182183

183184

184185
def create_cwas_batches(mask_file, batches):
185-
mask = nb.load(mask_file).get_data().astype('bool')
186+
mask = nb.load(mask_file).get_fdata().astype('bool')
186187
voxels = mask.sum(dtype=int)
187188
return np.array_split(np.arange(voxels), batches)
188189

@@ -198,7 +199,7 @@ def volumize(mask_image, data):
198199
)
199200

200201

201-
def merge_cwas_batches(cwas_batches, mask_file):
202+
def merge_cwas_batches(cwas_batches, mask_file, z_score, permutations):
202203
_, _, voxel_range = zip(*cwas_batches)
203204
voxels = np.array(np.concatenate(voxel_range))
204205

@@ -211,18 +212,37 @@ def merge_cwas_batches(cwas_batches, mask_file):
211212
p_set[voxel_range] = np.load(p_file)
212213

213214
log_p_set = -np.log10(p_set)
215+
one_p_set = 1 - p_set
214216

215217
F_vol = volumize(mask_image, F_set)
216218
p_vol = volumize(mask_image, p_set)
217219
log_p_vol = volumize(mask_image, log_p_set)
220+
one_p_vol = volumize(mask_image, one_p_set)
218221

219222
cwd = os.getcwd()
220223
F_file = os.path.join(cwd, 'pseudo_F_volume.nii.gz')
221224
p_file = os.path.join(cwd, 'p_significance_volume.nii.gz')
222225
log_p_file = os.path.join(cwd, 'neglog_p_significance_volume.nii.gz')
226+
one_p_file = os.path.join(cwd, 'one_minus_p_values.nii.gz')
223227

224228
F_vol.to_filename(F_file)
225229
p_vol.to_filename(p_file)
226230
log_p_vol.to_filename(log_p_file)
231+
one_p_vol.to_filename(one_p_file)
232+
233+
if 1 in z_score:
234+
zvals = pval_to_zval(p_set, permutations)
235+
z_file = zstat_image(zvals, mask_file)
236+
237+
return F_file, p_file, log_p_file, one_p_file, z_file
238+
239+
def zstat_image(zvals, mask_file):
240+
mask_image = nb.load(mask_file)
227241

228-
return F_file, p_file, log_p_file
242+
z_vol = volumize(mask_image, zvals)
243+
244+
cwd = os.getcwd()
245+
z_file = os.path.join(cwd, 'zstat.nii.gz')
246+
247+
z_vol.to_filename(z_file)
248+
return z_file

CPAC/cwas/mdmr.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,15 +83,15 @@ def mdmr(D, X, columns, permutations):
8383
Gs[:, di] = gower(D[di]).flatten()
8484

8585
X1 = np.hstack((np.ones((subjects, 1)), X))
86-
columns = columns.copy() + 1
86+
columns = columns.copy() #removed a +1
8787

8888
regressors = X1.shape[1]
89-
90-
permutation_indexes = np.zeros((permutations + 1, subjects), dtype=np.int)
89+
90+
permutation_indexes = np.zeros((permutations, subjects), dtype=np.int)
9191
permutation_indexes[0, :] = range(subjects)
92-
for i in range(1, permutations + 1):
92+
for i in range(1, permutations):
9393
permutation_indexes[i,:] = np.random.permutation(subjects)
94-
94+
9595
H2perms = gen_h2_perms(X1, columns, permutation_indexes)
9696
IHperms = gen_ih_perms(X1, columns, permutation_indexes)
9797

CPAC/cwas/pipeline.py

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import os
33
from CPAC.pipeline import nipype_pipeline_engine as pe
44
import nipype.interfaces.utility as util
5+
from nipype import config
56

67
from CPAC.utils.interfaces.function import Function
78

@@ -11,6 +12,7 @@
1112
create_cwas_batches,
1213
merge_cwas_batches,
1314
nifti_cwas,
15+
zstat_image,
1416
)
1517

1618

@@ -54,6 +56,8 @@ def create_cwas(name='cwas', working_dir=None, crash_dir=None):
5456
Pseudo F values of CWAS
5557
outputspec.p_map : string (nifti file)
5658
Significance p values calculated from permutation tests
59+
outputspec.z_map : string (nifti file)
60+
Significance p values converted to z-scores
5761
5862
CWAS Procedure:
5963
@@ -83,10 +87,9 @@ def create_cwas(name='cwas', working_dir=None, crash_dir=None):
8387
8488
References
8589
----------
86-
.. [1] Shehzad Z, Kelly C, Reiss PT, Emerson JW, McMahon K, Copland DA, Castellanos FX, Milham MP. An Analytic Framework for Connectome-Wide Association Studies. Under Review.
90+
.. [1] Shehzad Z, Kelly C, Reiss PT, Cameron Craddock R, Emerson JW, McMahon K, Copland DA, Castellanos FX, Milham MP. A multivariate distance-based analytic framework for connectome-wide association studies. Neuroimage. 2014 Jun;93 Pt 1(0 1):74-94. doi: 10.1016/j.neuroimage.2014.02.024. Epub 2014 Feb 28. PMID: 24583255; PMCID: PMC4138049.
8791
8892
"""
89-
9093
if not working_dir:
9194
working_dir = os.path.join(os.getcwd(), 'MDMR_work_dir')
9295
if not crash_dir:
@@ -95,20 +98,24 @@ def create_cwas(name='cwas', working_dir=None, crash_dir=None):
9598
workflow = pe.Workflow(name=name)
9699
workflow.base_dir = working_dir
97100
workflow.config['execution'] = {'hash_method': 'timestamp',
98-
'crashdump_dir': os.path.abspath(crash_dir)}
101+
'crashdump_dir': os.path.abspath(crash_dir),
102+
'crashfile_format': 'txt'}
99103

100104
inputspec = pe.Node(util.IdentityInterface(fields=['roi',
101105
'subjects',
102106
'regressor',
103107
'participant_column',
104108
'columns',
105109
'permutations',
106-
'parallel_nodes']),
110+
'parallel_nodes',
111+
'z_score']),
107112
name='inputspec')
108113

109114
outputspec = pe.Node(util.IdentityInterface(fields=['F_map',
110115
'p_map',
111-
'neglog_p_map']),
116+
'neglog_p_map',
117+
'one_p_map',
118+
'z_map']),
112119
name='outputspec')
113120

114121
ccb = pe.Node(Function(input_names=['mask_file',
@@ -139,10 +146,14 @@ def create_cwas(name='cwas', working_dir=None, crash_dir=None):
139146
name='joint_mask')
140147

141148
mcwasb = pe.Node(Function(input_names=['cwas_batches',
142-
'mask_file'],
149+
'mask_file',
150+
'z_score',
151+
'permutations'],
143152
output_names=['F_file',
144153
'p_file',
145-
'neglog_p_file'],
154+
'neglog_p_file',
155+
'one_p_file',
156+
'z_file'],
146157
function=merge_cwas_batches,
147158
as_module=True),
148159
name='cwas_volumes')
@@ -181,9 +192,15 @@ def create_cwas(name='cwas', working_dir=None, crash_dir=None):
181192
mcwasb, 'cwas_batches')
182193
workflow.connect(jmask, 'joint_mask',
183194
mcwasb, 'mask_file')
195+
workflow.connect(inputspec, 'z_score',
196+
mcwasb, 'z_score')
197+
workflow.connect(inputspec, 'permutations',
198+
mcwasb, 'permutations')
184199

185200
workflow.connect(mcwasb, 'F_file', outputspec, 'F_map')
186201
workflow.connect(mcwasb, 'p_file', outputspec, 'p_map')
187202
workflow.connect(mcwasb, 'neglog_p_file', outputspec, 'neglog_p_map')
203+
workflow.connect(mcwasb, 'one_p_file', outputspec, 'one_p_map')
204+
workflow.connect(mcwasb, 'z_file', outputspec, 'z_map')
188205

189206
return workflow

0 commit comments

Comments
 (0)