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

PIN: nipreps/niworkflows#485 #2108

Closed
wants to merge 2 commits into from

Conversation

effigies
Copy link
Member

Merged nipreps/master into nipreps/niworkflows#485 and pushed to my own remote. Opening PR to check that we get sensible brain masks on CI.

cc @oesteban If this passes, I'll merge the niworkflows PR.

@auto-comment
Copy link

auto-comment bot commented Apr 28, 2020

Thank your for raising your pull request.

Some of the fMRIPRep maintainers will review your changes as soon as time permits.
I'm attaching below a Review Checklist for the reviewers, to check off during the
review.

PR Review

Please check off boxes as applicable, and elaborate in comments below. Your review is not limited to these topics, as described in the reviewer guide

  • As the reviewer I confirm that there are no conflicts of interest for me to review this work.

Please check what applies in the following aspects of the PR:

Code documentation

  • New functions and modules are documented following the guidelines.
  • Existing code required amendments in documentation and has been updated.
  • Sufficient inline comments ensure readability by other contributors in the long term.

Documentation site

  • The modifications to fMRIPrep in this PR do not require extra documentation. This is a common situation when a bug fix that does not change the code base substantially is submitted.
  • This PR requires documentation. The corresponding documentation will be submitted as an additional PR in the future.
  • This PR requires extra documentation, and will be included within this PR. Please check the boxes that apply best:
    • An existing feature is substantially modified, changing the interface and/or logic of a module.
    • A new feature is being added, therefore full documentation of it will be included
    • This PR addresses an error in existing documentation.
  • Yes, all expected sections of documentation were generated by the CI build, and look as expected

Tests

  • The new functionalities in this PR are covered by the existing tests
  • New test batteries have been included with this PR

Data

  • This PR does not require any additional data to be uploaded to OSF.
  • This PR requires additional data for tests.

Dependencies: smriprep

  • This PR does not require any update on smriprep; or
  • smriprep has correctly been pinned.

Dependencies: niworkflows

  • This PR does not require any update on niworkflows; or
  • niworkflows has correctly been pinned.

Dependencies: sdcflows

  • This PR does not require any update on sdcflows; or
  • sdcflows has correctly been pinned.

Dependencies: Nipype

  • This PR does not require any update on nipype; or
  • nipype has correctly been pinned.

Dependencies: other

  • This PR does not require any update on other dependencies; or
  • other dependencies have correctly been pinned.

Reports generated within CI tests

  • Yes, I have checked the reports of ds005 and they are not modified or the changes are as expected
  • Yes, I have checked the reports of ds054 and they are not modified or the changes are as expected
  • Yes, I have checked the reports of ds010 and they are not modified or the changes are as expected

@effigies effigies force-pushed the pin/niworkflows485 branch from f29623c to 5c68344 Compare April 28, 2020 20:51
@oesteban
Copy link
Member

Thanks much!

@effigies
Copy link
Member Author

@oesteban could you look at these errors? They seem to be templateflow-related:

Process Process-2:
 
Traceback (most recent call last):
 
  File "/usr/local/miniconda/lib/python3.7/multiprocessing/process.py", line 297, in _bootstrap
 
    self.run()
 
  File "/usr/local/miniconda/lib/python3.7/multiprocessing/process.py", line 99, in run
 
    self._target(*self._args, **self._kwargs)
 
  File "/usr/local/miniconda/lib/python3.7/site-packages/fmriprep/cli/workflow.py", line 80, in build_workflow
 
    retval['workflow'] = init_fmriprep_wf()
 
  File "/usr/local/miniconda/lib/python3.7/site-packages/fmriprep/workflows/base.py", line 64, in init_fmriprep_wf
 
    single_subject_wf = init_single_subject_wf(subject_id)
 
  File "/usr/local/miniconda/lib/python3.7/site-packages/fmriprep/workflows/base.py", line 287, in init_single_subject_wf
 
    func_preproc_wf = init_func_preproc_wf(bold_file)
 
  File "/usr/local/miniconda/lib/python3.7/site-packages/fmriprep/workflows/bold/base.py", line 306, in init_func_preproc_wf
 
    bold_reference_wf = init_bold_reference_wf(omp_nthreads=omp_nthreads)
 
  File "/usr/local/miniconda/lib/python3.7/site-packages/niworkflows/func/util.py", line 117, in init_bold_reference_wf
 
    omp_nthreads=omp_nthreads, pre_mask=pre_mask)
 
  File "/usr/local/miniconda/lib/python3.7/site-packages/niworkflows/func/util.py", line 325, in init_enhance_and_skullstrip_bold_wf
 
    'MNI152NLin2009cAsym', resolution=1, label='brain', suffix='probseg'))),
 
  File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/interfaces/ants/base.py", line 75, in __init__
 
    super(ANTSCommand, self).__init__(**inputs)
 
  File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/interfaces/base/core.py", line 673, in __init__
 
    super(CommandLine, self).__init__(**inputs)
 
  File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/interfaces/base/core.py", line 183, in __init__
 
    self.inputs = self.input_spec(**inputs)
 
  File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/interfaces/base/specs.py", line 66, in __init__
 
    super(BaseTraitedSpec, self).__init__(**kwargs)
 
  File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/interfaces/base/traits_extension.py", line 329, in validate
 
    value = super(File, self).validate(objekt, name, value, return_pathlike=True)
 
  File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/interfaces/base/traits_extension.py", line 134, in validate
 
    self.error(objekt, name, str(value))
 
  File "/usr/local/miniconda/lib/python3.7/site-packages/traits/trait_handlers.py", line 172, in error
 
    value )
 
