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

[WIP]v0 for spm parser #50

Merged
merged 14 commits into from
Feb 19, 2021
Merged

[WIP]v0 for spm parser #50

merged 14 commits into from
Feb 19, 2021

Conversation

remiadon
Copy link
Contributor

@remiadon remiadon commented Feb 3, 2021

This PR tries to introduce a parser for SPM, i.e a piece of program that takes .m files as those available to SPM users and produces the corresponding BIDSprov graph, in jsonld

  • implement a v0
  • CI script to check conversion is OK with a few different datasets
  • bash example with visualization
  • add more examples

@remiadon remiadon requested a review from cmaumet February 3, 2021 17:56
@remiadon remiadon self-assigned this Feb 3, 2021
@remiadon remiadon added enhancement New feature or request SPM utils labels Feb 3, 2021
@remiadon remiadon linked an issue Feb 3, 2021 that may be closed by this pull request
4 tasks
@remiadon remiadon changed the title v0 for spm parser [WIP]v0 for spm parser Feb 4, 2021
@remiadon remiadon mentioned this pull request Feb 4, 2021
@remiadon
Copy link
Contributor Author

remiadon commented Feb 8, 2021

@cmaumet Here is what I get when I run

python bids_prov/spm_parser.py examples/spm_default/batch.m -o test.json && python bids_prov/visualize.py test.json && open test.png

test

@cmaumet
Copy link
Collaborator

cmaumet commented Feb 8, 2021

Discussed w/ @remiadon on Feb 8, next steps include:

  • Reverse dependencies into "used" instead of "wasGeneratedBy"
  • Add wasAssociatedWith relation between all activities and the SPM software
  • For each cfg_dep add a wasGeneratedBy relation between the entity and the corresponding activity
  • Try and use prov library

@remiadon
Copy link
Contributor Author

remiadon commented Feb 8, 2021

Here is what I get after f094136

test

@remiadon
Copy link
Contributor Author

remiadon commented Feb 9, 2021

And here is what I get now, after 46436ff

test

@cmaumet do you see anything abnormal ?

@cmaumet
Copy link
Collaborator

cmaumet commented Feb 9, 2021

Thanks @remiadon! I did not see anything specific but in general I think all activities should have a "used" relationship and this does not seem to be the case in the graph above. Can you have a look?

@remiadon
Copy link
Contributor Author

@cmaumet what I get after eeb94c8

test

It just took a bit more time to debug than what I expected :)

Do you see any blocking item now ??

@remiadon
Copy link
Contributor Author

Oh I see there is a buggy part : "file(1)_4" and "file(1)_3" should not be chained ...

@remiadon
Copy link
Contributor Author

and here is what I get for the explicit_maskexample https://github.com/incf-nidash/nidmresults-examples/tree/master/spm_explicit_mask

explicit_mask

Copy link
Collaborator

@cmaumet cmaumet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @remiadon, thanks for this.

One quick note on your latest graph:

  • the links between the entities and the SPM software should be removed (to only retain the links between the activities and the software).

Once this is done, I am happy to merge this. For the next sprint, here are a few things we should look at to improve this example:

  • file_move_2 has no wasGeneratedBy link. Do you think there could be a confusion with the output of file_move_1?
  • in the name of the Activity could we keep everything after "spm.", for example "preproc._7" would become "spatial.preproc._7"
  • To make the graph easier to read, is there an option to hide identifiers?

@remiadon
Copy link
Contributor Author

@cmaumet Thanks for reviewing

As introduced in 5f14a6c

Here is the generated graph
test

@remiadon
Copy link
Contributor Author

remiadon commented Feb 18, 2021

And in 434eeaf I fixed activity names :) A limit is left to 30 characters for activity names, otherwise I find it quite verbose
test

@cmaumet
Copy link
Collaborator

cmaumet commented Feb 19, 2021

Ok let's merge and we'll keep the other items for the next iteration!

@remiadon
Copy link
Contributor Author

@cmaumet I tried to fix what you mentionned about "file_move_2" by linking dependencies in another manner

Here is the graph I get

test

I do think it's way better, what do you think ?

@cmaumet
Copy link
Collaborator

cmaumet commented Feb 19, 2021

Yes! There is one remaining missing link : "fmri_spec" used "Smoothed images"

@remiadon
Copy link
Contributor Author

@cmaumet ready to merge

@remiadon remiadon merged commit 10a9c66 into master Feb 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request SPM utils
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SPM Parser for BIDSProv
2 participants