allow createBoldJson to add extra content to a json file #72
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
fix #70
@marcobarilari @CerenB
If you put the following line at the end of your experiment script, it will dump the content in the json file that would be associated the bold MRI file of this run.
The reason I did this is that all the parameters that you used to run your experiment are this way saved in a human readable format: so that when you write your methods sections 2 years later, the info you used WHEN you ran the experiment is saved in an easily accessible text format ("F you
.matfile!").And also you don't have to read it from the
setParameters.mfile because you might have modified the content of a parameter when running the experiment and not committed and tagged that change with git.See an example of output here:
{ "Instructions": "", "RepetitionTime": 2, "SliceTiming": [], "TaskDescription": "", "TaskName": "visual Localizer", "IBI": 0.1, "ISI": 0.1, "aperture": { "type": "circle", "width": 36.00605610909393, "xPos": 0, "xPosPix": 0, "widthPix": 1080, "texture": 11 }, "audio": { "do": false }, "bids": { "MRI": { "Instructions": "Detect the RED fixation cross", "TaskDescription": [] }, "datasetDescription": { "Acknowledgements": "", "Authors": [""], "BIDSVersion": "", "DatasetDOI": "", "Funding": [""], "HowToAcknowledge": "", "License": "", "Name": "", "ReferencesAndLinks": [""] }, "meg": { "DewarPosition": [], "DigitizedHeadPoints": [], "DigitizedLandmarks": [], "PowerLineFrequency": [], "SamplingFrequency": [], "SoftwareFilters": [], "TaskName": "visual Localizer" }, "mri": { "Instructions": "", "RepetitionTime": 2, "SliceTiming": [], "TaskDescription": "", "TaskName": "visual Localizer" } }, "color": { "background": [0,0,0], "black": [0,0,0], "grey": [127.5,127.5,127.5], "red": [255,0,0], "white": [255,255,255] }, "debug": { "do": true, "smallWin": false, "transpWin": true }, "design": { "motionType": "translation", "names": [ "static", "motion" ], "nbRepetitions": 4, "nbEventsPerBlock": 12, "blockNames": [ "static", "motion", "static", "motion", "static", "motion", "static", "motion" ], "nbBlocks": 8, "directions": [[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[180,270,0,90,0,90,270,180,90,270,0,180],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[90,270,0,180,0,90,270,180,90,180,270,0],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[270,90,180,0,270,180,90,0,90,270,180,0],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[0,180,270,90,270,180,0,90,0,90,180,270]], "speeds": [[7.483333333333333,7.483333333333333,7.483333333333333,7.483333333333333,7.483333333333333,7.483333333333333,7.483333333333333,7.483333333333333,7.483333333333333,7.483333333333333,7.483333333333333,7.483333333333333],[7.483333333333333,7.483333333333333,7.483333333333333,7.483333333333333,7.483333333333333,7.483333333333333,7.483333333333333,7.483333333333333,7.483333333333333,7.483333333333333,7.483333333333333,7.483333333333333],[7.483333333333333,7.483333333333333,7.483333333333333,7.483333333333333,7.483333333333333,7.483333333333333,7.483333333333333,7.483333333333333,7.483333333333333,7.483333333333333,7.483333333333333,7.483333333333333],[7.483333333333333,7.483333333333333,7.483333333333333,7.483333333333333,7.483333333333333,7.483333333333333,7.483333333333333,7.483333333333333,7.483333333333333,7.483333333333333,7.483333333333333,7.483333333333333],[7.483333333333333,7.483333333333333,7.483333333333333,7.483333333333333,7.483333333333333,7.483333333333333,7.483333333333333,7.483333333333333,7.483333333333333,7.483333333333333,7.483333333333333,7.483333333333333],[7.483333333333333,7.483333333333333,7.483333333333333,7.483333333333333,7.483333333333333,7.483333333333333,7.483333333333333,7.483333333333333,7.483333333333333,7.483333333333333,7.483333333333333,7.483333333333333],[7.483333333333333,7.483333333333333,7.483333333333333,7.483333333333333,7.483333333333333,7.483333333333333,7.483333333333333,7.483333333333333,7.483333333333333,7.483333333333333,7.483333333333333,7.483333333333333],[7.483333333333333,7.483333333333333,7.483333333333333,7.483333333333333,7.483333333333333,7.483333333333333,7.483333333333333,7.483333333333333,7.483333333333333,7.483333333333333,7.483333333333333,7.483333333333333]], "fixationTargets": [[0,0,1,0,0,1,0,0,0,0,0,0],[0,0,0,0,0,1,0,0,0,0,1,0],[0,0,0,0,0,0,1,0,0,0,0,0],[0,0,0,0,1,0,0,0,0,0,0,0],[0,0,0,1,0,0,0,0,0,1,0,0],[0,1,0,0,0,0,1,0,0,0,0,0],[0,1,0,0,0,0,0,0,0,0,0,0],[0,0,0,1,0,0,0,0,0,0,0,0]] }, "dir": { "output": "/home/remi/github/CPP_localizer_visual_motion/../output", "outputSubject": "/home/remi/github/CPP_localizer_visual_motion/../output/source/sub-ctrl666/ses-666" }, "dot": { "speed": 15, "coherence": 1, "density": 0.1, "lifeTime": 10, "proportionKilledPerFrame": 0, "size": 1, "color": [255,255,255], "matrixWidth": 1080, "sizePix": 29, "speedPix": 449, "speedPixPerFrame": 7.483333333333333, "number": 410, "texture": 12 }, "endDelay": 0.1, "eventDuration": 0.5, "extraColumns": [ "direction", "speed", "target", "event", "block" ], "eyeTracker": { "do": false }, "fileName": { "base": "sub-ctrl666_ses-666_task-visualLocalizer", "datasetDescription": "/home/remi/github/CPP_localizer_visual_motion/../output/dataset_description.json", "date": "202008051222", "dateFormat": "yyyymmddHHMM", "events": "sub-ctrl666_ses-666_task-visualLocalizer_run-666_events_date-202008051222.tsv", "modality": "beh", "pattern": "%03.0f", "stim": "sub-ctrl666_ses-666_task-visualLocalizer_run-666_stim_date-202008051222.tsv", "suffix": { "mri": { "acquisition": "", "contrastEnhancement": "", "echo": "", "phaseEncodingDirection": "", "reconstruction": "" }, "run": "_run-666" }, "task": "visualLocalizer", "zeroPadding": 3 }, "fixation": { "color": [255,255,255], "colorTarget": [255,0,0], "lineWidthPix": 2, "type": "crossS", "width": 1, "xDisplacement": 0, "yDisplacement": 0 }, "keyboard": { "escapeKey": "ESCAPE", "keyboard": [], "responseBox": [], "responseKey": ["space"] }, "mri": { "acquisition": [], "contrastEnhancement": [], "echo": [], "phaseEncodingDirection": [], "reconstruction": [], "repetitionTime": 2, "triggerKey": "t", "triggerNb": 4 }, "onsetDelay": 0.1, "screen": { "monitorDistance": 40, "monitorWidth": 50, "idx": 0, "win": 10, "winRect": [0,0,1920,1080], "winWidth": 1920, "winHeight": 1080, "center": [960,540], "FOV": 64.01076641616699, "ppd": 29.99495409127099, "ifi": 0.01666666666666667, "monitorRefresh": 60 }, "subject": { "askGrpSess": [true,true], "runNb": 666, "sessionNb": 666, "subjectGrp": "ctrl", "subjectNb": 666 }, "target": { "maxNbPerBlock": 2, "duration": 0.05 }, "task": { "name": "visual localizer", "instruction": "1-Detect the RED fixation cross\\n \\n\\n" }, "testingDevice": "pc", "text": { "color": [255,255,255], "font": "Courier New", "size": 18, "style": 1 }, "verbose": false, "experimentStart": 1596622967.563883 }