cpp-lln-lab/CPP_BIDS

cfg setDefault usage

Opened this issue · 3 comments

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?

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.

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?

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!