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.
+ - : 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.
+ - : 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.
+ - : 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/scripts/create_spm_example_nonparam.py b/nidm/nidm-results/extensions/non_parametric/scripts/create_spm_example_nonparam.py
new file mode 100644
index 000000000..40edda25f
--- /dev/null
+++ b/nidm/nidm-results/extensions/non_parametric/scripts/create_spm_example_nonparam.py
@@ -0,0 +1,66 @@
+"""
+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
+
+RELPATH = os.path.dirname(os.path.abspath(__file__))
+
+def main():
+ nidm_classes = {
+ "StatisticMap_PseudoT": dict(
+ var_smoothing="[6 6 6]",
+ statistic_map_id="niiri:statistic_map_id",
+ label="Smoothed Variance T-Statistic Map: passive listening > rest",
+ location="file://./SmoothedVarianceTStatistic.nii.gz",
+ format="image/nifti",
+ filename="SmoothedVarianceTStatistic.nii.gz",
+ statistic_type="nidm:SmoothedVarianceTStatistic",
+ stat_type_comment="",
+ contrast_name="passive listening > rest",
+ effect_dof="1",
+ sha="799e9bbf8c15b35c0098bca4",
+ 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_null_dististribution_id",
+ statistic_map_id="niiri:statistic_map_id"
+ ),
+ "NonParametricDistribution": dict(
+ non_param_dist_id="niiri:non_parametric_null_dististribution_id",
+ 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(
+ os.path.dirname(os.path.abspath(__file__))), 'spm', "example001")
+ ttl_file = os.path.join(NIDM_SPM_DIR, 'spm_nonparametric.ttl')
+
+ 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__':
+ main()
\ No newline at end of file
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 .
+
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
new file mode 100644
index 000000000..889e471c4
--- /dev/null
+++ b/nidm/nidm-results/extensions/non_parametric/terms/nidm-results_nonparametric.owl
@@ -0,0 +1,221 @@
+@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 .
+
+
+
+
+
+#################################################################
+#
+# 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 obo:STATO_0000039 ;
+
+ 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 obo:STATO_0000039 ;
+
+ 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 ;
+
+ 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#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 .
+
+
+
+
+
+#################################################################
+#
+# 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 ;
+
+ rdfs:subClassOf obo:STATO_0000039 ;
+
+ rdfs:isDefinedBy "T-Statistic with smoothed variance." ;
+
+ obo:IAO_0000114 obo:IAO_0000124 .
+
+
+
+### http://www.incf.org/ns/nidash/nidm#ThresholdFreeClusterEnhancement
+
+nidm:ThresholdFreeClusterEnhancement rdf:type owl:Class ;
+
+ 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" ;
+
+ obo:IAO_0000114 obo:IAO_0000124 .
+
+
+
+
+### Generated by the OWL API (version 3.5.0) http://owlapi.sourceforge.net
+
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
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
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 ,
+ ,
+ ,
+ ,
+ .
#################################################################
diff --git a/nidm/nidm-results/test/TestCommons.py b/nidm/nidm-results/test/TestCommons.py
index b587ea015..ee099c448 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('extensions', 'non_parametric', 'spm', 'example001', '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..a9ed35bdf 100644
--- a/nidm/nidm-results/test/test_examples_match_templates.py
+++ b/nidm/nidm-results/test/test_examples_match_templates.py
@@ -21,10 +21,20 @@
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
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)
@@ -123,7 +133,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 +193,37 @@ 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_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", 'nidm.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/nidm.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 +238,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 +280,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