diff --git a/bids_prov/afni/description_functions.json b/bids_prov/afni/description_functions.json index 0087c69a0..69a958a5f 100644 --- a/bids_prov/afni/description_functions.json +++ b/bids_prov/afni/description_functions.json @@ -1,168 +1,168 @@ [ { - "name": "cp", - "used": ["0:-1"], - "generatedBy": [-1] + "Name": "cp", + "Used": ["0:-1"], + "GeneratedBy": [-1] }, { - "name": "mkdir", - "generatedBy": ["0:"] + "Name": "mkdir", + "GeneratedBy": ["0:"] }, { - "name": "echo", - "used": [2] + "Name": "echo", + "Used": [2] }, { - "name": "rm", - "used": ["0:"] + "Name": "rm", + "Used": ["0:"] }, { - "name": "mv", - "used": ["0:-1"], - "generatedBy": [-1] + "Name": "mv", + "Used": ["0:-1"], + "GeneratedBy": [-1] }, { - "name": "ln" + "Name": "ln" }, { - "name": "rmdir", - "used": [0] + "Name": "rmdir", + "Used": [0] }, - {"name": "3dcopy", - "used": [0], - "generatedBy": [1] + {"Name": "3dcopy", + "Used": [0], + "GeneratedBy": [1] }, - {"name": "3dTcat", - "used": [-1] , - "generatedBy": ["-prefix"] + {"Name": "3dTcat", + "Used": [-1] , + "GeneratedBy": ["-prefix"] }, - {"name": "cd", - "used": [0] + {"Name": "cd", + "Used": [0] }, - {"name": "touch", - "generatedBy": [0] + {"Name": "touch", + "GeneratedBy": [0] }, - {"name": "3dToutcount", - "used": [0], - "generatedBy": [">"], - "parameters_value" : ["-polort"], - "parameters_no_value" : ["-automask","-legendre", "-fraction"] + {"Name": "3dToutcount", + "Used": [0], + "GeneratedBy": [">"], + "ParametersValue" : ["-polort"], + "ParametersNoValue" : ["-automask","-legendre", "-fraction"] }, - {"name": "cat", - "used": [0], - "generatedBy": [">"] + { "Name": "cat", + "Used": [0], + "GeneratedBy": [">"] }, - {"name": "3dTshift", - "used": [-1], - "generatedBy": ["-prefix"] + {"Name": "3dTshift", + "Used": [-1], + "GeneratedBy": ["-prefix"] }, - {"name": "align_epi_anat.py", - "used": ["-anat","-epi"], - "generatedBy": ["-suffix"] + {"Name": "align_epi_anat.py", + "Used": ["-anat","-epi"], + "GeneratedBy": ["-suffix"] }, - {"name": "@auto_tlrc", - "used": ["-base", "-input"] + {"Name": "@auto_tlrc", + "Used": ["-base", "-input"] }, - {"name": "cat_matvec", - "used": [0], - "generatedBy": [">"] + {"Name": "cat_matvec", + "Used": [0], + "GeneratedBy": [">"] }, - {"name": "3dvolreg", - "used": [-1], - "generatedBy": ["-1Dmatrix_save"] + {"Name": "3dvolreg", + "Used": [-1], + "GeneratedBy": ["-1Dmatrix_save"] }, - {"name": "3dcalc", - "used": ["-a", "-b","-c","-d"], - "generatedBy": ["-prefix"] + {"Name": "3dcalc", + "Used": ["-a", "-b","-c","-d"], + "GeneratedBy": ["-prefix"] }, - {"name": "3dAllineate", - "used": ["-base", "-input", "-1Dmatrix_apply"], - "generatedBy": ["-prefix"] + {"Name": "3dAllineate", + "Used": ["-base", "-input", "-1Dmatrix_apply"], + "GeneratedBy": ["-prefix"] }, - {"name": "3dTstat", - "used": [-1], - "generatedBy": ["-prefix"] + {"Name": "3dTstat", + "Used": [-1], + "GeneratedBy": ["-prefix"] }, - {"name": "3dmerge", - "used": ["-2:"] + {"Name": "3dmerge", + "Used": ["-2:"] }, - {"name": "3dAutomask", - "used": [-1], - "generatedBy": ["-prefix"] + {"Name": "3dAutomask", + "Used": [-1], + "GeneratedBy": ["-prefix"] }, - {"name": "3dmask_tool", - "used": ["-input"], - "generatedBy": ["-prefix"] + {"Name": "3dmask_tool", + "Used": ["-input"], + "GeneratedBy": ["-prefix"] }, - {"name": "3dresample", - "used": ["-input", "-master"], - "generatedBy": ["-prefix"] + {"Name": "3dresample", + "Used": ["-input", "-master"], + "GeneratedBy": ["-prefix"] }, - {"name": "3dABoverlap", - "used": [0,1], - "parameters_value" : ["-no_automask"], - "parameters_no_value" : ["|&"] + {"Name": "3dABoverlap", + "Used": [0,1], + "ParametersValue" : ["-no_automask"], + "ParametersNoValue" : ["|&"] }, - {"name": "3ddot", - "used": [1,2] + {"Name": "3ddot", + "Used": [1,2] }, - {"name": "1d_tool.py", - "used" : ["-infile"], - "generatedBy" : ["-write"] + {"Name": "1d_tool.py", + "Used" : ["-infile"], + "GeneratedBy" : ["-write"] }, - {"name": "3dDeconvolve", - "used" : ["-input"], - "generatedBy" : ["-x1D"] + {"Name": "3dDeconvolve", + "Used" : ["-input"], + "GeneratedBy" : ["-x1D"] }, - {"name": "3dmaskave", - "used" : [2,3], - "generatedBy" : [">"] + {"Name": "3dmaskave", + "Used" : [2,3], + "GeneratedBy" : [">"] }, - {"name": "3dTnorm", - "used" : [-1], - "generatedBy" : ["-prefix"] + {"Name": "3dTnorm", + "Used" : [-1], + "GeneratedBy" : ["-prefix"] }, - {"name": "3dClustSim", - "used" : ["-mask","-inset"], - "generatedBy" : ["-prefix"] + {"Name": "3dClustSim", + "Used" : ["-mask","-inset"], + "GeneratedBy" : ["-prefix"] }, - {"name": "1dcat", - "used" : [0], - "generatedBy" : [">"] + {"Name": "1dcat", + "Used" : [0], + "GeneratedBy" : [">"] }, - {"name": "3dFWHMx", - "used" : [ "-mask"], - "generatedBy" : [">>"] + {"Name": "3dFWHMx", + "Used" : [ "-mask"], + "GeneratedBy" : [">>"] }, - {"name": "gen_epi_review.py", - "used" : ["-dsets"] + {"Name": "gen_epi_review.py", + "Used" : ["-dsets"] }, - {"name": "IsoSurface", - "generatedBy" : ["-o_gii"] + {"Name": "IsoSurface", + "GeneratedBy" : ["-o_gii"] }, { - "name": "@chauffeur_afni", - "used": ["-ulay"], - "generatedBy": ["-prefix"] + "Name": "@chauffeur_afni", + "Used": ["-ulay"], + "GeneratedBy": ["-prefix"] }, { - "name": "suma", - "used": ["-i"] + "Name": "suma", + "Used": ["-i"] }, { - "name": "2dcat", - "used": [-1], - "generatedBy": ["-prefix"] + "Name": "2dcat", + "Used": [-1], + "GeneratedBy": ["-prefix"] }, { - "name": "3dpc", - "used": [-1, "-mask"], - "generatedBy": ["-prefix"] + "Name": "3dpc", + "Used": [-1, "-mask"], + "GeneratedBy": ["-prefix"] }, { - "name": "3dMatch", - "used": ["-inset","-refset", "-mask"], - "generatedBy": ["-prefix"] + "Name": "3dMatch", + "Used": ["-inset","-refset", "-mask"], + "GeneratedBy": ["-prefix"] } ] diff --git a/bids_prov/fsl/description_functions.json b/bids_prov/fsl/description_functions.json index ee30a484c..672c20ed4 100644 --- a/bids_prov/fsl/description_functions.json +++ b/bids_prov/fsl/description_functions.json @@ -1,207 +1,207 @@ [ { - "name": "fslroi", - "used": [0], - "generatedBy": [1] + "Name": "fslroi", + "Used": [0], + "GeneratedBy": [1] }, { - "name": "fslmaths", - "used": [0, "-add","-sub","-mul","-div","-rem","-mas","-max","-min","-seed","-restart","-save"], - "generatedBy": [1], - "parameters_value" : ["-dt", "-odt","-thr","-thrp","-thrP","-uthr","-uthrp","-uthrP", + "Name": "fslmaths", + "Used": [0, "-add","-sub","-mul","-div","-rem","-mas","-max","-min","-seed","-restart","-save"], + "GeneratedBy": [1], + "ParametersValue" : ["-dt", "-odt","-thr","-thrp","-thrP","-uthr","-uthrp","-uthrP", { - "name": "-grid", - "index": ["0:2"] + "Name": "-grid", + "Index": ["0:2"] }, { - "name": "-dog_edge", - "index": ["0:2"] + "Name": "-dog_edge", + "Index": ["0:2"] }, { - "name": "-tfce", - "index": ["0:3"] + "Name": "-tfce", + "Index": ["0:3"] }, { - "name": "-tfceS", - "index": ["0:7"] + "Name": "-tfceS", + "Index": ["0:7"] },"-inm", "-ing"], - "parameters_no_value" : ["-exp","-log","-sin","-cos","-tan","-asin","-acos","-atan","-sqr","-sqrt","-recip","-abs","-bin","-binv","-fillh","-fillh26","-index","-edge","-nan","-nanm","-rand","-randn","-range"] + "ParametersNoValue" : ["-exp","-log","-sin","-cos","-tan","-asin","-acos","-atan","-sqr","-sqrt","-recip","-abs","-bin","-binv","-fillh","-fillh26","-Index","-edge","-nan","-nanm","-rand","-randn","-range"] }, { - "name": "mcflirt", - "used": ["-in"], - "generatedBy": ["-out"] + "Name": "mcflirt", + "Used": ["-in"], + "GeneratedBy": ["-out"] }, { - "name": "cp", - "used": [0], - "generatedBy": [1] + "Name": "cp", + "Used": [0], + "GeneratedBy": [1] }, { - "name": "mainfeatreg", - "used": ["-i", "-h", "-s"], - "generatedBy": ["-d"] + "Name": "mainfeatreg", + "Used": ["-i", "-h", "-s"], + "GeneratedBy": ["-d"] }, { - "name": "mkdir", - "generatedBy": ["0:"] + "Name": "mkdir", + "GeneratedBy": ["0:"] }, { - "name": "susan", - "used": [0], - "generatedBy": [-1] + "Name": "susan", + "Used": [0], + "GeneratedBy": [-1] }, { - "name": "bet2", - "used": [0], - "generatedBy": [1] + "Name": "bet2", + "Used": [0], + "GeneratedBy": [1] }, { - "name": "fslFixText", - "used": [0], - "generatedBy": [1] + "Name": "fslFixText", + "Used": [0], + "GeneratedBy": [1] }, { - "name": "fslstats", - "used": [0] + "Name": "fslstats", + "Used": [0] }, { - "name": "epi_reg", - "used": ["--epi", "--t1", "--t1brain"], - "generatedBy": ["--out"] + "Name": "epi_reg", + "Used": ["--epi", "--t1", "--t1brain"], + "GeneratedBy": ["--out"] }, { - "name": "fsl_tsplot", - "used": ["-i"], - "generatedBy": ["-o"] + "Name": "fsl_tsplot", + "Used": ["-i"], + "GeneratedBy": ["-o"] }, { - "name": "cluster", - "used": ["-i", "-c"], - "generatedBy": ["-o", "--othresh", "--olmax", "--olmaxim", "--osize", "--omax", "--omean", "--opvals", "-c", "--cope", "-x","--xfm", "--stdvol", "--warpvol"] + "Name": "cluster", + "Used": ["-i", "-c"], + "GeneratedBy": ["-o", "--othresh", "--olmax", "--olmaxim", "--osize", "--omax", "--omean", "--opvals", "-c", "--cope", "-x","--xfm", "--stdvol", "--warpvol"] }, { - "name": "echo", - "used": [2] + "Name": "echo", + "Used": [2] }, { - "name": "smoothest", - "used": ["-m", "-r"], - "generatedBy": ["-z", -1] + "Name": "smoothest", + "Used": ["-m", "-r"], + "GeneratedBy": ["-z", -1] }, { - "name": "feat_model", - "used": [0] + "Name": "feat_model", + "Used": [0] }, { - "name": "rm", - "used": ["0:"] + "Name": "rm", + "Used": ["0:"] }, { - "name": "mv", - "used": ["0:-1"], - "generatedBy": [-1] + "Name": "mv", + "Used": ["0:-1"], + "GeneratedBy": [-1] }, { - "name": "pngappend", - "used": ["0:-1"], - "generatedBy": [-1] + "Name": "pngappend", + "Used": ["0:-1"], + "GeneratedBy": [-1] }, { - "name": "ptoz" + "Name": "ptoz" }, { - "name": "overlay", - "generatedBy": [-1] + "Name": "overlay", + "GeneratedBy": [-1] }, { - "name": "paste" + "Name": "paste" }, { - "name": "featregapply" + "Name": "featregapply" }, { - "name": "tsplot", - "used": ["-i"], - "generatedBy": ["-o"] + "Name": "tsplot", + "Used": ["-i"], + "GeneratedBy": ["-o"] }, { - "name": "mp_diffpow.sh", - "used": [0], - "generatedBy": [1] + "Name": "mp_diffpow.sh", + "Used": [0], + "GeneratedBy": [1] }, { - "name": "cluster2html", - "used": [1] + "Name": "cluster2html", + "Used": [1] }, { - "name": "fslmerge" + "Name": "fslmerge" }, { - "name": "slicer", - "used": [0, 1], - "generatedBy": [ + "Name": "slicer", + "Used": [0, 1], + "GeneratedBy": [ "-a", { - "name": "-A", - "index": 1 + "Name": "-A", + "Index": 1 }, { - "name": "-S", - "index": 2 + "Name": "-S", + "Index": 2 }, { - "name": "-x", - "index": 1 + "Name": "-x", + "Index": 1 }, { - "name": "-y", - "index": 1 + "Name": "-y", + "Index": 1 }, { - "name": "-z", - "index": 1 + "Name": "-z", + "Index": 1 } ] }, { - "name": "film_gls", - "used": ["--in", "--rn", "--in2", "--mf", "--mft", "--pd", "--con", "--fcon"], - "generatedBy": ["--rn"] + "Name": "film_gls", + "Used": ["--in", "--rn", "--in2", "--mf", "--mft", "--pd", "--con", "--fcon"], + "GeneratedBy": ["--rn"] }, { - "name": "imrm", - "used": ["0:"] + "Name": "imrm", + "Used": ["0:"] }, { - "name": "ln" + "Name": "ln" }, { - "name": "flirt", - "used": ["-in", "-ref", "-init"], - "generatedBy": ["-omat", "-out", "-o"] + "Name": "flirt", + "Used": ["-in", "-ref", "-init"], + "GeneratedBy": ["-omat", "-out", "-o"] }, { - "name": "immv", - "used": ["0:-1"], - "generatedBy": [-1] + "Name": "immv", + "Used": ["0:-1"], + "GeneratedBy": [-1] }, { - "name": "printf" + "Name": "printf" }, { - "name": "fsl_sub" + "Name": "fsl_sub" }, { - "name": "contrast_mgr" + "Name": "contrast_mgr" }, { - "name": "convert_xfm", - "used": [-1], - "generatedBy": ["-omat"] + "Name": "convert_xfm", + "Used": [-1], + "GeneratedBy": ["-omat"] }, { - "name": "rmdir", - "used": [0] + "Name": "rmdir", + "Used": [0] } ] diff --git a/bids_prov/fsl/fsl_parser.py b/bids_prov/fsl/fsl_parser.py index 3bcb3e458..87c949086 100644 --- a/bids_prov/fsl/fsl_parser.py +++ b/bids_prov/fsl/fsl_parser.py @@ -143,7 +143,7 @@ def readlines(filename: str) -> Mapping[str, List[str]]: def _get_kwarg(serie, with_value=True): """ - Get the named arguments (kwarg) from a column ("Used", "GeneratedBy", "parameters_value" or "parameters_no_value" ) of the dataframe coming frome in description_functions.json + Get the named arguments (kwarg) from a column ("Used", "GeneratedBy", "ParametersValue" or "parameters_no_value" ) of the dataframe coming frome in description_functions.json Parameters ---------- @@ -151,7 +151,7 @@ def _get_kwarg(serie, with_value=True): serie : pandas series A list of the command arguments description. with_value : boolean - A bool to specify if values are expected or not, in order to dicrimine "parameters_value" (with_value=True), and "parameters_no_value" (with_value=False) + A bool to specify if values are expected or not, in order to dicrimine "ParametersValue" (with_value=True), and "parameters_no_value" (with_value=False) Returns ------- @@ -321,7 +321,7 @@ def get_entities(cmd_s, parameters): inputs_kwarg = [] outputs_kwarg = [] - parameters_value = [] + ParametersValue = [] parameters_no_value = [] # print("\n\n cmd_s", cmd_s) @@ -347,9 +347,9 @@ def get_entities(cmd_s, parameters): arg = kwarg.pop("arg") parser.add_argument(arg, **kwarg) - if "parameters_value" in parameters: - add_argument_list, parameters_value = _get_kwarg( - parameters["parameters_value"]) + if "ParametersValue" in parameters: + add_argument_list, ParametersValue = _get_kwarg( + parameters["ParametersValue"]) for kwarg in add_argument_list: arg = kwarg.pop("arg") parser.add_argument(arg, **kwarg) @@ -367,7 +367,7 @@ def get_entities(cmd_s, parameters): # print("\n\n parse_known_args", opts) # print("\n\n inputs_kwarg", inputs_kwarg) # print("\n\n outputs_kwarg", outputs_kwarg) - # print("\n\n parameters_value", parameters_value) + # print("\n\n ParametersValue", ParametersValue) # print("\n\n parameters_no_value", parameters_no_value) # print("\n\n arg_rest", arg_rest) @@ -379,7 +379,7 @@ def get_entities(cmd_s, parameters): params = [] inputs = _get_entities_from_kwarg(inputs, opts, inputs_kwarg) outputs = _get_entities_from_kwarg(outputs, opts, outputs_kwarg) - params = _get_entities_from_kwarg(params, opts, parameters_value) + params = _get_entities_from_kwarg(params, opts, ParametersValue) params = _get_entities_from_kwarg(params, opts, parameters_no_value) if "Used" in parameters: diff --git a/bids_prov/spm/spm_parser.py b/bids_prov/spm/spm_parser.py index 6258cf135..d6580f493 100644 --- a/bids_prov/spm/spm_parser.py +++ b/bids_prov/spm/spm_parser.py @@ -166,7 +166,7 @@ def get_entities_from_ext_config(conf_dic: dict, activity_name: str, activity_id for activity in conf_dic.keys(): if activity in activity_name: # {'name': 'segment', 'outputs': ['c1xxx.nii.gz','c2xxx.nii.gz']} - # act_preproc = next((activity for activity in records["prov:Activity"] if activity['@id'] == + # act_preproc = next((activity for activity in records["Activities"] if activity['@id'] == # activity_id), None) for output in conf_dic[activity]['outputs']: name = conf_dic[activity]['name'] @@ -293,7 +293,7 @@ def get_records(task_groups: dict, agent_id: str, verbose=False) -> dict: Returns ------- dict[str, list] - records : dict with key "@context", ... "Records":{"prov:Agent": ..."prov:Activity":..."Entities":....} + records : dict with key "@context", ... "Records":{"prov:Agent": ..."Activities":..."Entities":....} """ diff --git a/bids_prov/tests/samples_test/batch_example_spm.jsonld b/bids_prov/tests/samples_test/batch_example_spm.jsonld index 3f1d68c71..40c800e1f 100644 --- a/bids_prov/tests/samples_test/batch_example_spm.jsonld +++ b/bids_prov/tests/samples_test/batch_example_spm.jsonld @@ -1,15 +1,14 @@ { "@context": "https://raw.githubusercontent.com/bids-standard/BEP028_BIDSprov/master/context.json", "BIDSProvVersion": "dev", - "@id": "http://example.org/ds00000X", "Records": { - "Activities": [ + "prov:Agent": [ { "@id": "urn:c15521b1-b3dc-450a-9daa-37e51b591d75", "RRID": "RRID:SCR_007037", "@type": "prov:SoftwareAgent", "Label": "SPM", - "Version": "SPM12r7224" + "version": "SPM12r7224" } ], "Activities": [ @@ -63,7 +62,7 @@ ], "AssociatedWith": "urn:c15521b1-b3dc-450a-9daa-37e51b591d75", "Command": "matlabbatch{5}.spm.spatial.realign.estwrite.data{1}(1) = cfg_dep('GunZip Files: GunZipped Files', substruct('.','val', '{}',{3}, '.','val', '{}',{1}, '.','val', '{}',{1}, '.','val', '{}',{1}), substruct('()',{':'}));\nmatlabbatch{5}.spm.spatial.realign.estwrite.eoptions.quality = 0.9;\nmatlabbatch{5}.spm.spatial.realign.estwrite.eoptions.sep = 4;\nmatlabbatch{5}.spm.spatial.realign.estwrite.eoptions.fwhm = 5;\nmatlabbatch{5}.spm.spatial.realign.estwrite.eoptions.rtm = 1;\nmatlabbatch{5}.spm.spatial.realign.estwrite.eoptions.interp = 2;\nmatlabbatch{5}.spm.spatial.realign.estwrite.eoptions.wrap = [0 0 0];\nmatlabbatch{5}.spm.spatial.realign.estwrite.eoptions.weight = '';\nmatlabbatch{5}.spm.spatial.realign.estwrite.roptions.which = [0 1];\nmatlabbatch{5}.spm.spatial.realign.estwrite.roptions.interp = 4;\nmatlabbatch{5}.spm.spatial.realign.estwrite.roptions.wrap = [0 0 0];\nmatlabbatch{5}.spm.spatial.realign.estwrite.roptions.mask = 1;\nmatlabbatch{5}.spm.spatial.realign.estwrite.roptions.prefix = 'r';", - "parameters": { + "Parameters": { "eoptions.quality": "0.9", "eoptions.sep": "4", "eoptions.fwhm": "5", @@ -87,7 +86,7 @@ ], "AssociatedWith": "urn:c15521b1-b3dc-450a-9daa-37e51b591d75", "Command": "matlabbatch{6}.spm.spatial.coreg.estimate.ref(1) = cfg_dep('Realign: Estimate & Reslice: Mean Image', substruct('.','val', '{}',{5}, '.','val', '{}',{1}, '.','val', '{}',{1}, '.','val', '{}',{1}), substruct('.','rmean'));\nmatlabbatch{6}.spm.spatial.coreg.estimate.source(1) = cfg_dep('GunZip Files: GunZipped Files', substruct('.','val', '{}',{4}, '.','val', '{}',{1}, '.','val', '{}',{1}, '.','val', '{}',{1}), substruct('()',{':'}));\nmatlabbatch{6}.spm.spatial.coreg.estimate.other = {''};\nmatlabbatch{6}.spm.spatial.coreg.estimate.eoptions.cost_fun = 'nmi';\nmatlabbatch{6}.spm.spatial.coreg.estimate.eoptions.sep = [4 2];\nmatlabbatch{6}.spm.spatial.coreg.estimate.eoptions.tol = [0.02 0.02 0.02 0.001 0.001 0.001 0.01 0.01 0.01 0.001 0.001 0.001];\nmatlabbatch{6}.spm.spatial.coreg.estimate.eoptions.fwhm = [7 7];", - "parameters": { + "Parameters": { "other": "{''}", "eoptions.cost_fun": "'nmi'", "eoptions.sep": "[4, 2]", @@ -103,7 +102,7 @@ ], "AssociatedWith": "urn:c15521b1-b3dc-450a-9daa-37e51b591d75", "Command": "matlabbatch{7}.spm.spatial.preproc.channel.vols(1) = cfg_dep('GunZip Files: GunZipped Files', substruct('.','val', '{}',{4}, '.','val', '{}',{1}, '.','val', '{}',{1}, '.','val', '{}',{1}), substruct('()',{':'}));\nmatlabbatch{7}.spm.spatial.preproc.channel.biasreg = 0.001;\nmatlabbatch{7}.spm.spatial.preproc.channel.biasfwhm = 60;\nmatlabbatch{7}.spm.spatial.preproc.channel.write = [0 1];\nmatlabbatch{7}.spm.spatial.preproc.tissue(1).tpm = {'/storage/essicd/data/NIDM-Ex/spm12_update/tpm/TPM.nii,1'};\nmatlabbatch{7}.spm.spatial.preproc.tissue(1).ngaus = 1;\nmatlabbatch{7}.spm.spatial.preproc.tissue(1).native = [1 0];\nmatlabbatch{7}.spm.spatial.preproc.tissue(1).warped = [0 0];\nmatlabbatch{7}.spm.spatial.preproc.tissue(2).tpm = {'/storage/essicd/data/NIDM-Ex/spm12_update/tpm/TPM.nii,2'};\nmatlabbatch{7}.spm.spatial.preproc.tissue(2).ngaus = 1;\nmatlabbatch{7}.spm.spatial.preproc.tissue(2).native = [1 0];\nmatlabbatch{7}.spm.spatial.preproc.tissue(2).warped = [0 0];\nmatlabbatch{7}.spm.spatial.preproc.tissue(3).tpm = {'/storage/essicd/data/NIDM-Ex/spm12_update/tpm/TPM.nii,3'};\nmatlabbatch{7}.spm.spatial.preproc.tissue(3).ngaus = 2;\nmatlabbatch{7}.spm.spatial.preproc.tissue(3).native = [1 0];\nmatlabbatch{7}.spm.spatial.preproc.tissue(3).warped = [0 0];\nmatlabbatch{7}.spm.spatial.preproc.tissue(4).tpm = {'/storage/essicd/data/NIDM-Ex/spm12_update/tpm/TPM.nii,4'};\nmatlabbatch{7}.spm.spatial.preproc.tissue(4).ngaus = 3;\nmatlabbatch{7}.spm.spatial.preproc.tissue(4).native = [1 0];\nmatlabbatch{7}.spm.spatial.preproc.tissue(4).warped = [0 0];\nmatlabbatch{7}.spm.spatial.preproc.tissue(5).tpm = {'/storage/essicd/data/NIDM-Ex/spm12_update/tpm/TPM.nii,5'};\nmatlabbatch{7}.spm.spatial.preproc.tissue(5).ngaus = 4;\nmatlabbatch{7}.spm.spatial.preproc.tissue(5).native = [1 0];\nmatlabbatch{7}.spm.spatial.preproc.tissue(5).warped = [0 0];\nmatlabbatch{7}.spm.spatial.preproc.tissue(6).tpm = {'/storage/essicd/data/NIDM-Ex/spm12_update/tpm/TPM.nii,6'};\nmatlabbatch{7}.spm.spatial.preproc.tissue(6).ngaus = 2;\nmatlabbatch{7}.spm.spatial.preproc.tissue(6).native = [0 0];\nmatlabbatch{7}.spm.spatial.preproc.tissue(6).warped = [0 0];\nmatlabbatch{7}.spm.spatial.preproc.warp.mrf = 1;\nmatlabbatch{7}.spm.spatial.preproc.warp.cleanup = 1;\nmatlabbatch{7}.spm.spatial.preproc.warp.reg = [0 0.001 0.5 0.05 0.2];\nmatlabbatch{7}.spm.spatial.preproc.warp.affreg = 'mni';\nmatlabbatch{7}.spm.spatial.preproc.warp.fwhm = 0;\nmatlabbatch{7}.spm.spatial.preproc.warp.samp = 3;\nmatlabbatch{7}.spm.spatial.preproc.warp.write = [0 1];", - "parameters": { + "Parameters": { "channel.biasreg": "0.001", "channel.biasfwhm": "60", "channel.write": "[0, 1]", @@ -149,7 +148,7 @@ ], "AssociatedWith": "urn:c15521b1-b3dc-450a-9daa-37e51b591d75", "Command": "matlabbatch{8}.spm.spatial.normalise.write.subj.def(1) = cfg_dep('Segment: Forward Deformations', substruct('.','val', '{}',{7}, '.','val', '{}',{1}, '.','val', '{}',{1}), substruct('.','fordef', '()',{':'}));\nmatlabbatch{8}.spm.spatial.normalise.write.subj.resample(1) = cfg_dep('Realign: Estimate & Reslice: Realigned Images (Sess 1)', substruct('.','val', '{}',{5}, '.','val', '{}',{1}, '.','val', '{}',{1}, '.','val', '{}',{1}), substruct('.','sess', '()',{1}, '.','cfiles'));\nmatlabbatch{8}.spm.spatial.normalise.write.woptions.bb = [-78 -112 -70 78 76 85];\nmatlabbatch{8}.spm.spatial.normalise.write.woptions.vox = [2 2 2];\nmatlabbatch{8}.spm.spatial.normalise.write.woptions.interp = 4;\nmatlabbatch{8}.spm.spatial.normalise.write.woptions.prefix = 'w';", - "parameters": { + "Parameters": { "woptions.bb": "[-78, -112, -70, 78, 76, 85]", "woptions.vox": "[2, 2, 2]", "woptions.interp": "4", @@ -165,7 +164,7 @@ ], "AssociatedWith": "urn:c15521b1-b3dc-450a-9daa-37e51b591d75", "Command": "matlabbatch{9}.spm.spatial.normalise.write.subj.def(1) = cfg_dep('Segment: Forward Deformations', substruct('.','val', '{}',{7}, '.','val', '{}',{1}, '.','val', '{}',{1}), substruct('.','fordef', '()',{':'}));\nmatlabbatch{9}.spm.spatial.normalise.write.subj.resample(1) = cfg_dep('Segment: Bias Corrected (1)', substruct('.','val', '{}',{7}, '.','val', '{}',{1}, '.','val', '{}',{1}), substruct('.','channel', '()',{1}, '.','biascorr', '()',{':'}));\nmatlabbatch{9}.spm.spatial.normalise.write.woptions.bb = [-78 -112 -70 78 76 85];\nmatlabbatch{9}.spm.spatial.normalise.write.woptions.vox = [2 2 2];\nmatlabbatch{9}.spm.spatial.normalise.write.woptions.interp = 4;\nmatlabbatch{9}.spm.spatial.normalise.write.woptions.prefix = 'w';", - "parameters": { + "Parameters": { "woptions.bb": "[-78, -112, -70, 78, 76, 85]", "woptions.vox": "[2, 2, 2]", "woptions.interp": "4", @@ -180,7 +179,7 @@ ], "AssociatedWith": "urn:c15521b1-b3dc-450a-9daa-37e51b591d75", "Command": "matlabbatch{10}.spm.spatial.smooth.data(1) = cfg_dep('Normalise: Write: Normalised Images (Subj 1)', substruct('.','val', '{}',{8}, '.','val', '{}',{1}, '.','val', '{}',{1}, '.','val', '{}',{1}), substruct('()',{1}, '.','files'));\nmatlabbatch{10}.spm.spatial.smooth.fwhm = [6 6 6];\nmatlabbatch{10}.spm.spatial.smooth.dtype = 0;\nmatlabbatch{10}.spm.spatial.smooth.im = 0;\nmatlabbatch{10}.spm.spatial.smooth.prefix = 's';", - "parameters": { + "Parameters": { "fwhm": "[6, 6, 6]", "dtype": "0", "im": "0", @@ -196,7 +195,7 @@ ], "AssociatedWith": "urn:c15521b1-b3dc-450a-9daa-37e51b591d75", "Command": "matlabbatch{11}.spm.stats.fmri_spec.dir = {'/storage/essicd/data/NIDM-Ex/BIDS_Data/RESULTS/TEST/nidmresults-examples/spm_contrast_mask'};\nmatlabbatch{11}.spm.stats.fmri_spec.timing.units = 'secs';\nmatlabbatch{11}.spm.stats.fmri_spec.timing.RT = 2;\nmatlabbatch{11}.spm.stats.fmri_spec.timing.fmri_t = 16;\nmatlabbatch{11}.spm.stats.fmri_spec.timing.fmri_t0 = 8;\nmatlabbatch{11}.spm.stats.fmri_spec.sess.scans(1) = cfg_dep('Smooth: Smoothed Images', substruct('.','val', '{}',{10}, '.','val', '{}',{1}, '.','val', '{}',{1}), substruct('.','files'));\nmatlabbatch{11}.spm.stats.fmri_spec.sess.cond = struct('name', {}, 'onset', {}, 'duration', {}, 'tmod', {}, 'pmod', {}, 'orth', {});\nmatlabbatch{11}.spm.stats.fmri_spec.sess.multi = {'/storage/essicd/data/NIDM-Ex/BIDS_Data/RESULTS/EXAMPLES/ds011/SPM/PREPROCESSING/ONSETS/sub-01-MultiCond.mat'};\nmatlabbatch{11}.spm.stats.fmri_spec.sess.regress = struct('name', {}, 'val', {});\nmatlabbatch{11}.spm.stats.fmri_spec.sess.multi_reg = {''};\nmatlabbatch{11}.spm.stats.fmri_spec.sess.hpf = 128;\nmatlabbatch{11}.spm.stats.fmri_spec.fact = struct('name', {}, 'levels', {});\nmatlabbatch{11}.spm.stats.fmri_spec.bases.hrf.derivs = [0 0];\nmatlabbatch{11}.spm.stats.fmri_spec.volt = 1;\nmatlabbatch{11}.spm.stats.fmri_spec.global = 'None';\nmatlabbatch{11}.spm.stats.fmri_spec.mthresh = 0.8;\nmatlabbatch{11}.spm.stats.fmri_spec.mask = {''};\nmatlabbatch{11}.spm.stats.fmri_spec.cvi = 'AR(1)';", - "parameters": { + "Parameters": { "dir": "{'/storage/essicd/data/NIDM-Ex/BIDS_Data/RESULTS/TEST/nidmresults-examples/spm_contrast_mask'}", "timing.units": "'secs'", "timing.RT": "2", @@ -223,7 +222,7 @@ ], "AssociatedWith": "urn:c15521b1-b3dc-450a-9daa-37e51b591d75", "Command": "matlabbatch{12}.spm.stats.fmri_est.spmmat(1) = cfg_dep('fMRI model specification: SPM.mat File', substruct('.','val', '{}',{11}, '.','val', '{}',{1}, '.','val', '{}',{1}), substruct('.','spmmat'));\nmatlabbatch{12}.spm.stats.fmri_est.write_residuals = 0;\nmatlabbatch{12}.spm.stats.fmri_est.method.Classical = 1;", - "parameters": { + "Parameters": { "write_residuals": "0", "method.Classical": "1" } @@ -236,7 +235,7 @@ ], "AssociatedWith": "urn:c15521b1-b3dc-450a-9daa-37e51b591d75", "Command": "matlabbatch{13}.spm.stats.con.spmmat(1) = cfg_dep('Model estimation: SPM.mat File', substruct('.','val', '{}',{12}, '.','val', '{}',{1}, '.','val', '{}',{1}), substruct('.','spmmat'));\nmatlabbatch{13}.spm.stats.con.consess{1}.tcon.name = 'tone counting vs baseline';\nmatlabbatch{13}.spm.stats.con.consess{1}.tcon.weights = [1 0];\nmatlabbatch{13}.spm.stats.con.consess{1}.tcon.sessrep = 'none';\nmatlabbatch{13}.spm.stats.con.consess{2}.tcon.name = 'tone counting probe vs baseline';\nmatlabbatch{13}.spm.stats.con.consess{2}.tcon.weights = [0 1];\nmatlabbatch{13}.spm.stats.con.consess{2}.tcon.sessrep = 'none';\nmatlabbatch{13}.spm.stats.con.delete = 0;", - "parameters": { + "Parameters": { "consess{1}.tcon.name": "'tone counting vs baseline'", "consess{1}.tcon.weights": "[1, 0]", "consess{1}.tcon.sessrep": "'none'", @@ -254,7 +253,7 @@ ], "AssociatedWith": "urn:c15521b1-b3dc-450a-9daa-37e51b591d75", "Command": "matlabbatch{14}.spm.stats.results.spmmat(1) = cfg_dep('Contrast Manager: SPM.mat File', substruct('.','val', '{}',{13}, '.','val', '{}',{1}, '.','val', '{}',{1}), substruct('.','spmmat'));\nmatlabbatch{14}.spm.stats.results.conspec.titlestr = '';\nmatlabbatch{14}.spm.stats.results.conspec.contrasts = 1;\nmatlabbatch{14}.spm.stats.results.conspec.threshdesc = 'none';\nmatlabbatch{14}.spm.stats.results.conspec.thresh = 0.001;\nmatlabbatch{14}.spm.stats.results.conspec.extent = 0;\nmatlabbatch{14}.spm.stats.results.conspec.conjunction = 1;\nmatlabbatch{14}.spm.stats.results.conspec.mask.contrast.contrasts = 2;\nmatlabbatch{14}.spm.stats.results.conspec.mask.contrast.thresh = 0.05;\nmatlabbatch{14}.spm.stats.results.conspec.mask.contrast.mtype = 0;\nmatlabbatch{14}.spm.stats.results.units = 1;\nmatlabbatch{14}.spm.stats.results.print = 'pdf';\nmatlabbatch{14}.spm.stats.results.write.none = 1;", - "parameters": { + "Parameters": { "conspec.titlestr": "''", "conspec.contrasts": "1", "conspec.threshdesc": "'none'", @@ -276,7 +275,7 @@ "Label": "func_sub-01_task-tonecounting_bold.nii.gz", "AtLocation": "/storage/essicd/data/NIDM-Ex/BIDS_Data/DATA/BIDS/ds011/sub-01/func/sub-01_task-tonecounting_bold.nii.gz", "digest": { - "sha256": "fb2cf448c0c65ac4dd070fadddb9f8f5dd784be41b59c7c1049646bd651f706b" + "sha256": "84ce64d6d5f5fac47da35862d3c4549d273a10101d2b17bad80270c111929018" } }, { @@ -284,7 +283,7 @@ "Label": "anat_sub-01_T1w.nii.gz", "AtLocation": "/storage/essicd/data/NIDM-Ex/BIDS_Data/DATA/BIDS/ds011/sub-01/anat/sub-01_T1w.nii.gz", "digest": { - "sha256": "6c8218922a9c951808b41435d1c0915fae003c74acd598385cc25d00f8463e3a" + "sha256": "a4b491b8a386cadefa6face537697cdcdcaf0a40a7c39594e49cdecbbba89f97" } }, { @@ -315,19 +314,21 @@ { "@id": "urn:e57b37e7-704b-4d09-af2e-ab42fd8cfe33", "Label": "segment1", - "AtLocation": "c1anat_sub-01_T1w.nii", + "Atlocation": "c1xxx.nii.gz", "GeneratedBy": "urn:95522f9a-6757-4c02-a1c2-df96fa5e2d63", + "AtLocation": "c1anat_sub-01_T1w.nii", "digest": { - "sha256": "7931047dca66b97c916267a25cf55b95011813ec3d36f0160a6eda561be2c8be" + "sha256": "030d6d21e61169b232b40e0a1da7d0190d93b0b26598cf22b23b63d776c6d146" } }, { "@id": "urn:a40f9ca3-df62-492c-982a-3add9b872a76", "Label": "segment2", - "AtLocation": "c2anat_sub-01_T1w.nii", + "Atlocation": "c2xxx.nii.gz", "GeneratedBy": "urn:95522f9a-6757-4c02-a1c2-df96fa5e2d63", + "AtLocation": "c2anat_sub-01_T1w.nii", "digest": { - "sha256": "4c1823ee4716970114afc99ad01a1839d442765a038f0f2403dda6b70926a533" + "sha256": "0936edc9ad3276f57baf94fae16dee70e1f38cb6a4ed8de417e86243e1c895fa" } }, { @@ -340,7 +341,7 @@ "Label": "ONSETS_sub-01-MultiCond.mat", "AtLocation": "/storage/essicd/data/NIDM-Ex/BIDS_Data/RESULTS/EXAMPLES/ds011/SPM/PREPROCESSING/ONSETS/sub-01-MultiCond.mat", "digest": { - "sha256": "11d27033ca8efe522163b6f908853ee9cee7b9be9398e2035992610588d39cb8" + "sha256": "963bdf2f5c143a210c6fb6f5afaf6edfad66db8a20c1d1bac08263339c423ca9" } }, { diff --git a/bids_prov/tests/samples_test/batch_example_spm_ref.jsonld b/bids_prov/tests/samples_test/batch_example_spm_ref.jsonld index 6129d9a41..014ba93c7 100644 --- a/bids_prov/tests/samples_test/batch_example_spm_ref.jsonld +++ b/bids_prov/tests/samples_test/batch_example_spm_ref.jsonld @@ -12,7 +12,7 @@ "version": "SPM12r7224" } ], - "prov:Activity": [ + "Activities": [ { "@id": "urn:3f372617-f0ba-4f3a-86f0-ce2ea6ec39c1", "Label": "Move file", @@ -20,7 +20,7 @@ "urn:4a800646-417a-4105-bc31-99944567ceb1" ], "AssociatedWith": "urn:c15521b1-b3dc-450a-9daa-37e51b591d75", - "parameters": { + "Parameters": { "action.copyto": "{'/storage/essicd/data/NIDM-Ex/BIDS_Data/RESULTS/EXAMPLES/ds011/SPM/PREPROCESSING/FUNCTIONAL'}" } }, @@ -31,7 +31,7 @@ "urn:df7142dc-af29-46f8-b774-4cca4d909eb2" ], "AssociatedWith": "urn:c15521b1-b3dc-450a-9daa-37e51b591d75", - "parameters": { + "Parameters": { "action.copyto": "{'/storage/essicd/data/NIDM-Ex/BIDS_Data/RESULTS/EXAMPLES/ds011/SPM/PREPROCESSING/ANATOMICAL'}" } }, @@ -58,7 +58,7 @@ "urn:467c0714-a9fb-4797-aa59-c1698d242349" ], "AssociatedWith": "urn:c15521b1-b3dc-450a-9daa-37e51b591d75", - "parameters": { + "Parameters": { "eoptions.quality": "0.9", "eoptions.sep": "4", "eoptions.fwhm": "5", @@ -81,7 +81,7 @@ "urn:daa4ed3c-3454-4ae4-8628-7225154d1eb0" ], "AssociatedWith": "urn:c15521b1-b3dc-450a-9daa-37e51b591d75", - "parameters": { + "Parameters": { "other": "{''}", "eoptions.cost_fun": "'nmi'", "eoptions.sep": "[4, 2]", @@ -96,7 +96,7 @@ "urn:daa4ed3c-3454-4ae4-8628-7225154d1eb0" ], "AssociatedWith": "urn:c15521b1-b3dc-450a-9daa-37e51b591d75", - "parameters": { + "Parameters": { "channel.biasreg": "0.001", "channel.biasfwhm": "60", "channel.write": "[0, 1]", @@ -141,7 +141,7 @@ "urn:071d1481-5649-48e9-9846-6a921f7ea79c" ], "AssociatedWith": "urn:c15521b1-b3dc-450a-9daa-37e51b591d75", - "parameters": { + "Parameters": { "woptions.bb": "[-78, -112, -70, 78, 76, 85]", "woptions.vox": "[2, 2, 2]", "woptions.interp": "4", @@ -156,7 +156,7 @@ "urn:e57b37e7-704b-4d09-af2e-ab42fd8cfe33" ], "AssociatedWith": "urn:c15521b1-b3dc-450a-9daa-37e51b591d75", - "parameters": { + "Parameters": { "woptions.bb": "[-78, -112, -70, 78, 76, 85]", "woptions.vox": "[2, 2, 2]", "woptions.interp": "4", @@ -170,7 +170,7 @@ "urn:ac189004-8387-4e75-bc93-a36cdff27e9f" ], "AssociatedWith": "urn:c15521b1-b3dc-450a-9daa-37e51b591d75", - "parameters": { + "Parameters": { "fwhm": "[6, 6, 6]", "dtype": "0", "im": "0", @@ -185,7 +185,7 @@ "urn:1f05f4d1-1a38-4927-812e-cd08801f772d" ], "AssociatedWith": "urn:c15521b1-b3dc-450a-9daa-37e51b591d75", - "parameters": { + "Parameters": { "dir": "{'/storage/essicd/data/NIDM-Ex/BIDS_Data/RESULTS/TEST/nidmresults-examples/spm_contrast_mask'}", "timing.units": "'secs'", "timing.RT": "2", @@ -211,7 +211,7 @@ "urn:29663157-072a-468b-9e47-921f47d9e875" ], "AssociatedWith": "urn:c15521b1-b3dc-450a-9daa-37e51b591d75", - "parameters": { + "Parameters": { "write_residuals": "0", "method.Classical": "1" } @@ -223,7 +223,7 @@ "urn:6cd92a40-17cd-479a-9600-66c386988190" ], "AssociatedWith": "urn:c15521b1-b3dc-450a-9daa-37e51b591d75", - "parameters": { + "Parameters": { "consess{1}.tcon.name": "'tone counting vs baseline'", "consess{1}.tcon.weights": "[1, 0]", "consess{1}.tcon.sessrep": "'none'", @@ -240,7 +240,7 @@ "urn:4f3d0144-7485-4165-a2fe-005b88ebf5e6" ], "AssociatedWith": "urn:c15521b1-b3dc-450a-9daa-37e51b591d75", - "parameters": { + "Parameters": { "conspec.titlestr": "''", "conspec.contrasts": "1", "conspec.threshdesc": "'none'", diff --git a/bids_prov/tests/samples_test/partial_conjunction.jsonld b/bids_prov/tests/samples_test/partial_conjunction.jsonld index ea0058b9b..7ddade97f 100644 --- a/bids_prov/tests/samples_test/partial_conjunction.jsonld +++ b/bids_prov/tests/samples_test/partial_conjunction.jsonld @@ -12,7 +12,7 @@ "version": "SPM12r7224" } ], - "prov:Activity": [ + "Activities": [ { "@id": "urn:3f372617-f0ba-4f3a-86f0-ce2ea6ec39c1", "Label": "Move file", @@ -21,7 +21,7 @@ ], "AssociatedWith": "urn:c15521b1-b3dc-450a-9daa-37e51b591d75", "Command": "matlabbatch{1}.cfg_basicio.file_dir.file_ops.file_move.files = {'/storage/essicd/data/NIDM-Ex/BIDS_Data/DATA/BIDS/ds011/sub-01/func/sub-01_task-tonecounting_bold.nii.gz'};\nmatlabbatch{1}.cfg_basicio.file_dir.file_ops.file_move.action.copyto = {'/storage/essicd/data/NIDM-Ex/BIDS_Data/RESULTS/EXAMPLES/ds011/SPM/PREPROCESSING/FUNCTIONAL'};", - "parameters": { + "Parameters": { "action.copyto": "{'/storage/essicd/data/NIDM-Ex/BIDS_Data/RESULTS/EXAMPLES/ds011/SPM/PREPROCESSING/FUNCTIONAL'}" } }, @@ -33,7 +33,7 @@ ], "AssociatedWith": "urn:c15521b1-b3dc-450a-9daa-37e51b591d75", "Command": "matlabbatch{2}.cfg_basicio.file_dir.file_ops.file_move.files = {'/storage/essicd/data/NIDM-Ex/BIDS_Data/DATA/BIDS/ds011/sub-01/anat/sub-01_T1w.nii.gz'};\nmatlabbatch{2}.cfg_basicio.file_dir.file_ops.file_move.action.copyto = {'/storage/essicd/data/NIDM-Ex/BIDS_Data/RESULTS/EXAMPLES/ds011/SPM/PREPROCESSING/ANATOMICAL'};", - "parameters": { + "Parameters": { "action.copyto": "{'/storage/essicd/data/NIDM-Ex/BIDS_Data/RESULTS/EXAMPLES/ds011/SPM/PREPROCESSING/ANATOMICAL'}" } }, @@ -63,7 +63,7 @@ ], "AssociatedWith": "urn:c15521b1-b3dc-450a-9daa-37e51b591d75", "Command": "matlabbatch{5}.spm.spatial.realign.estwrite.data{1}(1) = cfg_dep('GunZip Files: GunZipped Files', substruct('.','val', '{}',{3}, '.','val', '{}',{1}, '.','val', '{}',{1}, '.','val', '{}',{1}), substruct('()',{':'}));\nmatlabbatch{5}.spm.spatial.realign.estwrite.eoptions.quality = 0.9;\nmatlabbatch{5}.spm.spatial.realign.estwrite.eoptions.sep = 4;\nmatlabbatch{5}.spm.spatial.realign.estwrite.eoptions.fwhm = 5;\nmatlabbatch{5}.spm.spatial.realign.estwrite.eoptions.rtm = 1;\nmatlabbatch{5}.spm.spatial.realign.estwrite.eoptions.interp = 2;\nmatlabbatch{5}.spm.spatial.realign.estwrite.eoptions.wrap = [0 0 0];\nmatlabbatch{5}.spm.spatial.realign.estwrite.eoptions.weight = '';\nmatlabbatch{5}.spm.spatial.realign.estwrite.roptions.which = [0 1];\nmatlabbatch{5}.spm.spatial.realign.estwrite.roptions.interp = 4;\nmatlabbatch{5}.spm.spatial.realign.estwrite.roptions.wrap = [0 0 0];\nmatlabbatch{5}.spm.spatial.realign.estwrite.roptions.mask = 1;\nmatlabbatch{5}.spm.spatial.realign.estwrite.roptions.prefix = 'r';", - "parameters": { + "Parameters": { "eoptions.quality": "0.9", "eoptions.sep": "4", "eoptions.fwhm": "5", @@ -87,7 +87,7 @@ ], "AssociatedWith": "urn:c15521b1-b3dc-450a-9daa-37e51b591d75", "Command": "matlabbatch{6}.spm.spatial.coreg.estimate.ref(1) = cfg_dep('Realign: Estimate & Reslice: Mean Image', substruct('.','val', '{}',{5}, '.','val', '{}',{1}, '.','val', '{}',{1}, '.','val', '{}',{1}), substruct('.','rmean'));\nmatlabbatch{6}.spm.spatial.coreg.estimate.source(1) = cfg_dep('GunZip Files: GunZipped Files', substruct('.','val', '{}',{4}, '.','val', '{}',{1}, '.','val', '{}',{1}, '.','val', '{}',{1}), substruct('()',{':'}));\nmatlabbatch{6}.spm.spatial.coreg.estimate.other = {''};\nmatlabbatch{6}.spm.spatial.coreg.estimate.eoptions.cost_fun = 'nmi';\nmatlabbatch{6}.spm.spatial.coreg.estimate.eoptions.sep = [4 2];\nmatlabbatch{6}.spm.spatial.coreg.estimate.eoptions.tol = [0.02 0.02 0.02 0.001 0.001 0.001 0.01 0.01 0.01 0.001 0.001 0.001];\nmatlabbatch{6}.spm.spatial.coreg.estimate.eoptions.fwhm = [7 7];", - "parameters": { + "Parameters": { "other": "{''}", "eoptions.cost_fun": "'nmi'", "eoptions.sep": "[4, 2]", @@ -103,7 +103,7 @@ ], "AssociatedWith": "urn:c15521b1-b3dc-450a-9daa-37e51b591d75", "Command": "matlabbatch{7}.spm.spatial.preproc.channel.vols(1) = cfg_dep('GunZip Files: GunZipped Files', substruct('.','val', '{}',{4}, '.','val', '{}',{1}, '.','val', '{}',{1}, '.','val', '{}',{1}), substruct('()',{':'}));\nmatlabbatch{7}.spm.spatial.preproc.channel.biasreg = 0.001;\nmatlabbatch{7}.spm.spatial.preproc.channel.biasfwhm = 60;\nmatlabbatch{7}.spm.spatial.preproc.channel.write = [0 1];\nmatlabbatch{7}.spm.spatial.preproc.tissue(1).tpm = {'/storage/essicd/data/NIDM-Ex/spm12_update/tpm/TPM.nii,1'};\nmatlabbatch{7}.spm.spatial.preproc.tissue(1).ngaus = 1;\nmatlabbatch{7}.spm.spatial.preproc.tissue(1).native = [1 0];\nmatlabbatch{7}.spm.spatial.preproc.tissue(1).warped = [0 0];\nmatlabbatch{7}.spm.spatial.preproc.tissue(2).tpm = {'/storage/essicd/data/NIDM-Ex/spm12_update/tpm/TPM.nii,2'};\nmatlabbatch{7}.spm.spatial.preproc.tissue(2).ngaus = 1;\nmatlabbatch{7}.spm.spatial.preproc.tissue(2).native = [1 0];\nmatlabbatch{7}.spm.spatial.preproc.tissue(2).warped = [0 0];\nmatlabbatch{7}.spm.spatial.preproc.tissue(3).tpm = {'/storage/essicd/data/NIDM-Ex/spm12_update/tpm/TPM.nii,3'};\nmatlabbatch{7}.spm.spatial.preproc.tissue(3).ngaus = 2;\nmatlabbatch{7}.spm.spatial.preproc.tissue(3).native = [1 0];\nmatlabbatch{7}.spm.spatial.preproc.tissue(3).warped = [0 0];\nmatlabbatch{7}.spm.spatial.preproc.tissue(4).tpm = {'/storage/essicd/data/NIDM-Ex/spm12_update/tpm/TPM.nii,4'};\nmatlabbatch{7}.spm.spatial.preproc.tissue(4).ngaus = 3;\nmatlabbatch{7}.spm.spatial.preproc.tissue(4).native = [1 0];\nmatlabbatch{7}.spm.spatial.preproc.tissue(4).warped = [0 0];\nmatlabbatch{7}.spm.spatial.preproc.tissue(5).tpm = {'/storage/essicd/data/NIDM-Ex/spm12_update/tpm/TPM.nii,5'};\nmatlabbatch{7}.spm.spatial.preproc.tissue(5).ngaus = 4;\nmatlabbatch{7}.spm.spatial.preproc.tissue(5).native = [1 0];\nmatlabbatch{7}.spm.spatial.preproc.tissue(5).warped = [0 0];\nmatlabbatch{7}.spm.spatial.preproc.tissue(6).tpm = {'/storage/essicd/data/NIDM-Ex/spm12_update/tpm/TPM.nii,6'};\nmatlabbatch{7}.spm.spatial.preproc.tissue(6).ngaus = 2;\nmatlabbatch{7}.spm.spatial.preproc.tissue(6).native = [0 0];\nmatlabbatch{7}.spm.spatial.preproc.tissue(6).warped = [0 0];\nmatlabbatch{7}.spm.spatial.preproc.warp.mrf = 1;\nmatlabbatch{7}.spm.spatial.preproc.warp.cleanup = 1;\nmatlabbatch{7}.spm.spatial.preproc.warp.reg = [0 0.001 0.5 0.05 0.2];\nmatlabbatch{7}.spm.spatial.preproc.warp.affreg = 'mni';\nmatlabbatch{7}.spm.spatial.preproc.warp.fwhm = 0;\nmatlabbatch{7}.spm.spatial.preproc.warp.samp = 3;\nmatlabbatch{7}.spm.spatial.preproc.warp.write = [0 1];", - "parameters": { + "Parameters": { "channel.biasreg": "0.001", "channel.biasfwhm": "60", "channel.write": "[0, 1]", @@ -149,7 +149,7 @@ ], "AssociatedWith": "urn:c15521b1-b3dc-450a-9daa-37e51b591d75", "Command": "matlabbatch{8}.spm.spatial.normalise.write.subj.def(1) = cfg_dep('Segment: Forward Deformations', substruct('.','val', '{}',{7}, '.','val', '{}',{1}, '.','val', '{}',{1}), substruct('.','fordef', '()',{':'}));\nmatlabbatch{8}.spm.spatial.normalise.write.subj.resample(1) = cfg_dep('Realign: Estimate & Reslice: Realigned Images (Sess 1)', substruct('.','val', '{}',{5}, '.','val', '{}',{1}, '.','val', '{}',{1}, '.','val', '{}',{1}), substruct('.','sess', '()',{1}, '.','cfiles'));\nmatlabbatch{8}.spm.spatial.normalise.write.woptions.bb = [-78 -112 -70 78 76 85];\nmatlabbatch{8}.spm.spatial.normalise.write.woptions.vox = [2 2 2];\nmatlabbatch{8}.spm.spatial.normalise.write.woptions.interp = 4;\nmatlabbatch{8}.spm.spatial.normalise.write.woptions.prefix = 'w';", - "parameters": { + "Parameters": { "woptions.bb": "[-78, -112, -70, 78, 76, 85]", "woptions.vox": "[2, 2, 2]", "woptions.interp": "4", @@ -165,7 +165,7 @@ ], "AssociatedWith": "urn:c15521b1-b3dc-450a-9daa-37e51b591d75", "Command": "matlabbatch{9}.spm.spatial.normalise.write.subj.def(1) = cfg_dep('Segment: Forward Deformations', substruct('.','val', '{}',{7}, '.','val', '{}',{1}, '.','val', '{}',{1}), substruct('.','fordef', '()',{':'}));\nmatlabbatch{9}.spm.spatial.normalise.write.subj.resample(1) = cfg_dep('Segment: Bias Corrected (1)', substruct('.','val', '{}',{7}, '.','val', '{}',{1}, '.','val', '{}',{1}), substruct('.','channel', '()',{1}, '.','biascorr', '()',{':'}));\nmatlabbatch{9}.spm.spatial.normalise.write.woptions.bb = [-78 -112 -70 78 76 85];\nmatlabbatch{9}.spm.spatial.normalise.write.woptions.vox = [2 2 2];\nmatlabbatch{9}.spm.spatial.normalise.write.woptions.interp = 4;\nmatlabbatch{9}.spm.spatial.normalise.write.woptions.prefix = 'w';", - "parameters": { + "Parameters": { "woptions.bb": "[-78, -112, -70, 78, 76, 85]", "woptions.vox": "[2, 2, 2]", "woptions.interp": "4", @@ -180,7 +180,7 @@ ], "AssociatedWith": "urn:c15521b1-b3dc-450a-9daa-37e51b591d75", "Command": "matlabbatch{10}.spm.spatial.smooth.data(1) = cfg_dep('Normalise: Write: Normalised Images (Subj 1)', substruct('.','val', '{}',{8}, '.','val', '{}',{1}, '.','val', '{}',{1}, '.','val', '{}',{1}), substruct('()',{1}, '.','files'));\nmatlabbatch{10}.spm.spatial.smooth.fwhm = [6 6 6];\nmatlabbatch{10}.spm.spatial.smooth.dtype = 0;\nmatlabbatch{10}.spm.spatial.smooth.im = 0;\nmatlabbatch{10}.spm.spatial.smooth.prefix = 's';", - "parameters": { + "Parameters": { "fwhm": "[6, 6, 6]", "dtype": "0", "im": "0", @@ -196,7 +196,7 @@ ], "AssociatedWith": "urn:c15521b1-b3dc-450a-9daa-37e51b591d75", "Command": "matlabbatch{11}.spm.stats.fmri_spec.dir = {'/storage/essicd/data/NIDM-Ex/BIDS_Data/RESULTS/TEST/nidmresults-examples/spm_conjunction'};\nmatlabbatch{11}.spm.stats.fmri_spec.timing.units = 'secs';\nmatlabbatch{11}.spm.stats.fmri_spec.timing.RT = 2;\nmatlabbatch{11}.spm.stats.fmri_spec.timing.fmri_t = 16;\nmatlabbatch{11}.spm.stats.fmri_spec.timing.fmri_t0 = 8;\nmatlabbatch{11}.spm.stats.fmri_spec.sess.scans(1) = cfg_dep('Smooth: Smoothed Images', substruct('.','val', '{}',{10}, '.','val', '{}',{1}, '.','val', '{}',{1}), substruct('.','files'));\nmatlabbatch{11}.spm.stats.fmri_spec.sess.cond = struct('name', {}, 'onset', {}, 'duration', {}, 'tmod', {}, 'pmod', {}, 'orth', {});\nmatlabbatch{11}.spm.stats.fmri_spec.sess.multi = {'/storage/essicd/data/NIDM-Ex/BIDS_Data/RESULTS/EXAMPLES/ds011/SPM/PREPROCESSING/ONSETS/sub-01-MultiCond.mat'};\nmatlabbatch{11}.spm.stats.fmri_spec.sess.regress = struct('name', {}, 'val', {});\nmatlabbatch{11}.spm.stats.fmri_spec.sess.multi_reg = {''};\nmatlabbatch{11}.spm.stats.fmri_spec.sess.hpf = 128;\nmatlabbatch{11}.spm.stats.fmri_spec.fact = struct('name', {}, 'levels', {});\nmatlabbatch{11}.spm.stats.fmri_spec.bases.hrf.derivs = [0 0];\nmatlabbatch{11}.spm.stats.fmri_spec.volt = 1;\nmatlabbatch{11}.spm.stats.fmri_spec.global = 'None';\nmatlabbatch{11}.spm.stats.fmri_spec.mthresh = 0.8;\nmatlabbatch{11}.spm.stats.fmri_spec.mask = {''};\nmatlabbatch{11}.spm.stats.fmri_spec.cvi = 'AR(1)';", - "parameters": { + "Parameters": { "dir": "{'/storage/essicd/data/NIDM-Ex/BIDS_Data/RESULTS/TEST/nidmresults-examples/spm_conjunction'}", "timing.units": "'secs'", "timing.RT": "2", @@ -223,7 +223,7 @@ ], "AssociatedWith": "urn:c15521b1-b3dc-450a-9daa-37e51b591d75", "Command": "matlabbatch{12}.spm.stats.fmri_est.spmmat(1) = cfg_dep('fMRI model specification: SPM.mat File', substruct('.','val', '{}',{11}, '.','val', '{}',{1}, '.','val', '{}',{1}), substruct('.','spmmat'));\nmatlabbatch{12}.spm.stats.fmri_est.write_residuals = 0;\nmatlabbatch{12}.spm.stats.fmri_est.method.Classical = 1;", - "parameters": { + "Parameters": { "write_residuals": "0", "method.Classical": "1" } @@ -236,7 +236,7 @@ ], "AssociatedWith": "urn:c15521b1-b3dc-450a-9daa-37e51b591d75", "Command": "matlabbatch{13}.spm.stats.con.spmmat(1) = cfg_dep('Model estimation: SPM.mat File', substruct('.','val', '{}',{12}, '.','val', '{}',{1}, '.','val', '{}',{1}), substruct('.','spmmat'));\nmatlabbatch{13}.spm.stats.con.consess{1}.tcon.name = 'tone counting vs baseline';\nmatlabbatch{13}.spm.stats.con.consess{1}.tcon.weights = [1 0];\nmatlabbatch{13}.spm.stats.con.consess{1}.tcon.sessrep = 'none';\nmatlabbatch{13}.spm.stats.con.consess{2}.tcon.name = 'tone counting probe vs baseline';\nmatlabbatch{13}.spm.stats.con.consess{2}.tcon.weights = [0 1];\nmatlabbatch{13}.spm.stats.con.consess{2}.tcon.sessrep = 'none';\nmatlabbatch{13}.spm.stats.con.delete = 0;", - "parameters": { + "Parameters": { "consess{1}.tcon.name": "'tone counting vs baseline'", "consess{1}.tcon.weights": "[1, 0]", "consess{1}.tcon.sessrep": "'none'", @@ -254,7 +254,7 @@ ], "AssociatedWith": "urn:c15521b1-b3dc-450a-9daa-37e51b591d75", "Command": "matlabbatch{14}.spm.stats.results.spmmat(1) = cfg_dep('Contrast Manager: SPM.mat File', substruct('.','val', '{}',{13}, '.','val', '{}',{1}, '.','val', '{}',{1}), substruct('.','spmmat'));\nmatlabbatch{14}.spm.stats.results.conspec.titlestr = '';\nmatlabbatch{14}.spm.stats.results.conspec.contrasts = [1 2];\nmatlabbatch{14}.spm.stats.results.conspec.threshdesc = 'none';\nmatlabbatch{14}.spm.stats.results.conspec.thresh = 0.001;\nmatlabbatch{14}.spm.stats.results.conspec.extent = 0;\nmatlabbatch{14}.spm.stats.results.conspec.conjunction = 2;\nmatlabbatch{14}.spm.stats.results.conspec.mask.none = 1;\nmatlabbatch{14}.spm.stats.results.units = 1;\nmatlabbatch{14}.spm.stats.results.print = 'pdf';\nmatlabbatch{14}.spm.stats.results.write.none = 1;", - "parameters": { + "Parameters": { "conspec.titlestr": "''", "conspec.contrasts": "[1, 2]", "conspec.threshdesc": "'none'", diff --git a/bids_prov/tests/samples_test/partial_conjunction_ref.jsonld b/bids_prov/tests/samples_test/partial_conjunction_ref.jsonld index 77462f826..7324c5d63 100644 --- a/bids_prov/tests/samples_test/partial_conjunction_ref.jsonld +++ b/bids_prov/tests/samples_test/partial_conjunction_ref.jsonld @@ -12,7 +12,7 @@ "version": "SPM12r7224" } ], - "prov:Activity": [ + "Activities": [ { "@id": "urn:3f372617-f0ba-4f3a-86f0-ce2ea6ec39c1", "Label": "Move file", @@ -20,7 +20,7 @@ "urn:4a800646-417a-4105-bc31-99944567ceb1" ], "AssociatedWith": "urn:c15521b1-b3dc-450a-9daa-37e51b591d75", - "parameters": { + "Parameters": { "action.copyto": "{'/storage/essicd/data/NIDM-Ex/BIDS_Data/RESULTS/EXAMPLES/ds011/SPM/PREPROCESSING/FUNCTIONAL'}" } }, @@ -31,7 +31,7 @@ "urn:df7142dc-af29-46f8-b774-4cca4d909eb2" ], "AssociatedWith": "urn:c15521b1-b3dc-450a-9daa-37e51b591d75", - "parameters": { + "Parameters": { "action.copyto": "{'/storage/essicd/data/NIDM-Ex/BIDS_Data/RESULTS/EXAMPLES/ds011/SPM/PREPROCESSING/ANATOMICAL'}" } }, @@ -58,7 +58,7 @@ "urn:467c0714-a9fb-4797-aa59-c1698d242349" ], "AssociatedWith": "urn:c15521b1-b3dc-450a-9daa-37e51b591d75", - "parameters": { + "Parameters": { "eoptions.quality": "0.9", "eoptions.sep": "4", "eoptions.fwhm": "5", @@ -81,7 +81,7 @@ "urn:daa4ed3c-3454-4ae4-8628-7225154d1eb0" ], "AssociatedWith": "urn:c15521b1-b3dc-450a-9daa-37e51b591d75", - "parameters": { + "Parameters": { "other": "{''}", "eoptions.cost_fun": "'nmi'", "eoptions.sep": "[4, 2]", @@ -96,7 +96,7 @@ "urn:daa4ed3c-3454-4ae4-8628-7225154d1eb0" ], "AssociatedWith": "urn:c15521b1-b3dc-450a-9daa-37e51b591d75", - "parameters": { + "Parameters": { "channel.biasreg": "0.001", "channel.biasfwhm": "60", "channel.write": "[0, 1]", @@ -141,7 +141,7 @@ "urn:071d1481-5649-48e9-9846-6a921f7ea79c" ], "AssociatedWith": "urn:c15521b1-b3dc-450a-9daa-37e51b591d75", - "parameters": { + "Parameters": { "woptions.bb": "[-78, -112, -70, 78, 76, 85]", "woptions.vox": "[2, 2, 2]", "woptions.interp": "4", @@ -156,7 +156,7 @@ "urn:e57b37e7-704b-4d09-af2e-ab42fd8cfe33" ], "AssociatedWith": "urn:c15521b1-b3dc-450a-9daa-37e51b591d75", - "parameters": { + "Parameters": { "woptions.bb": "[-78, -112, -70, 78, 76, 85]", "woptions.vox": "[2, 2, 2]", "woptions.interp": "4", @@ -170,7 +170,7 @@ "urn:ac189004-8387-4e75-bc93-a36cdff27e9f" ], "AssociatedWith": "urn:c15521b1-b3dc-450a-9daa-37e51b591d75", - "parameters": { + "Parameters": { "fwhm": "[6, 6, 6]", "dtype": "0", "im": "0", @@ -185,7 +185,7 @@ "urn:1f05f4d1-1a38-4927-812e-cd08801f772d" ], "AssociatedWith": "urn:c15521b1-b3dc-450a-9daa-37e51b591d75", - "parameters": { + "Parameters": { "dir": "{'/storage/essicd/data/NIDM-Ex/BIDS_Data/RESULTS/TEST/nidmresults-examples/spm_conjunction'}", "timing.units": "'secs'", "timing.RT": "2", @@ -211,7 +211,7 @@ "urn:29663157-072a-468b-9e47-921f47d9e875" ], "AssociatedWith": "urn:c15521b1-b3dc-450a-9daa-37e51b591d75", - "parameters": { + "Parameters": { "write_residuals": "0", "method.Classical": "1" } @@ -223,7 +223,7 @@ "urn:6cd92a40-17cd-479a-9600-66c386988190" ], "AssociatedWith": "urn:c15521b1-b3dc-450a-9daa-37e51b591d75", - "parameters": { + "Parameters": { "consess{1}.tcon.name": "'tone counting vs baseline'", "consess{1}.tcon.weights": "[1, 0]", "consess{1}.tcon.sessrep": "'none'", @@ -240,7 +240,7 @@ "urn:4f3d0144-7485-4165-a2fe-005b88ebf5e6" ], "AssociatedWith": "urn:c15521b1-b3dc-450a-9daa-37e51b591d75", - "parameters": { + "Parameters": { "conspec.titlestr": "''", "conspec.contrasts": "[1, 2]", "conspec.threshdesc": "'none'", diff --git a/bids_prov/tests/test_fsl_parser.py b/bids_prov/tests/test_fsl_parser.py index c59c5ec6b..1547c6eb4 100644 --- a/bids_prov/tests/test_fsl_parser.py +++ b/bids_prov/tests/test_fsl_parser.py @@ -185,7 +185,7 @@ def test_get_entities(): "name": "Command", "Used": [0, "-a"], "GeneratedBy": [-1, "-b"], - "parameters_value": ["-c", + "ParametersValue": ["-c", { "name": "-d", "index": ["0:2"] diff --git a/bids_prov/tests/test_spm_parser.py b/bids_prov/tests/test_spm_parser.py index a98696399..4731b2db6 100644 --- a/bids_prov/tests/test_spm_parser.py +++ b/bids_prov/tests/test_spm_parser.py @@ -21,6 +21,7 @@ def init_random_state(): # force init to initial state def test_spm_to_bids_prov(verbose=False): + verbose=True """ Test if {batch_name}_ref.jsonld (which has been defined in advance) is included in the result of the input file parser {batch_name}.m @@ -64,6 +65,7 @@ def test_spm_to_bids_prov(verbose=False): if verbose: print(f"TEST n°{idx}: {name}.m // reference {name}_ref.jsonld -> {res_compare}") + print(json.dumps(jsonld11_new, indent=2)) assert res_compare @@ -117,7 +119,7 @@ def test_get_records_copy_attributes(): ] ) recs = get_records(task_groups, str(uuid.uuid4())) - attrs = [activity["parameters"] for activity in recs["prov:Activity"]] + attrs = [activity["Parameters"] for activity in recs["Activities"]] assert "action.copyto" in json.dumps(attrs) @@ -126,7 +128,7 @@ def test_get_records_attrs(): ".fwhm = 5;", ] ) recs = get_records(task_groups, "agentUUID") - attrs = [activity["parameters"] for activity in recs["prov:Activity"]] + attrs = [activity["Parameters"] for activity in recs["Activities"]] assert "4" in json.dumps(attrs) diff --git a/bids_prov/utils.py b/bids_prov/utils.py index 915d8fa00..b119659c6 100644 --- a/bids_prov/utils.py +++ b/bids_prov/utils.py @@ -29,7 +29,7 @@ def get_default_graph(label: str, context_url: str = CONTEXT_URL, soft_ver: str "version": soft_ver } ], - "prov:Activity": [], + "Activities": [], "Entities": [], }, }, agent_id