cpp-lln-lab / CPP_BIDS

a set of matlab / octave function to create BIDS comptible folder structure and filenames
https://cpp-bids.readthedocs.io/en/dev/index.html
MIT License
1 stars 9 forks source link

cfg setDefault usage #92

Open CerenB opened 3 years ago

CerenB commented 3 years ago

I always forget, and was looking in README for usage of functions. first we set values in our experiment setParams.m and then run CPP_BIDS functions (e.g.userInput and createFilename). createFilename will set fields IF it's not set previously. Right? So my cfg.fields should be filled before I call BIDS functions.

Would you like to add one sentence somewhere that first the user should run their getParams and set all the fields. Then empty fields would be filled by the default values in CPP_BIDS functions.. I can add it as well, if you can point out where that info should be? e.g. in usage notebook?

Remi-Gau commented 3 years ago

So both userInput and createFilename will start by calling checkCfg to make create any of the default missing fields.

This is not a big issue for userInput: it will run even if no cfg is given as input.

createFilename only requires cfg.task.name to be defined to run.

So as a user you can set the content of most fields before OR after having run those functions: if you run it after you can override the default, if done before checkCFG will keep whatever you gave it.

But you are right that it would be nice to have it in the doc just to be clear.

Feel free to copy paste the content of this issue thread rather than retype it from scratch: some doc is better than no doc.

Remi-Gau commented 3 years ago

Where to put things:

I think this could be added to the function_description.md:

userInput and createFilename will start by calling checkCfg to make create any of the default missing fields.

The rest of the details about how to use it... I am thinking could maybe be best placed in the jupyter notebook, no?

Maybe after Creating BIDS paths and filenames in the basic_usage notebook?

CerenB commented 3 years ago

Yes I was thinking the same place to add such info. True, it will overwrite and/or only create default parameters if the field is missing. Nevertheless, one sentence would safe the suer some time.

Interesting, I do not know how to update notebook. Hah, I'll check!