From 0cd41a68c5bea7b6be02323b22eceb28dda8ba5e Mon Sep 17 00:00:00 2001 From: cmaumet Date: Mon, 8 Dec 2014 10:32:46 +0000 Subject: [PATCH 01/17] New SPM example for non-parametric stat: example 005 --- .../scripts/create_spm_example_nonparam.py | 35 +++++++++++++++++++ nidm/nidm-results/test/TestCommons.py | 1 + .../test/test_examples_match_templates.py | 24 ++++++++++--- 3 files changed, 56 insertions(+), 4 deletions(-) create mode 100644 nidm/nidm-results/scripts/create_spm_example_nonparam.py diff --git a/nidm/nidm-results/scripts/create_spm_example_nonparam.py b/nidm/nidm-results/scripts/create_spm_example_nonparam.py new file mode 100644 index 000000000..234b4fe7a --- /dev/null +++ b/nidm/nidm-results/scripts/create_spm_example_nonparam.py @@ -0,0 +1,35 @@ +""" +Create SPM example 005 stored in nidm/nidm-results/spm/example005 by using the +class templates available in nidm/nidm-results/terms/templates + +@author: Camille Maumet +@copyright: University of Warwick 2013-2014 +""" +import os +from create_example_from_templates import ExampleFromTemplate + +def main(): + nidm_classes = { + "InferenceUsedNonParam": dict( + inference_id="niiri:inference_id_1", + label="Inference", + alternative_hyp="nidm:OneTailedTest", + parametric_test="false", + non_param_dist_id="niiri:non_parametric_dististribution_id" + ), + "NonParametricDistribution": dict( + non_param_dist_id="niiri:non_parametric_dististribution_id", + label="Non-Parametric Distribution", + n_perms="5000", + exchangeability_blocks="4" + ) + } + + NIDM_SPM_DIR = os.path.join(os.path.dirname( + os.path.dirname(os.path.abspath(__file__))), 'spm', "example005") + ttl_file = os.path.join(NIDM_SPM_DIR, 'spm_nonparametric.ttl') + example = ExampleFromTemplate(nidm_classes, ttl_file, False) + example.create_example() + +if __name__ == '__main__': + main() \ No newline at end of file diff --git a/nidm/nidm-results/test/TestCommons.py b/nidm/nidm-results/test/TestCommons.py index b587ea015..39205b356 100644 --- a/nidm/nidm-results/test/TestCommons.py +++ b/nidm/nidm-results/test/TestCommons.py @@ -32,6 +32,7 @@ os.path.join('spm', 'example003', 'spm_results_conjunction.provn'), os.path.join('spm', 'example004', 'spm_inference_activities.provn'), os.path.join('spm', 'example005', 'nidm.provn'), + os.path.join('spm', 'nonparam', 'spm_nonparametric.provn'), os.path.join('fsl', 'fsl_results.provn') ])) diff --git a/nidm/nidm-results/test/test_examples_match_templates.py b/nidm/nidm-results/test/test_examples_match_templates.py index 433522c8f..cc8faac9c 100644 --- a/nidm/nidm-results/test/test_examples_match_templates.py +++ b/nidm/nidm-results/test/test_examples_match_templates.py @@ -21,6 +21,7 @@ import create_spm_example_002 import create_spm_example_003 import create_spm_example_004 +import create_spm_example_005 import create_fsl_example import create_fsl_example_001 import create_fsl_example_002 @@ -123,7 +124,7 @@ def test_spm_results(self): if found_difference: raise Exception("spm_results.ttl is not up to date with templates. \ - Please use nidm/nidm-results/scripts/create_spm_examples.py.") + Please use nidm/nidm-results/scripts/create_spm_example.py.") def test_spm_ex001(self): example_file = os.path.join(NIDM_RESULTS_DIR, "spm", \ @@ -183,7 +184,22 @@ def test_spm_ex004(self): if found_difference: raise Exception("example004/spm_inference_activities.ttl is not up \ to date with templates. Please use \ - nidm/nidm-results/scripts/create_spm_example_003.py.") + nidm/nidm-results/scripts/create_spm_example_004.py.") + + def test_spm_ex005(self): + spm_example_file = os.path.join(NIDM_RESULTS_DIR, "spm", \ + "example005", 'spm_nonparametric.ttl') + + current_graph, spm_current = self._parse_graph(spm_example_file) + create_spm_example_005.main() + updated_graph, unused = self._parse_graph(spm_example_file, spm_current) + + found_difference = self._compare_graphs(current_graph, updated_graph) + + if found_difference: + raise Exception("example005/spm_inference_activities.ttl is not up \ + to date with templates. Please use \ + nidm/nidm-results/scripts/create_spm_example_005.py.") def test_fsl_ex001(self): example_file = os.path.join(NIDM_RESULTS_DIR, "fsl", "example001", "fsl_nidm.ttl") @@ -198,7 +214,7 @@ def test_fsl_ex001(self): if found_difference: raise Exception("example001/fsl_nidm.ttl is not up to date with templates. \ - Please use nidm/nidm-results/scripts/create_fsl_example001.py.") + Please use nidm/nidm-results/scripts/create_fsl_example_001.py.") def test_fsl_ex002(self): example_file = os.path.join(NIDM_RESULTS_DIR, "fsl", "example002", "fsl_nidm.ttl") @@ -240,7 +256,7 @@ def test_fsl_results(self): if found_difference: raise Exception("fsl_results.ttl is not up to date with templates. \ - Please use nidm/nidm-results/scripts/create_fsl_examples.py.") + Please use nidm/nidm-results/scripts/create_fsl_example.py.") if __name__ == '__main__': unittest.main() \ No newline at end of file From baa379edbacac9c3697336cdbedba7e075387383 Mon Sep 17 00:00:00 2001 From: cmaumet Date: Mon, 8 Dec 2014 11:57:17 +0000 Subject: [PATCH 02/17] New terms for non-parametric statistic --- .../scripts/create_spm_example_nonparam.py | 0 .../terms/nidm-results_nonparametric.owl | 124 ++++++++++++++++++ 2 files changed, 124 insertions(+) rename nidm/nidm-results/{ => extensions/non_parametric}/scripts/create_spm_example_nonparam.py (100%) create mode 100644 nidm/nidm-results/extensions/non_parametric/terms/nidm-results_nonparametric.owl diff --git a/nidm/nidm-results/scripts/create_spm_example_nonparam.py b/nidm/nidm-results/extensions/non_parametric/scripts/create_spm_example_nonparam.py similarity index 100% rename from nidm/nidm-results/scripts/create_spm_example_nonparam.py rename to nidm/nidm-results/extensions/non_parametric/scripts/create_spm_example_nonparam.py diff --git a/nidm/nidm-results/extensions/non_parametric/terms/nidm-results_nonparametric.owl b/nidm/nidm-results/extensions/non_parametric/terms/nidm-results_nonparametric.owl new file mode 100644 index 000000000..0e5b9c430 --- /dev/null +++ b/nidm/nidm-results/extensions/non_parametric/terms/nidm-results_nonparametric.owl @@ -0,0 +1,124 @@ +@prefix : . +@prefix dct: . +@prefix fsl: . +@prefix iao: . +@prefix obo: . +@prefix owl: . +@prefix rdf: . +@prefix spm: . +@prefix xml: . +@prefix xsd: . +@prefix nidm: . +@prefix prov: . +@prefix rdfs: . +@prefix crypto: . +@base . + +[ rdf:type owl:Ontology ; + owl:imports +] . + + +################################################################# +# +# Annotation properties +# +################################################################# + + +### http://purl.obolibrary.org/obo/iao.owl#IAO_0000112 + +iao:IAO_0000112 rdf:type owl:AnnotationProperty . + + + +### http://purl.obolibrary.org/obo/iao.owl#IAO_0000116 + +iao:IAO_0000116 rdf:type owl:AnnotationProperty . + + + +### http://www.incf.org/ns/nidash/nidm#curationStatus + +nidm:curationStatus rdf:type owl:AnnotationProperty . + + + +### http://www.incf.org/ns/nidash/nidm#termEditor + +nidm:termEditor rdf:type owl:AnnotationProperty ; + + owl:sameAs "http://purl.obolibrary.org/obo/IAO_0000117" . + + + +### http://www.w3.org/2000/01/rdf-schema#isDefinedBy + +rdfs:isDefinedBy rdf:type owl:AnnotationProperty . + + + +### http://www.w3.org/2002/07/owl#sameAs + +owl:sameAs rdf:type owl:AnnotationProperty . + + + + + +################################################################# +# +# Object Properties +# +################################################################# + + +### http://www.incf.org/ns/nidash/nidm#exchangeabilityBlockSize + +nidm:exchangeabilityBlockSize rdf:type owl:DatatypeProperty ; + + rdfs:isDefinedBy "Size of exchangeability blocks used to define a non-parametric null distribution." ; + + obo:IAO_0000114 obo:IAO_0000124 ; + + rdfs:domain nidm:NonParametricNullDistribution ; + + rdfs:range xsd:int . + + +### http://www.incf.org/ns/nidash/nidm#isParametricTest + +nidm:isParametricTest rdf:type owl:DatatypeProperty ; + + rdfs:isDefinedBy "True if inference is done using a parametric test, false for a non-parametric test." ; + + obo:IAO_0000114 obo:IAO_0000124 ; + + rdfs:domain nidm:Inference ; + + rdfs:range xsd:boolean . + + +### http://www.incf.org/ns/nidash/nidm#numberOfPermutations + +nidm:numberOfPermutations rdf:type owl:DatatypeProperty ; + + rdfs:isDefinedBy "Number of permutations used to define a non-parametric null distribution." ; + + obo:IAO_0000114 obo:IAO_0000124 ; + + rdfs:domain nidm:NonParametricNullDistribution ; + + rdfs:range xsd:int . + + +### http://www.incf.org/ns/nidash/nidm#NonParametricNullDistribution + +nidm:NonParametricNullDistribution rdf:type owl:Class ; + + rdfs:subClassOf prov:Entity ; + + rdfs:isDefinedBy "Non-parametric null distribution used by inference." ; + + obo:IAO_0000114 obo:IAO_0000124 . + From 1f3fe0f8f18418be6a7f78f52c4a74e33f76dcd3 Mon Sep 17 00:00:00 2001 From: cmaumet Date: Mon, 8 Dec 2014 12:19:45 +0000 Subject: [PATCH 03/17] Add: isParametric attribute in Inference --- .../non_parametric/scripts/create_spm_example_nonparam.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nidm/nidm-results/extensions/non_parametric/scripts/create_spm_example_nonparam.py b/nidm/nidm-results/extensions/non_parametric/scripts/create_spm_example_nonparam.py index 234b4fe7a..64411bfa2 100644 --- a/nidm/nidm-results/extensions/non_parametric/scripts/create_spm_example_nonparam.py +++ b/nidm/nidm-results/extensions/non_parametric/scripts/create_spm_example_nonparam.py @@ -14,7 +14,7 @@ def main(): inference_id="niiri:inference_id_1", label="Inference", alternative_hyp="nidm:OneTailedTest", - parametric_test="false", + is_parametric="false", non_param_dist_id="niiri:non_parametric_dististribution_id" ), "NonParametricDistribution": dict( From c9a90b633006958a5fcc52d89fe6194e3bf41252 Mon Sep 17 00:00:00 2001 From: cmaumet Date: Mon, 8 Dec 2014 13:48:54 +0000 Subject: [PATCH 04/17] Example 005: Non-parametric inference on pseudo-T --- .../scripts/create_spm_example_nonparam.py | 18 +++++++++++++++++- .../terms/templates/InferenceUsedNonParam.txt | 5 +++++ .../templates/NonParametricDistribution.txt | 4 ++++ 3 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 nidm/nidm-results/extensions/non_parametric/terms/templates/InferenceUsedNonParam.txt create mode 100644 nidm/nidm-results/extensions/non_parametric/terms/templates/NonParametricDistribution.txt diff --git a/nidm/nidm-results/extensions/non_parametric/scripts/create_spm_example_nonparam.py b/nidm/nidm-results/extensions/non_parametric/scripts/create_spm_example_nonparam.py index 64411bfa2..95f6825fc 100644 --- a/nidm/nidm-results/extensions/non_parametric/scripts/create_spm_example_nonparam.py +++ b/nidm/nidm-results/extensions/non_parametric/scripts/create_spm_example_nonparam.py @@ -10,12 +10,28 @@ class templates available in nidm/nidm-results/terms/templates def main(): nidm_classes = { + "StatisticMap_PseudoT": dict( + var_smoothing="[6 6 6]", + statistic_map_id="niiri:statistic_map_id", + label="Pseudo T-Statistic Map: passive listening > rest", + location="file://./TStatistic.nii.gz", + format="image/nifti", + filename="TStatistic.nii.gz", + statistic_type="nidm:TStatistic", + contrast_name="passive listening > rest", + error_dof="84.0", + effect_dof="1", + sha="799e9bbf8c15b35c0098bca468846bf2cd895a3366382b5ceaa953f1e9e576955341a7c86e13e6fe9359da4ff1496a609f55ce9ecff8da2e461365372f2506d6", + coordinate_space_id="niiri:coordinate_space_id_1", + contrast_est_id="niiri:contrast_estimation_id" + ), "InferenceUsedNonParam": dict( inference_id="niiri:inference_id_1", label="Inference", alternative_hyp="nidm:OneTailedTest", is_parametric="false", - non_param_dist_id="niiri:non_parametric_dististribution_id" + non_param_dist_id="niiri:non_parametric_dististribution_id", + statistic_map_id="niiri:statistic_map_id" ), "NonParametricDistribution": dict( non_param_dist_id="niiri:non_parametric_dististribution_id", diff --git a/nidm/nidm-results/extensions/non_parametric/terms/templates/InferenceUsedNonParam.txt b/nidm/nidm-results/extensions/non_parametric/terms/templates/InferenceUsedNonParam.txt new file mode 100644 index 000000000..0981bba21 --- /dev/null +++ b/nidm/nidm-results/extensions/non_parametric/terms/templates/InferenceUsedNonParam.txt @@ -0,0 +1,5 @@ +$inference_id a prov:Activity , nidm:Inference ; + rdfs:label "$label" ; + nidm:isParametricTest "$is_parametric"^^xsd:boolean ; + nidm:hasAlternativeHypothesis $alternative_hyp ; + prov:used $non_param_dist_id, $statistic_map_id . \ No newline at end of file diff --git a/nidm/nidm-results/extensions/non_parametric/terms/templates/NonParametricDistribution.txt b/nidm/nidm-results/extensions/non_parametric/terms/templates/NonParametricDistribution.txt new file mode 100644 index 000000000..d2c2d56d5 --- /dev/null +++ b/nidm/nidm-results/extensions/non_parametric/terms/templates/NonParametricDistribution.txt @@ -0,0 +1,4 @@ +$non_param_dist_id a prov:Entity , nidm:NonParametricNullDistribution; + rdfs:label "$label" ; + nidm:numberOfPermutations "$n_perms"^^xsd:int ; + nidm:exchangeabilityBlockSize "$exchangeability_blocks"^^xsd:int . \ No newline at end of file From 33d556ae44a0d37211aa16fdb7d85f8981d47f6f Mon Sep 17 00:00:00 2001 From: cmaumet Date: Mon, 8 Dec 2014 13:52:28 +0000 Subject: [PATCH 05/17] varianceSmoothingFWHM term --- .../terms/nidm-results_nonparametric.owl | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/nidm/nidm-results/extensions/non_parametric/terms/nidm-results_nonparametric.owl b/nidm/nidm-results/extensions/non_parametric/terms/nidm-results_nonparametric.owl index 0e5b9c430..39a3e8e5c 100644 --- a/nidm/nidm-results/extensions/non_parametric/terms/nidm-results_nonparametric.owl +++ b/nidm/nidm-results/extensions/non_parametric/terms/nidm-results_nonparametric.owl @@ -122,3 +122,14 @@ nidm:NonParametricNullDistribution rdf:type owl:Class ; obo:IAO_0000114 obo:IAO_0000124 . +### http://www.incf.org/ns/nidash/nidm#varianceSmoothingFWHM + +nidm:varianceSmoothingFWHM rdf:type owl:DatatypeProperty ; + + rdfs:isDefinedBy "Full width at half maximum (in world units) of the gaussian kernel used to smoothed the variance map to compute the pseudo-T Statistic." ; + + obo:IAO_0000114 obo:IAO_0000124 ; + + rdfs:domain nidm:StatisticMap ; + + rdfs:range xsd:string . From 68bdd86730380c3fe24985ced271ab1102840bc4 Mon Sep 17 00:00:00 2001 From: cmaumet Date: Mon, 8 Dec 2014 13:59:23 +0000 Subject: [PATCH 06/17] new term: PseudoTStatistic --- .../terms/nidm-results_nonparametric.owl | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/nidm/nidm-results/extensions/non_parametric/terms/nidm-results_nonparametric.owl b/nidm/nidm-results/extensions/non_parametric/terms/nidm-results_nonparametric.owl index 39a3e8e5c..d8658a2a4 100644 --- a/nidm/nidm-results/extensions/non_parametric/terms/nidm-results_nonparametric.owl +++ b/nidm/nidm-results/extensions/non_parametric/terms/nidm-results_nonparametric.owl @@ -133,3 +133,13 @@ nidm:varianceSmoothingFWHM rdf:type owl:DatatypeProperty ; rdfs:domain nidm:StatisticMap ; rdfs:range xsd:string . + +### http://www.incf.org/ns/nidash/nidm#PseudoTStatistic + +nidm:PseudoTStatistic rdf:type owl:Class ; + + rdfs:subClassOf nidm:Statistic ; + + rdfs:isDefinedBy "T-Statistic with smoothed variance." ; + + obo:IAO_0000114 obo:IAO_0000124 . \ No newline at end of file From 5eb40f70f06ea702baac0c265cc862b357da41dc Mon Sep 17 00:00:00 2001 From: cmaumet Date: Mon, 8 Dec 2014 14:09:33 +0000 Subject: [PATCH 07/17] small fixes in spm ex005 --- .../scripts/create_spm_example_nonparam.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/nidm/nidm-results/extensions/non_parametric/scripts/create_spm_example_nonparam.py b/nidm/nidm-results/extensions/non_parametric/scripts/create_spm_example_nonparam.py index 95f6825fc..8facb3427 100644 --- a/nidm/nidm-results/extensions/non_parametric/scripts/create_spm_example_nonparam.py +++ b/nidm/nidm-results/extensions/non_parametric/scripts/create_spm_example_nonparam.py @@ -14,14 +14,13 @@ def main(): var_smoothing="[6 6 6]", statistic_map_id="niiri:statistic_map_id", label="Pseudo T-Statistic Map: passive listening > rest", - location="file://./TStatistic.nii.gz", + location="file://./PseudoTStatistic.nii.gz", format="image/nifti", - filename="TStatistic.nii.gz", - statistic_type="nidm:TStatistic", + filename="PseudoTStatistic.nii.gz", + statistic_type="nidm:PseudoTStatistic", contrast_name="passive listening > rest", - error_dof="84.0", effect_dof="1", - sha="799e9bbf8c15b35c0098bca468846bf2cd895a3366382b5ceaa953f1e9e576955341a7c86e13e6fe9359da4ff1496a609f55ce9ecff8da2e461365372f2506d6", + sha="799e9bbf8c15b35c0098bca4", coordinate_space_id="niiri:coordinate_space_id_1", contrast_est_id="niiri:contrast_estimation_id" ), From 2f3299cfb1ced4acda44bbb554cb3c8c991bbf7c Mon Sep 17 00:00:00 2001 From: cmaumet Date: Mon, 8 Dec 2014 15:49:20 +0000 Subject: [PATCH 08/17] PseudoT -> SmoothedVarianceT --- .../scripts/create_spm_example_nonparam.py | 14 +++++++------- .../terms/nidm-results_nonparametric.owl | 18 +++++++++--------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/nidm/nidm-results/extensions/non_parametric/scripts/create_spm_example_nonparam.py b/nidm/nidm-results/extensions/non_parametric/scripts/create_spm_example_nonparam.py index 8facb3427..3f11412de 100644 --- a/nidm/nidm-results/extensions/non_parametric/scripts/create_spm_example_nonparam.py +++ b/nidm/nidm-results/extensions/non_parametric/scripts/create_spm_example_nonparam.py @@ -13,11 +13,11 @@ def main(): "StatisticMap_PseudoT": dict( var_smoothing="[6 6 6]", statistic_map_id="niiri:statistic_map_id", - label="Pseudo T-Statistic Map: passive listening > rest", - location="file://./PseudoTStatistic.nii.gz", + label="Smoothed Variance T-Statistic Map: passive listening > rest", + location="file://./SmoothedVarianceTStatistic.nii.gz", format="image/nifti", - filename="PseudoTStatistic.nii.gz", - statistic_type="nidm:PseudoTStatistic", + filename="SmoothedVarianceTStatistic.nii.gz", + statistic_type="nidm:SmoothedVarianceTStatistic", contrast_name="passive listening > rest", effect_dof="1", sha="799e9bbf8c15b35c0098bca4", @@ -29,12 +29,12 @@ def main(): label="Inference", alternative_hyp="nidm:OneTailedTest", is_parametric="false", - non_param_dist_id="niiri:non_parametric_dististribution_id", + non_param_dist_id="niiri:non_parametric_null_dististribution_id", statistic_map_id="niiri:statistic_map_id" ), "NonParametricDistribution": dict( - non_param_dist_id="niiri:non_parametric_dististribution_id", - label="Non-Parametric Distribution", + non_param_dist_id="niiri:non_parametric_null_dististribution_id", + label="Non-Parametric Null Distribution", n_perms="5000", exchangeability_blocks="4" ) diff --git a/nidm/nidm-results/extensions/non_parametric/terms/nidm-results_nonparametric.owl b/nidm/nidm-results/extensions/non_parametric/terms/nidm-results_nonparametric.owl index d8658a2a4..db38e2d25 100644 --- a/nidm/nidm-results/extensions/non_parametric/terms/nidm-results_nonparametric.owl +++ b/nidm/nidm-results/extensions/non_parametric/terms/nidm-results_nonparametric.owl @@ -134,12 +134,12 @@ nidm:varianceSmoothingFWHM rdf:type owl:DatatypeProperty ; rdfs:range xsd:string . -### http://www.incf.org/ns/nidash/nidm#PseudoTStatistic - -nidm:PseudoTStatistic rdf:type owl:Class ; - - rdfs:subClassOf nidm:Statistic ; - - rdfs:isDefinedBy "T-Statistic with smoothed variance." ; - - obo:IAO_0000114 obo:IAO_0000124 . \ No newline at end of file +### http://www.incf.org/ns/nidash/nidm#SmoothedVarianceTStatistic + +nidm:SmoothedVarianceTStatistic rdf:type owl:Class ; + + rdfs:subClassOf nidm:Statistic ; + + rdfs:isDefinedBy "T-Statistic with smoothed variance." ; + + obo:IAO_0000114 obo:IAO_0000124 . \ No newline at end of file From 63d50df9dfe49cde4fcd12f3f6dceeb5b86ae29a Mon Sep 17 00:00:00 2001 From: cmaumet Date: Mon, 15 Dec 2014 09:57:53 +0000 Subject: [PATCH 09/17] new terms: clusterMass, TFCE statistic, TFCE E and H parameters --- .../terms/nidm-results_nonparametric.owl | 50 ++++++++++++++++++- 1 file changed, 49 insertions(+), 1 deletion(-) diff --git a/nidm/nidm-results/extensions/non_parametric/terms/nidm-results_nonparametric.owl b/nidm/nidm-results/extensions/non_parametric/terms/nidm-results_nonparametric.owl index db38e2d25..a3442c050 100644 --- a/nidm/nidm-results/extensions/non_parametric/terms/nidm-results_nonparametric.owl +++ b/nidm/nidm-results/extensions/non_parametric/terms/nidm-results_nonparametric.owl @@ -142,4 +142,52 @@ nidm:SmoothedVarianceTStatistic rdf:type owl:Class ; rdfs:isDefinedBy "T-Statistic with smoothed variance." ; - obo:IAO_0000114 obo:IAO_0000124 . \ No newline at end of file + obo:IAO_0000114 obo:IAO_0000124 . + +### http://www.incf.org/ns/nidash/nidm#EParameter + +nidm:EParameter rdf:type owl:DatatypeProperty ; + + rdfs:isDefinedBy "Pre-defined parameter E for threshold-free cluster enhancement statistic." ; + + obo:IAO_0000114 obo:IAO_0000124 ; + + rdfs:domain nidm:Statistic ; + + rdfs:range xsd:float . + + + +### http://www.incf.org/ns/nidash/nidm#HParameter + +nidm:HParameter rdf:type owl:DatatypeProperty ; + + rdfs:isDefinedBy "Pre-defined parameter H for threshold-free cluster enhancement statistic." ; + + obo:IAO_0000114 obo:IAO_0000124 ; + + rdfs:domain nidm:Statistic ; + + rdfs:range xsd:float . + +### http://www.incf.org/ns/nidash/nidm#clusterMass + +nidm:clusterMass rdf:type owl:DatatypeProperty ; + + rdfs:isDefinedBy "Mass of a cluster." ; + + obo:IAO_0000114 obo:IAO_0000124 ; + + rdfs:domain nidm:Cluster ; + + rdfs:range xsd:float . + +### http://www.incf.org/ns/nidash/nidm#ThresholdFreeClusterEnhancement + +nidm:ThresholdFreeClusterEnhancement rdf:type owl:Class ; + + rdfs:subClassOf nidm:Statistic ; + + rdfs:isDefinedBy "Corresponding citation: Smith, S. M. and Nichols, T. E. (2009). Threshold-free cluster enhancement: addressing problems of smoothing, threshold dependence and localisation in cluster inference. NeuroImage, 44(1), 83-98. doi:10.1016/j.neuroimage.2008.03.061" ; + + obo:IAO_0000114 obo:IAO_0000124 . From da62686cfc4b43ce6c07ab9cf7d82d0b4d1c8408 Mon Sep 17 00:00:00 2001 From: cmaumet Date: Wed, 25 Mar 2015 16:52:31 +0000 Subject: [PATCH 10/17] Update path to non-parametric example --- nidm/nidm-results/test/TestCommons.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nidm/nidm-results/test/TestCommons.py b/nidm/nidm-results/test/TestCommons.py index 39205b356..ee099c448 100644 --- a/nidm/nidm-results/test/TestCommons.py +++ b/nidm/nidm-results/test/TestCommons.py @@ -32,7 +32,7 @@ os.path.join('spm', 'example003', 'spm_results_conjunction.provn'), os.path.join('spm', 'example004', 'spm_inference_activities.provn'), os.path.join('spm', 'example005', 'nidm.provn'), - os.path.join('spm', 'nonparam', 'spm_nonparametric.provn'), + os.path.join('extensions', 'non_parametric', 'spm', 'example001', 'spm_nonparametric.provn'), os.path.join('fsl', 'fsl_results.provn') ])) From d96732eed89516fa60e211e38eeae66195ecd70c Mon Sep 17 00:00:00 2001 From: cmaumet Date: Wed, 25 Mar 2015 17:09:46 +0000 Subject: [PATCH 11/17] Also recompute non-parametric examples based on template --- .../scripts/create_spm_example_nonparam.py | 11 +++++++-- .../scripts/create_example_from_templates.py | 23 +++++++++++++------ nidm/nidm-results/scripts/recompute_all_ex.py | 11 +++++++++ 3 files changed, 36 insertions(+), 9 deletions(-) diff --git a/nidm/nidm-results/extensions/non_parametric/scripts/create_spm_example_nonparam.py b/nidm/nidm-results/extensions/non_parametric/scripts/create_spm_example_nonparam.py index 3f11412de..f57f856ba 100644 --- a/nidm/nidm-results/extensions/non_parametric/scripts/create_spm_example_nonparam.py +++ b/nidm/nidm-results/extensions/non_parametric/scripts/create_spm_example_nonparam.py @@ -8,6 +8,8 @@ class templates available in nidm/nidm-results/terms/templates import os from create_example_from_templates import ExampleFromTemplate +RELPATH = os.path.dirname(os.path.abspath(__file__)) + def main(): nidm_classes = { "StatisticMap_PseudoT": dict( @@ -18,6 +20,7 @@ def main(): format="image/nifti", filename="SmoothedVarianceTStatistic.nii.gz", statistic_type="nidm:SmoothedVarianceTStatistic", + stat_type_comment="", contrast_name="passive listening > rest", effect_dof="1", sha="799e9bbf8c15b35c0098bca4", @@ -41,9 +44,13 @@ def main(): } NIDM_SPM_DIR = os.path.join(os.path.dirname( - os.path.dirname(os.path.abspath(__file__))), 'spm', "example005") + os.path.dirname(os.path.abspath(__file__))), 'spm', "example001") ttl_file = os.path.join(NIDM_SPM_DIR, 'spm_nonparametric.ttl') - example = ExampleFromTemplate(nidm_classes, ttl_file, False) + + EXT_PATH = os.path.dirname(RELPATH) + EXTENSION_TPL_DIR = os.path.join(EXT_PATH, "terms", "templates") + + example = ExampleFromTemplate(nidm_classes, ttl_file, False, EXTENSION_TPL_DIR) example.create_example() if __name__ == '__main__': diff --git a/nidm/nidm-results/scripts/create_example_from_templates.py b/nidm/nidm-results/scripts/create_example_from_templates.py index 78cef4254..714e00409 100644 --- a/nidm/nidm-results/scripts/create_example_from_templates.py +++ b/nidm/nidm-results/scripts/create_example_from_templates.py @@ -18,13 +18,15 @@ class ExampleFromTemplate(object): - def __init__(self, nidm_classes, example_file, one_file_per_class=False): + def __init__(self, nidm_classes, example_file, one_file_per_class=False, + extension_tpl_dir=None): self.nidm_classes = nidm_classes self.one_file_per_class = one_file_per_class if not one_file_per_class: self.file = example_file else: self.dir = example_file + self.ext_tpl_dir = extension_tpl_dir def create_example(self): # To make a complete document, we need to add namespaces at @@ -35,15 +37,18 @@ def create_example(self): example = "" for nidm_class, substitutes in sorted(self.nidm_classes.items()): - templates = str.split(nidm_class, "_") if len(templates) > 1: - base_template_name = templates[0] + base_template_name = templates[0] + base_template_file = os.path.join(TPL_DIR, base_template_name+".txt") + if not os.path.isfile(base_template_file) and self.ext_tpl_dir is not None: + base_template_file = os.path.join(self.ext_tpl_dir, base_template_name+".txt") + if not os.path.isfile(base_template_file): + base_template_file = None else: - base_template_name = None + base_template_file = None - if base_template_name and \ - os.path.isfile(os.path.join(TPL_DIR, base_template_name+".txt")): + if base_template_file: fid = open(os.path.join(TPL_DIR, base_template_name+".txt"), 'r') nidm_base_tpm = Template(fid.read()) fid.close() @@ -69,7 +74,11 @@ def create_example(self): class_example = class_example[:-1]+";\n" logger.debug(" "+template_name) - fid = open(os.path.join(TPL_DIR, template_name+".txt"), 'r') + template_file = os.path.join(TPL_DIR, template_name+".txt") + if not os.path.isfile(template_file) and self.ext_tpl_dir is not None: + template_file = os.path.join(self.ext_tpl_dir, template_name+".txt") + + fid = open(template_file, 'r') nidm_tpm = Template(fid.read()) fid.close() diff --git a/nidm/nidm-results/scripts/recompute_all_ex.py b/nidm/nidm-results/scripts/recompute_all_ex.py index 363c5f4d6..a40197c3d 100644 --- a/nidm/nidm-results/scripts/recompute_all_ex.py +++ b/nidm/nidm-results/scripts/recompute_all_ex.py @@ -5,6 +5,7 @@ @copyright: University of Warwick 2013-2014 """ import logging +import os, sys import create_term_examples import create_spm_example @@ -20,6 +21,13 @@ logging.basicConfig(filename='debug.log', level=logging.DEBUG, filemode='w') logger = logging.getLogger(__name__) +RELPATH = os.path.dirname(os.path.abspath(__file__)) +NIDM_RES_PATH = os.path.dirname(RELPATH) + +# Append non-parametric script directory to path +sys.path.append(os.path.join(NIDM_RES_PATH, "extensions", "non_parametric", \ + "scripts")) +import create_spm_example_nonparam def main(): logger.debug(" create_term_examples") @@ -45,5 +53,8 @@ def main(): logger.debug(" create_fsl_example_003") create_fsl_example_003.main() + # Extensions + create_spm_example_nonparam.main() + if __name__ == '__main__': main() \ No newline at end of file From 474c0ad40b070d188f0243686b0256c25f782e80 Mon Sep 17 00:00:00 2001 From: cmaumet Date: Wed, 25 Mar 2015 17:17:16 +0000 Subject: [PATCH 12/17] Also test that non-parametric example match template --- .../test/test_examples_match_templates.py | 30 +++++++++++++++++-- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/nidm/nidm-results/test/test_examples_match_templates.py b/nidm/nidm-results/test/test_examples_match_templates.py index cc8faac9c..a9ed35bdf 100644 --- a/nidm/nidm-results/test/test_examples_match_templates.py +++ b/nidm/nidm-results/test/test_examples_match_templates.py @@ -26,6 +26,15 @@ import create_fsl_example_001 import create_fsl_example_002 import create_fsl_example_003 + +RELPATH = os.path.dirname(os.path.abspath(__file__)) +NIDM_RES_PATH = os.path.dirname(RELPATH) + +# Append non-parametric script directory to path +sys.path.append(os.path.join(NIDM_RES_PATH, "extensions", "non_parametric", \ + "scripts")) +import create_spm_example_nonparam + from TestCommons import * logging.basicConfig(level=logging.DEBUG) @@ -186,9 +195,24 @@ def test_spm_ex004(self): to date with templates. Please use \ nidm/nidm-results/scripts/create_spm_example_004.py.") + def test_spm_nonparam_ex001(self): + spm_example_file = os.path.join(NIDM_RESULTS_DIR, "extensions", \ + "non_parametric", "spm", "example001", 'spm_nonparametric.ttl') + + current_graph, spm_current = self._parse_graph(spm_example_file) + create_spm_example_nonparam.main() + updated_graph, unused = self._parse_graph(spm_example_file, spm_current) + + found_difference = self._compare_graphs(current_graph, updated_graph) + + if found_difference: + raise Exception("example005/spm_inference_activities.ttl is not up \ + to date with templates. Please use \ + nidm/nidm-results/extensions/non_parametric/scripts/create_spm_example_nonparam.py.") + def test_spm_ex005(self): spm_example_file = os.path.join(NIDM_RESULTS_DIR, "spm", \ - "example005", 'spm_nonparametric.ttl') + "example005", 'nidm.ttl') current_graph, spm_current = self._parse_graph(spm_example_file) create_spm_example_005.main() @@ -197,9 +221,9 @@ def test_spm_ex005(self): found_difference = self._compare_graphs(current_graph, updated_graph) if found_difference: - raise Exception("example005/spm_inference_activities.ttl is not up \ + raise Exception("example005/nidm.ttl is not up \ to date with templates. Please use \ - nidm/nidm-results/scripts/create_spm_example_005.py.") + nidm/nidm-results/scripts/create_spm_example_005.py.") def test_fsl_ex001(self): example_file = os.path.join(NIDM_RESULTS_DIR, "fsl", "example001", "fsl_nidm.ttl") From 515cb3400bdc0671b639312ed6cc22b5332efeb9 Mon Sep 17 00:00:00 2001 From: cmaumet Date: Thu, 26 Mar 2015 08:58:00 +0000 Subject: [PATCH 13/17] Load ontology in protege and re-write on disk --- .../terms/nidm-results_nonparametric.owl | 120 +++++++++++------- 1 file changed, 77 insertions(+), 43 deletions(-) diff --git a/nidm/nidm-results/extensions/non_parametric/terms/nidm-results_nonparametric.owl b/nidm/nidm-results/extensions/non_parametric/terms/nidm-results_nonparametric.owl index a3442c050..0a0279182 100644 --- a/nidm/nidm-results/extensions/non_parametric/terms/nidm-results_nonparametric.owl +++ b/nidm/nidm-results/extensions/non_parametric/terms/nidm-results_nonparametric.owl @@ -68,11 +68,53 @@ owl:sameAs rdf:type owl:AnnotationProperty . ################################################################# # -# Object Properties +# Data properties # ################################################################# +### http://www.incf.org/ns/nidash/nidm#EParameter + +nidm:EParameter rdf:type owl:DatatypeProperty ; + + rdfs:isDefinedBy "Pre-defined parameter E for threshold-free cluster enhancement statistic." ; + + obo:IAO_0000114 obo:IAO_0000124 ; + + rdfs:domain nidm:Statistic ; + + rdfs:range xsd:float . + + + +### http://www.incf.org/ns/nidash/nidm#HParameter + +nidm:HParameter rdf:type owl:DatatypeProperty ; + + rdfs:isDefinedBy "Pre-defined parameter H for threshold-free cluster enhancement statistic." ; + + obo:IAO_0000114 obo:IAO_0000124 ; + + rdfs:domain nidm:Statistic ; + + rdfs:range xsd:float . + + + +### http://www.incf.org/ns/nidash/nidm#clusterMass + +nidm:clusterMass rdf:type owl:DatatypeProperty ; + + rdfs:isDefinedBy "Mass of a cluster." ; + + obo:IAO_0000114 obo:IAO_0000124 ; + + rdfs:domain nidm:Cluster ; + + rdfs:range xsd:float . + + + ### http://www.incf.org/ns/nidash/nidm#exchangeabilityBlockSize nidm:exchangeabilityBlockSize rdf:type owl:DatatypeProperty ; @@ -86,6 +128,7 @@ nidm:exchangeabilityBlockSize rdf:type owl:DatatypeProperty ; rdfs:range xsd:int . + ### http://www.incf.org/ns/nidash/nidm#isParametricTest nidm:isParametricTest rdf:type owl:DatatypeProperty ; @@ -99,6 +142,7 @@ nidm:isParametricTest rdf:type owl:DatatypeProperty ; rdfs:range xsd:boolean . + ### http://www.incf.org/ns/nidash/nidm#numberOfPermutations nidm:numberOfPermutations rdf:type owl:DatatypeProperty ; @@ -112,15 +156,6 @@ nidm:numberOfPermutations rdf:type owl:DatatypeProperty ; rdfs:range xsd:int . -### http://www.incf.org/ns/nidash/nidm#NonParametricNullDistribution - -nidm:NonParametricNullDistribution rdf:type owl:Class ; - - rdfs:subClassOf prov:Entity ; - - rdfs:isDefinedBy "Non-parametric null distribution used by inference." ; - - obo:IAO_0000114 obo:IAO_0000124 . ### http://www.incf.org/ns/nidash/nidm#varianceSmoothingFWHM @@ -134,6 +169,29 @@ nidm:varianceSmoothingFWHM rdf:type owl:DatatypeProperty ; rdfs:range xsd:string . + + + + +################################################################# +# +# Classes +# +################################################################# + + +### http://www.incf.org/ns/nidash/nidm#NonParametricNullDistribution + +nidm:NonParametricNullDistribution rdf:type owl:Class ; + + rdfs:subClassOf prov:Entity ; + + rdfs:isDefinedBy "Non-parametric null distribution used by inference" ; + + obo:IAO_0000114 obo:IAO_0000124 . + + + ### http://www.incf.org/ns/nidash/nidm#SmoothedVarianceTStatistic nidm:SmoothedVarianceTStatistic rdf:type owl:Class ; @@ -144,43 +202,13 @@ nidm:SmoothedVarianceTStatistic rdf:type owl:Class ; obo:IAO_0000114 obo:IAO_0000124 . -### http://www.incf.org/ns/nidash/nidm#EParameter - -nidm:EParameter rdf:type owl:DatatypeProperty ; - - rdfs:isDefinedBy "Pre-defined parameter E for threshold-free cluster enhancement statistic." ; - - obo:IAO_0000114 obo:IAO_0000124 ; - - rdfs:domain nidm:Statistic ; - - rdfs:range xsd:float . - -### http://www.incf.org/ns/nidash/nidm#HParameter +### http://www.incf.org/ns/nidash/nidm#Statistic -nidm:HParameter rdf:type owl:DatatypeProperty ; - - rdfs:isDefinedBy "Pre-defined parameter H for threshold-free cluster enhancement statistic." ; - - obo:IAO_0000114 obo:IAO_0000124 ; - - rdfs:domain nidm:Statistic ; - - rdfs:range xsd:float . +nidm:Statistic rdf:type owl:Class . -### http://www.incf.org/ns/nidash/nidm#clusterMass -nidm:clusterMass rdf:type owl:DatatypeProperty ; - - rdfs:isDefinedBy "Mass of a cluster." ; - - obo:IAO_0000114 obo:IAO_0000124 ; - - rdfs:domain nidm:Cluster ; - - rdfs:range xsd:float . ### http://www.incf.org/ns/nidash/nidm#ThresholdFreeClusterEnhancement @@ -190,4 +218,10 @@ nidm:ThresholdFreeClusterEnhancement rdf:type owl:Class ; rdfs:isDefinedBy "Corresponding citation: Smith, S. M. and Nichols, T. E. (2009). Threshold-free cluster enhancement: addressing problems of smoothing, threshold dependence and localisation in cluster inference. NeuroImage, 44(1), 83-98. doi:10.1016/j.neuroimage.2008.03.061" ; - obo:IAO_0000114 obo:IAO_0000124 . + obo:IAO_0000114 obo:IAO_0000124 . + + + + +### Generated by the OWL API (version 3.5.0) http://owlapi.sourceforge.net + From 598667d0601084613fb133a4e99062cfd4227bce Mon Sep 17 00:00:00 2001 From: cmaumet Date: Thu, 26 Mar 2015 08:58:20 +0000 Subject: [PATCH 14/17] Import nidm-results.owl in nidm-results_nonparametric.owl --- .../non_parametric/terms/catalog-v001.xml | 10 ++++++++++ .../terms/nidm-results_nonparametric.owl | 8 ++++---- nidm/nidm-results/terms/nidm-results.owl | 18 +++++++++--------- 3 files changed, 23 insertions(+), 13 deletions(-) create mode 100644 nidm/nidm-results/extensions/non_parametric/terms/catalog-v001.xml diff --git a/nidm/nidm-results/extensions/non_parametric/terms/catalog-v001.xml b/nidm/nidm-results/extensions/non_parametric/terms/catalog-v001.xml new file mode 100644 index 000000000..4c6527f21 --- /dev/null +++ b/nidm/nidm-results/extensions/non_parametric/terms/catalog-v001.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/nidm/nidm-results/extensions/non_parametric/terms/nidm-results_nonparametric.owl b/nidm/nidm-results/extensions/non_parametric/terms/nidm-results_nonparametric.owl index 0a0279182..f5095dcc0 100644 --- a/nidm/nidm-results/extensions/non_parametric/terms/nidm-results_nonparametric.owl +++ b/nidm/nidm-results/extensions/non_parametric/terms/nidm-results_nonparametric.owl @@ -12,11 +12,11 @@ @prefix prov: . @prefix rdfs: . @prefix crypto: . -@base . +@base . -[ rdf:type owl:Ontology ; - owl:imports -] . + rdf:type owl:Ontology ; + + owl:imports . ################################################################# diff --git a/nidm/nidm-results/terms/nidm-results.owl b/nidm/nidm-results/terms/nidm-results.owl index 30a840529..8bddf8d82 100644 --- a/nidm/nidm-results/terms/nidm-results.owl +++ b/nidm/nidm-results/terms/nidm-results.owl @@ -14,15 +14,15 @@ @prefix rdfs: . @prefix crypto: . @prefix dctype: . -@base . - -[ rdf:type owl:Ontology ; - owl:imports , - , - , - , - -] . +@base . + + rdf:type owl:Ontology ; + + owl:imports , + , + , + , + . ################################################################# From d84893e2cf4c83f94d8de9fab2280d06d8105ac0 Mon Sep 17 00:00:00 2001 From: cmaumet Date: Thu, 26 Mar 2015 09:01:16 +0000 Subject: [PATCH 15/17] nidm:Statistic -> stato:statistic --- .../terms/nidm-results_nonparametric.owl | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/nidm/nidm-results/extensions/non_parametric/terms/nidm-results_nonparametric.owl b/nidm/nidm-results/extensions/non_parametric/terms/nidm-results_nonparametric.owl index f5095dcc0..889e471c4 100644 --- a/nidm/nidm-results/extensions/non_parametric/terms/nidm-results_nonparametric.owl +++ b/nidm/nidm-results/extensions/non_parametric/terms/nidm-results_nonparametric.owl @@ -81,7 +81,7 @@ nidm:EParameter rdf:type owl:DatatypeProperty ; obo:IAO_0000114 obo:IAO_0000124 ; - rdfs:domain nidm:Statistic ; + rdfs:domain obo:STATO_0000039 ; rdfs:range xsd:float . @@ -95,7 +95,7 @@ nidm:HParameter rdf:type owl:DatatypeProperty ; obo:IAO_0000114 obo:IAO_0000124 ; - rdfs:domain nidm:Statistic ; + rdfs:domain obo:STATO_0000039 ; rdfs:range xsd:float . @@ -196,7 +196,7 @@ nidm:NonParametricNullDistribution rdf:type owl:Class ; nidm:SmoothedVarianceTStatistic rdf:type owl:Class ; - rdfs:subClassOf nidm:Statistic ; + rdfs:subClassOf obo:STATO_0000039 ; rdfs:isDefinedBy "T-Statistic with smoothed variance." ; @@ -204,17 +204,11 @@ nidm:SmoothedVarianceTStatistic rdf:type owl:Class ; -### http://www.incf.org/ns/nidash/nidm#Statistic - -nidm:Statistic rdf:type owl:Class . - - - ### http://www.incf.org/ns/nidash/nidm#ThresholdFreeClusterEnhancement nidm:ThresholdFreeClusterEnhancement rdf:type owl:Class ; - rdfs:subClassOf nidm:Statistic ; + rdfs:subClassOf obo:STATO_0000039 ; rdfs:isDefinedBy "Corresponding citation: Smith, S. M. and Nichols, T. E. (2009). Threshold-free cluster enhancement: addressing problems of smoothing, threshold dependence and localisation in cluster inference. NeuroImage, 44(1), 83-98. doi:10.1016/j.neuroimage.2008.03.061" ; From b33ebc2337512dcbbbca0db66a93675b65d3135e Mon Sep 17 00:00:00 2001 From: cmaumet Date: Thu, 26 Mar 2015 09:12:05 +0000 Subject: [PATCH 16/17] Add coordinateSpace entity in non-parametric example --- .../scripts/create_spm_example_nonparam.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/nidm/nidm-results/extensions/non_parametric/scripts/create_spm_example_nonparam.py b/nidm/nidm-results/extensions/non_parametric/scripts/create_spm_example_nonparam.py index f57f856ba..40edda25f 100644 --- a/nidm/nidm-results/extensions/non_parametric/scripts/create_spm_example_nonparam.py +++ b/nidm/nidm-results/extensions/non_parametric/scripts/create_spm_example_nonparam.py @@ -40,7 +40,16 @@ def main(): label="Non-Parametric Null Distribution", n_perms="5000", exchangeability_blocks="4" - ) + ), + "CoordinateSpace": dict( + coordinate_space_id="niiri:coordinate_space_id_1", + label="Coordinate space 1", + voxel_to_world_mapping="[[-3, 0, 0, 78],[0, 3, 0, -112],[0, 0, 3, -70],[0, 0, 0, 1]]", + voxel_units="['mm', 'mm', 'mm']", + voxel_size="[3, 3, 3]", + coord_system="nidm:MNICoordinateSystem", + number_of_dim="3", + dimensions="[53,63,52]") } NIDM_SPM_DIR = os.path.join(os.path.dirname( From 2a47ed85646b7cf5b277fe45441f3e311452b407 Mon Sep 17 00:00:00 2001 From: cmaumet Date: Thu, 26 Mar 2015 16:19:05 +0000 Subject: [PATCH 17/17] Update example and spec --- doc/content/specs/nidm-results_dev.html | 21 ++++++++ .../non_parametric/spm/example001/README.md | 9 ++++ .../spm/example001/spm_nonparametric.provn | 24 +++++++++ .../spm/example001/spm_nonparametric.ttl | 50 +++++++++++++++++++ 4 files changed, 104 insertions(+) create mode 100644 nidm/nidm-results/extensions/non_parametric/spm/example001/README.md create mode 100644 nidm/nidm-results/extensions/non_parametric/spm/example001/spm_nonparametric.provn create mode 100644 nidm/nidm-results/extensions/non_parametric/spm/example001/spm_nonparametric.ttl diff --git a/doc/content/specs/nidm-results_dev.html b/doc/content/specs/nidm-results_dev.html index 7720e11a4..f157f9b1c 100644 --- a/doc/content/specs/nidm-results_dev.html +++ b/doc/content/specs/nidm-results_dev.html @@ -884,6 +884,12 @@