traits.trait_errors.TraitError: The 'input_image' trait of an ApplyTransformsInputSpec instance must be a pathlike object or string representing an existing file, but a value of '[]' <class 'str'> was specified.

@oesteban
Copy link
Member

At docker build, the step where we install fMRIPrep:

ERROR: niworkflows 0.9.0+639.g3a71c56 has requirement templateflow>=0.6.0rc1, but you'll have templateflow 0.5.2 which is incompatible.
 
ERROR: sdcflows 1.2.3 has requirement niworkflows<1.4,>=1.2.0rc4, but you'll have niworkflows 0.9.0+639.g3a71c56 which is incompatible.

@oesteban
Copy link
Member

oesteban commented May 1, 2020

All-green now. Haven't checked on the reports yet though

@oesteban
Copy link
Member

oesteban commented May 1, 2020

Okay, there's something odd about the xforms of ds210 and the AROMA results of the second run of ds005 are also a bit funny. I'll have to revise what's going on here.

@oesteban oesteban mentioned this pull request May 1, 2020
@mgxd
Copy link
Collaborator

mgxd commented May 6, 2020

this is super close, anything I can do to push this in?

@oesteban
Copy link
Member

oesteban commented May 6, 2020

This is mostly on my plate. I've been focusing on nipreps/niworkflows#507 because these two were too big to handle in parallel and it felt I was unlocking more work with the other PR. When I get a sense of why this is not working, I may need to ping you back 👍

@oesteban oesteban force-pushed the pin/niworkflows485 branch from 137f60c to 7421792 Compare May 7, 2020 02:05
@oesteban
Copy link
Member

oesteban commented May 7, 2020

Waiting on #2114

@oesteban oesteban force-pushed the pin/niworkflows485 branch from 7421792 to 8f7f23c Compare May 7, 2020 22:13
@oesteban
Copy link
Member

oesteban commented May 8, 2020

Yup, I'm not super-happy with the results. The 0.5 threshold might be too generous, and I'm not positive trial and error is the right approach to optimize it.

@oesteban oesteban added this to the 20.2.0 LTS milestone May 22, 2020
@oesteban oesteban force-pushed the pin/niworkflows485 branch 2 times, most recently from d422a3b to 23764f0 Compare May 29, 2020 23:51
@oesteban
Copy link
Member

Okay, it seems the problems of ds210 are gone with 20.1.0 as base. Now, though, I think this would benefit a lot from finishing nipreps/niworkflows#408 because the INU correction is not liking the composite echo input.

The funny (empty) component of ds005 is still there though.

@oesteban
Copy link
Member

oesteban commented Jun 2, 2020

I've been working on updating nipreps/niworkflows#408, and reached to the conclusion that it won't affect this particular change, as we are always using the first echo for masking purposes.

In diagnosing what's going on with the ROIs plot of ds210, I found #2162.

I'll play a bit with the threshold, which after all is the only knob we can actually tune. Because of how I generated the probabilistic mask, there's no real meaning for values in the mask (i.e., those are not a model fitting result or anything, just mathematical morphology and smoothing operations to have the edges be smoother). Therefore, using a threshold other than 0.5 is as valid (or invalid) as 0.5 itself.

@oesteban oesteban force-pushed the pin/niworkflows485 branch from 23764f0 to ff3ae2a Compare June 2, 2020 17:41
@oesteban oesteban marked this pull request as ready for review June 3, 2020 01:17
@oesteban
Copy link
Member

oesteban commented Jun 3, 2020

Okay, I think this is ready.

  • Figured out that the weird component of AROMA is actually a mild bug when calculating the color scale of the components (or a component with very low loadings compared to the others).
  • It seems that 0.85 is a good threshold for the brain mask (gives you something pretty close to that we used to have). The value is quite arbitrary, but it is also true that this mask is not really probabilistic, just has some smoothing around the edges.

@oesteban oesteban requested a review from mgxd June 3, 2020 21:18
@oesteban oesteban marked this pull request as draft June 3, 2020 21:19
@oesteban
Copy link
Member

oesteban commented Jun 3, 2020

(made it a draft until the niworkflows PR is merged)

@oesteban
Copy link
Member

oesteban commented Jun 5, 2020

Because the default threshold is now 0.85 in the workflow definition itself, this PR is no longer needed (results of integration will come with the build associated with 11683c7)

@oesteban oesteban closed this Jun 5, 2020
@effigies effigies deleted the pin/niworkflows485 branch August 24, 2023 03:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants