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

bids-matlab: a "wish-list" of enhancements and requests for new features #60

Closed
Remi-Gau opened this issue Oct 16, 2020 · 9 comments
Closed
Labels
enhancement New feature or request

Comments

@Remi-Gau
Copy link
Collaborator

Remi-Gau commented Oct 16, 2020

List what you would need from BIDS-matlab

As discussed in the last meeting (see #59) we will be keeping track of what people would like bids-matlab to do in this issue.

I will keep this top message updated with new ideas from the discussion below.


  • a code base that keeps up with new BIDS extensions
  • multimodal, not only MRI

Moved to their own issue

I want the data structures to be formally described (in json/yaml) and not in the MATLAB code, that representation should be shared with pybids (MATLAB has support for JSON - see here

documentation is missing: what can the code actually do and not do

To help with bids compliant filename generation and the creation of json files and data dictionary

Like fMRIprep output

reading and representing the metadata and the structure, I know how to deal with the data itself

@Remi-Gau
Copy link
Collaborator Author

* I want the data structures to be formally described (in json/yaml) and not in the MATLAB code, that representation should be shared with pybids (MATLAB has support for JSON - see [here](https://fr.mathworks.com/help/mps/restfuljson/json-representation-of-matlab-data-types.html)

I wonder if we can use the BIDS schema that is being developed and used by the validator to help with this.

@Remi-Gau Remi-Gau added the enhancement New feature or request label Oct 16, 2020
@apjanke
Copy link
Collaborator

apjanke commented Oct 21, 2020

Hi! Sorry if I'm butting in here, since this isn't my project. I'm curious about this:

I want the data structures to be formally described (in json/yaml) and not in the MATLAB code,

Could you go in to this a little bit more, particularly with respect to how you see the BIDS data structures represented as Matlab datatypes inside running Matlab code? Matlab's jsondecode() decodes JSON data to generic trees of Matlab structs, cells, strings and numerics. Are you saying that's how you want the data structures to be represented throughout the lifetime of execution?

To my mind, it might be nice to have custom Matlab classdef objects corresponding to the BIDS schema structures, even if the "canonical representation" or "source of truth" is the JSON schema. That way you could have eager data validation, custom display formats, and methods attached to the data structures at various levels. (Might be worthwhile for tab-completion support, if nothing else.)

Maybe there'd be a use case for something like the Java XML Beans binding approach, where it maps an XML schema to Java object sets - you could map the BIDS JSON Schema entities to Matlab classes, but still allow for property constraints, other validation, and custom methods added to them?

@Remi-Gau
Copy link
Collaborator Author

hey @apjanke

responding quickly here eventhough I am not the one who suggested this.

Maybe there'd be a use case for something like the Java XML Beans binding approach, where it maps an XML schema to Java object sets - you could map the BIDS JSON Schema entities to Matlab classes, but still allow for property constraints, other validation, and custom methods added to them?

I am not sure of exactly in which direction this could go in terms of implementation but this could prove very useful if it can prevent us having to write tons of code for generating filenames for each use case in th BIDS world or to help with some of the other "write" aspect that bids-matlab could have.

Not sure we want to do TOO much validation on our side though and I would relegate that to the bids-validator front.

Noob question: how easy would it be to convert the current BIDS yml schema into something that we can use?

@Remi-Gau
Copy link
Collaborator Author

@Remi-Gau: using a schema is number one on my wish-list: with it, most of the code in +bids/layout.m could be removed and made generic. This is probably all we need - bit sad that it is using yet another format unnecessarily but it's great it's now available!

I think that if we could automate the conversion of the yml based schema into something suits our need better. That would indeed make the code base a LOT lighter. :-)

@gllmflndn
Copy link
Collaborator

I think that if we could automate the conversion of the yml based schema into something suits our need better. That would indeed make the code base a LOT lighter. :-)

If we want to use this schema (which I think we should), we can either 1/ use or implement a (simplified) YAML parser or 2/ convert it to JSON first and use this in bids-matlab. I would recommend option 2 and see whether the JSON-converted schema could be stored in the bids-specification repository too (the YAML version being the authoritative one and the JSON one being automatically converted and kept in sync).

@Remi-Gau
Copy link
Collaborator Author

Actually had opened an issue on one of our repo to get spm_mkdir and spm_copy out of spm. So I would heart to have them as part of bids matlab.

cpp-lln-lab/CPP_BIDS#58 (comment) disappointed_relieved

hahaha
Nothing personal against SPM. Just wanted to keep that repo as standalonish as possible. :-) If people want to use it to test with psychtoolbox, I would not want to them to install SPM just for that. :-p

One headache to keep in mind: datasets curated with datalad have their content stored with git annex (I need to finish a PR about that on the datalad handbook). So a simple call to copyfile will not follow the symbolic link and you just end up with just a bunch of broken links.

I think we should make a system() call only out of necessity. We could test for symlinks within a isunix condition and only use cp -L for these?

Yes that sounds like a good idea to me: my hack was very much tailored to my current needs which is very UNIX + datalad heavy. :-)

@Remi-Gau
Copy link
Collaborator Author

If we want to use this schema (which I think we should), we can either 1/ use or implement a (simplified) YAML parser or 2/ convert it to JSON first and use this in bids-matlab. I would recommend option 2 and see whether the JSON-converted schema could be stored in the bids-specification repository too (the YAML version being the authoritative one and the JSON one being automatically converted and kept in sync).

I prefer option 2 as well. I think that this automatic conversion could be part of the infrastructure of the specs. Would need to raise the issue in the specs repo and sor that there before we can start working on this.

@Remi-Gau
Copy link
Collaborator Author

Remi-Gau commented Feb 4, 2021

@nbeliy Actually moving your comment to its own issue to help with the discussion.

@bids-standard bids-standard deleted a comment from nbeliy Feb 4, 2021
@bids-standard bids-standard deleted a comment from nbeliy Feb 15, 2021
@bids-standard bids-standard deleted a comment from bmdeen Feb 15, 2021
@bids-standard bids-standard deleted a comment from gllmflndn Feb 15, 2021
@bids-standard bids-standard deleted a comment from gllmflndn Feb 15, 2021
@Remi-Gau
Copy link
Collaborator Author

Will close this issue and have every feature request be handled with a different issue / discussions.

To get an overview we will use the github kanban boards.

@Remi-Gau Remi-Gau unpinned this issue Feb 15, 2021
@Remi-Gau Remi-Gau pinned this issue Sep 3, 2021
@Remi-Gau Remi-Gau unpinned this issue Sep 20, 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
Projects
None yet
Development

No branches or pull requests

3 participants