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

FIX: NonsteadyStatesDetector wrongly using Nipype's is_outlier #605

Merged
merged 2 commits into from
Jan 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
10 changes: 5 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -337,10 +337,10 @@ jobs:
- regression-v5-{{ .Revision }}
- restore_cache:
keys:
- masks-workdir-v3-{{ .Branch }}-{{epoch}}
- masks-workdir-v3-{{ .Branch }}-
- masks-workdir-v3-master-
- masks-workdir-v3-
- masks-workdir-v4-{{ .Branch }}-{{epoch}}
- masks-workdir-v4-{{ .Branch }}-
- masks-workdir-v4-master-
- masks-workdir-v4-
- run:
name: Run regression tests on EPI masks
no_output_timeout: 2h
Expand Down Expand Up @@ -370,7 +370,7 @@ jobs:
- store_test_results:
path: /tmp/masks/reports
- save_cache:
key: masks-workdir-v3-{{ .Branch }}-{{ epoch }}
key: masks-workdir-v4-{{ .Branch }}-{{ epoch }}
paths:
- /tmp/masks/workdir

Expand Down
7 changes: 5 additions & 2 deletions niworkflows/interfaces/bold.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,10 @@ def _run_interface(self, runtime):
global_signal = np.mean(
np.asanyarray(img.dataobj[..., : self.inputs.n_volumes]), axis=(0, 1, 2)
)
self._results["t_mask"] = [bool(i) for i in is_outlier(global_signal)]
self._results["n_dummy"] = int(np.sum(self._results["t_mask"]))

ndiscard = is_outlier(global_signal)
self._results["n_dummy"] = ndiscard
ndiscard = ndiscard or ntotal
self._results["t_mask"][:ndiscard] = [True] * ndiscard

return runtime