Skip to content

Commit

Permalink
Merge pull request #143 from neuroscout/fix_smoothing
Browse files Browse the repository at this point in the history
FIX: Smoothing in fitlins occurs at incorrect level
  • Loading branch information
adelavega authored Oct 15, 2021
2 parents c7231de + e2b1e41 commit 370fefc
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 10 deletions.
4 changes: 4 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ RUN /bin/bash -c "source activate neuro \
&& pip install -q --no-cache-dir -e /src/neuroscout/" \
&& sync

RUN /bin/bash -c "source activate neuro \
&& pip install -q --no-cache-dir --upgrade git+https://github.com/poldracklab/fitlins.git@maint/0.9.x" \
&& sync

RUN /bin/bash -c "source activate neuro \
&& pip install -q --no-cache-dir --upgrade -r /src/neuroscout/requirements.txt" \
&& sync
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,9 @@ Options:
-w, --work-dir <dir> Optional Fitlins working directory
-c, --n-cpus <n> Maximum number of threads across all processes
[default: 1]
-s, --smoothing <k> Smoothing kernel FWHM at group level
[default: 4]
-s, --smoothing <k> Smoothing to apply in format: FWHM:level:type.
See fitlins documentation for more information.
[default: 4:Dataset:iso]
-u, --unlock Unlock datalad dataset
-n, --neurovault <nv> Upload mode (disable, all, or group)
[default: group]
Expand Down
2 changes: 1 addition & 1 deletion neuroscout_cli/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '0.5.3'
__version__ = '0.5.4'
11 changes: 8 additions & 3 deletions neuroscout_cli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@
-w, --work-dir <dir> Optional Fitlins working directory
-c, --n-cpus <n> Maximum number of threads across all processes
[default: 1]
-s, --smoothing <k> Smoothing kernel FWHM at group level
[default: 4]
-s, --smoothing <k> Smoothing to apply in format: FWHM:level:type.
See fitlins documentation for more information.
[default: 4:Dataset:iso]
-u, --unlock Unlock datalad dataset
-n, --neurovault <nv> Upload mode (disable, all, or group)
[default: group]
Expand Down Expand Up @@ -67,5 +68,9 @@ def main():
for bundle in bundles:
logging.info("Analysis ID : {}".format(bundle))
args['<bundle_id>'] = bundle
command(deepcopy(args)).run()
retcode = command(deepcopy(args)).run()

# If any execution fails, then exit
if retcode != 0:
sys.exit(retcode)
sys.exit(0)
9 changes: 7 additions & 2 deletions neuroscout_cli/commands/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def run(self, upload_only=False):
f'--model={model_path}',
'--ignore=/(.*desc-confounds_regressors.*)/',
f'--derivatives={str(self.bundle_dir.absolute())} {str(self.preproc_dir.absolute())}',
f'--smoothing={self.options["--smoothing"]}:Dataset',
f'--smoothing={self.options["--smoothing"]}',
f'--estimator={self.options["--estimator"]}',
f'--n-cpus={self.options["--n-cpus"]}'
]
Expand Down Expand Up @@ -72,6 +72,7 @@ def run(self, upload_only=False):
"https://github.com/neuroscout/neuroscout-cli/issues\n"
"-------------------------------------------------------\n"
)
return retcode

if neurovault != 'disable':
model = json.load(open(model_path, 'r'))
Expand All @@ -82,6 +83,7 @@ def run(self, upload_only=False):
options = json.load((out_dir / 'options.json').open('r'))
estimator = options.get('--estimator')
except:
options = None
print("No saved options found skipping...")

try:
Expand Down Expand Up @@ -118,8 +120,11 @@ def run(self, upload_only=False):
fmriprep_version=fmriprep_version,
estimator=estimator,
cli_version=VERSION,
cli_args=options,
n_subjects=n_subjects)

# Drop files if no separate install dir, and the user has not said otherwise.
if not self.install_dir and not no_drop:
drop(str(self.preproc_dir.absolute()))
drop(str(self.preproc_dir.absolute()))

return retcode
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
docopt==0.6.2
datalad==0.10.2
tqdm
pyns==0.4.7
git+https://github.com/bids-standard/pybids.git@maint/0.13.x
pyns==0.4.8
git+https://github.com/bids-standard/pybids.git@maint/0.13.x

0 comments on commit 370fefc

Please sign in to comment.