nidm:MaskMap

  • rdfs:label: an OPTIONAL human readable description of the nidm:MaskMap.
  • +
  • + nidm:hasMapHeader + : an OPTIONAL . (range nidm:MapHeader)
  • +
  • + nidm:inCoordinateSpace + : an OPTIONAL property of a DataArray to associate a CoordinateSpace with a physical file. (range nidm:CoordinateSpace)
  • nidm:isUserDefined : an OPTIONAL a binary flag defining whether the mask was specified by the user (true) or automatically generated during the analysis (false). (range xsd:boolean)
  • @@ -1447,6 +1453,12 @@

    nidm:DisplayMaskMap

    • rdfs:label: an OPTIONAL human readable description of the nidm:DisplayMaskMap.
    • +
    • + nidm:hasMapHeader + : an OPTIONAL . (range nidm:MapHeader)
    • +
    • + nidm:inCoordinateSpace + : an OPTIONAL property of a DataArray to associate a CoordinateSpace with a physical file. (range nidm:CoordinateSpace)
    • nidm:isUserDefined : an OPTIONAL a binary flag defining whether the mask was specified by the user (true) or automatically generated during the analysis (false). (range xsd:boolean)
    • @@ -1642,6 +1654,15 @@

      nidm:SearchSpaceMaskMap

      • rdfs:label: an OPTIONAL human readable description of the nidm:SearchSpaceMaskMap.
      • +
      • + nidm:hasMapHeader + : an OPTIONAL . (range nidm:MapHeader)
      • +
      • + nidm:inCoordinateSpace + : an OPTIONAL property of a DataArray to associate a CoordinateSpace with a physical file. (range nidm:CoordinateSpace)
      • +
      • + nidm:isUserDefined + : an OPTIONAL a binary flag defining whether the mask was specified by the user (true) or automatically generated during the analysis (false). (range xsd:boolean)
      • nidm:randomFieldStationarity : an OPTIONAL is the random field assumed to be stationary across the entire search volume?. (range xsd:boolean)
      • diff --git a/nidm/nidm-results/extensions/non_parametric/spm/example001/README.md b/nidm/nidm-results/extensions/non_parametric/spm/example001/README.md new file mode 100644 index 000000000..9510c8564 --- /dev/null +++ b/nidm/nidm-results/extensions/non_parametric/spm/example001/README.md @@ -0,0 +1,9 @@ + +Prov store: https://provenance.ecs.soton.ac.uk/store/documents/76838/ + +Alternative serialisations: [json](https://provenance.ecs.soton.ac.uk/store/documents/76838.json), [turtle](https://provenance.ecs.soton.ac.uk/store/documents/76838.ttl), +Graph: [svg](https://provenance.ecs.soton.ac.uk/store/documents/76838.svg), [PDF](https://provenance.ecs.soton.ac.uk/store/documents/76838.pdf), [png](https://provenance.ecs.soton.ac.uk/store/documents/76838.png) + +![Prov Graph](https://provenance.ecs.soton.ac.uk/store/documents/76838.png) + + \ No newline at end of file diff --git a/nidm/nidm-results/extensions/non_parametric/spm/example001/spm_nonparametric.provn b/nidm/nidm-results/extensions/non_parametric/spm/example001/spm_nonparametric.provn new file mode 100644 index 000000000..92caddb31 --- /dev/null +++ b/nidm/nidm-results/extensions/non_parametric/spm/example001/spm_nonparametric.provn @@ -0,0 +1,24 @@ +document +prefix crypto +prefix neurolex +prefix obo +prefix dct +prefix spm +prefix pre_0 +prefix fsl +prefix rdfs +prefix nfo +prefix nidm +prefix niiri +prefix xsd +prefix bnode +prefix dctype +prefix dc +activity(niiri:inference_id_1,-,-,[prov:type = 'nidm:Inference', prov:label = "Inference", nidm:isParametricTest = "false" %% xsd:boolean, nidm:hasAlternativeHypothesis = 'nidm:OneTailedTest']) +entity(niiri:non_parametric_null_dististribution_id,[prov:type = 'nidm:NonParametricNullDistribution', prov:label = "Non-Parametric Null Distribution", nidm:numberOfPermutations = "5000" %% xsd:int, nidm:exchangeabilityBlockSize = "4" %% xsd:int]) +entity(niiri:statistic_map_id,[prov:type = 'nidm:StatisticMap', prov:label = "Smoothed Variance T-Statistic Map: passive listening > rest", prov:location = "file://./SmoothedVarianceTStatistic.nii.gz" %% xsd:anyURI, nidm:statisticType = 'nidm:SmoothedVarianceTStatistic', nfo:fileName = "SmoothedVarianceTStatistic.nii.gz" %% xsd:string, dct:format = "image/nifti" %% xsd:string, nidm:contrastName = "passive listening > rest" %% xsd:string, nidm:effectDegreesOfFreedom = "1" %% xsd:float, nidm:inCoordinateSpace = 'niiri:coordinate_space_id_1', crypto:sha512 = "799e9bbf8c15b35c0098bca4" %% xsd:string, nidm:varianceSmoothingFWHM = "[6 6 6]" %% xsd:string]) +entity(niiri:coordinate_space_id_1,[prov:type = 'nidm:CoordinateSpace', prov:label = "Coordinate space 1", nidm:voxelToWorldMapping = "[[-3, 0, 0, 78],[0, 3, 0, -112],[0, 0, 3, -70],[0, 0, 0, 1]]" %% xsd:string, nidm:voxelUnits = "['mm', 'mm', 'mm']" %% xsd:string, nidm:voxelSize = "[3, 3, 3]" %% xsd:string, nidm:inWorldCoordinateSystem = 'nidm:MNICoordinateSystem', nidm:numberOfDimensions = "3" %% xsd:int, nidm:dimensionsInVoxels = "[53,63,52]" %% xsd:string]) +used(niiri:inference_id_1,niiri:non_parametric_null_dististribution_id,-) +used(niiri:inference_id_1,niiri:statistic_map_id,-) +wasGeneratedBy(niiri:statistic_map_id,niiri:contrast_estimation_id,-) +endDocument \ No newline at end of file diff --git a/nidm/nidm-results/extensions/non_parametric/spm/example001/spm_nonparametric.ttl b/nidm/nidm-results/extensions/non_parametric/spm/example001/spm_nonparametric.ttl new file mode 100644 index 000000000..6ef203a4b --- /dev/null +++ b/nidm/nidm-results/extensions/non_parametric/spm/example001/spm_nonparametric.ttl @@ -0,0 +1,50 @@ +@prefix prov: . +@prefix crypto: . +@prefix neurolex: . +@prefix dc: . +@prefix dct: . +@prefix dctype: . +@prefix spm: . +@prefix fsl: . +@prefix rdfs: . +@prefix nidm: . +@prefix niiri: . +@prefix nfo: . +@prefix xsd: . +@prefix obo: . + + + +niiri:coordinate_space_id_1 a prov:Entity , nidm:CoordinateSpace ; + rdfs:label "Coordinate space 1" ; + nidm:voxelToWorldMapping "[[-3, 0, 0, 78],[0, 3, 0, -112],[0, 0, 3, -70],[0, 0, 0, 1]]"^^xsd:string ; + nidm:voxelUnits "['mm', 'mm', 'mm']"^^xsd:string ; + nidm:voxelSize "[3, 3, 3]"^^xsd:string ; + nidm:inWorldCoordinateSystem nidm:MNICoordinateSystem ; + nidm:numberOfDimensions "3"^^xsd:int ; + nidm:dimensionsInVoxels "[53,63,52]"^^xsd:string . + +niiri:inference_id_1 a prov:Activity , nidm:Inference ; + rdfs:label "Inference" ; + nidm:isParametricTest "false"^^xsd:boolean ; + nidm:hasAlternativeHypothesis nidm:OneTailedTest ; + prov:used niiri:non_parametric_null_dististribution_id, niiri:statistic_map_id . + +niiri:non_parametric_null_dististribution_id a prov:Entity , nidm:NonParametricNullDistribution; + rdfs:label "Non-Parametric Null Distribution" ; + nidm:numberOfPermutations "5000"^^xsd:int ; + nidm:exchangeabilityBlockSize "4"^^xsd:int . + +niiri:statistic_map_id a prov:Entity , nidm:StatisticMap ; + rdfs:label "Smoothed Variance T-Statistic Map: passive listening > rest" ; + prov:atLocation "file://./SmoothedVarianceTStatistic.nii.gz"^^xsd:anyURI ; + nidm:statisticType nidm:SmoothedVarianceTStatistic ; # + nfo:fileName "SmoothedVarianceTStatistic.nii.gz"^^xsd:string ; + dct:format "image/nifti"^^xsd:string ; + nidm:contrastName "passive listening > rest"^^xsd:string ; + nidm:effectDegreesOfFreedom "1"^^xsd:float ; + nidm:inCoordinateSpace niiri:coordinate_space_id_1 ; + crypto:sha512 "799e9bbf8c15b35c0098bca4"^^xsd:string ; + prov:wasGeneratedBy niiri:contrast_estimation_id; + nidm:varianceSmoothingFWHM "[6 6 6]"^^xsd:string . +