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

add models for SPM block design tutos #13

Merged
merged 6 commits into from
Jun 16, 2022

Conversation

Remi-Gau
Copy link
Contributor

@Remi-Gau Remi-Gau commented May 2, 2022

replaces #1

TODO

  • Make it work with fitlins

@shashankbansal6
Copy link
Contributor

I believe we moved type into Model
Something like this: "Model": {"X": [1], "Type": "Meta"},
Ref:

"Model": {"X": [1], "Type": "Meta"},

@Remi-Gau
Copy link
Contributor Author

Remi-Gau commented May 3, 2022

I believe we moved type into Model

Oh gosh. That JSON has like 10 lines and I managed to F it up. Thanks for catching this.

@Remi-Gau
Copy link
Contributor Author

Remi-Gau commented May 3, 2022

Currently this fails to run with fitlins:

$ bash moae_run_fitlins.sh

Captured warning (<class 'FutureWarning'>): Fetchers from the nilearn.datasets module will be updated in version 0.9 to return python strings instead of bytes and Pandas dataframes instead of Numpy arrays.
Traceback (most recent call last):
  File "/home/remi/github/BIDS-model-zoo/spm_tutorials/env/bin/fitlins", line 8, in <module>
    sys.exit(main())
  File "/home/remi/github/BIDS-model-zoo/spm_tutorials/env/lib/python3.8/site-packages/fitlins/cli/run.py", line 432, in main
    sys.exit(run_fitlins(sys.argv[1:]))
  File "/home/remi/github/BIDS-model-zoo/spm_tutorials/env/lib/python3.8/site-packages/fitlins/cli/run.py", line 385, in run_fitlins
    fitlins_wf = init_fitlins_wf(
  File "/home/remi/github/BIDS-model-zoo/spm_tutorials/env/lib/python3.8/site-packages/fitlins/workflows/base.py", line 285, in init_fitlins_wf
    select_specs = pe.Node(
  File "/home/remi/github/BIDS-model-zoo/spm_tutorials/env/lib/python3.8/site-packages/nipype/pipeline/engine/nodes.py", line 181, in __init__
    super(Node, self).__init__(name, kwargs.get("base_dir"))
  File "/home/remi/github/BIDS-model-zoo/spm_tutorials/env/lib/python3.8/site-packages/nipype/pipeline/engine/base.py", line 37, in __init__
    self.name = name
  File "/home/remi/github/BIDS-model-zoo/spm_tutorials/env/lib/python3.8/site-packages/nipype/pipeline/engine/base.py", line 53, in name
    raise ValueError('[Workflow|Node] name "%s" is not valid.' % name)
ValueError: [Workflow|Node] name "select_run level_specs" is not valid.

@adelavega
Copy link
Contributor

Hey, this is really nice! I like how reproducible it all is.

A more general concern I have is that I'm hoping that all model zoo examples eventually follow a similar format, so that they can eventually be displayed in a Jupyter Book or equivalent website, and run in Binder.

I'll probably hold off on merging until we have that, but this looks very compatible.

@Remi-Gau
Copy link
Contributor Author

Remi-Gau commented May 3, 2022

Well some of the stuff for fitlins are also there because I wanted to make it easier for others to run it and help me figure out what is wrong with this model and why it can't run.

@Remi-Gau Remi-Gau self-assigned this May 4, 2022
@shashankbansal6
Copy link
Contributor

Finally, after all of this fixes, it should run the FirstLevelModel and you will get all of the first level images but I just discovered a bug in fitlins reports where its hard-coded to expect a subject level node so it will throw the following error:

Traceback (most recent call last):
  File "/Users/shashankbansal/miniconda/envs/spm_tuto/bin/fitlins", line 8, in <module>
    sys.exit(main())
  File "/Users/shashankbansal/miniconda/envs/spm_tuto/lib/python3.8/site-packages/fitlins/cli/run.py", line 432, in main
    sys.exit(run_fitlins(sys.argv[1:]))
  File "/Users/shashankbansal/miniconda/envs/spm_tuto/lib/python3.8/site-packages/fitlins/cli/run.py", line 425, in run_fitlins
    report_dict = build_report_dict(deriv_dir, work_dir, graph)
  File "/Users/shashankbansal/miniconda/envs/spm_tuto/lib/python3.8/site-packages/fitlins/viz/reports.py", line 130, in build_report_dict
    {analysis_dict['entities']['subject'] for analysis_dict in report['nodes'][0]['analyses']}
  File "/Users/shashankbansal/miniconda/envs/spm_tuto/lib/python3.8/site-packages/fitlins/viz/reports.py", line 130, in <setcomp>
    {analysis_dict['entities']['subject'] for analysis_dict in report['nodes'][0]['analyses']}
KeyError: 'subject'

I have created a new issue in fitlins to keep track.

@adelavega
Copy link
Contributor

Should we merge and later change things to a the uniform environment once that is better defined?

@Remi-Gau
Copy link
Contributor Author

Remi-Gau commented May 9, 2022

Should we merge and later change things to a the uniform environment once that is better defined?

good with me

this may also include some change, once this is runnable with fitlins

@adelavega adelavega merged commit 0415ccc into bids-standard:main Jun 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants