From f015dc37b190897ffb4efcb7d0af9bd75e3178a3 Mon Sep 17 00:00:00 2001 From: Nikitas Koussis <31430935+nikitas-k@users.noreply.github.com> Date: Wed, 16 Oct 2024 15:14:24 +1100 Subject: [PATCH 01/19] [ref] update osf locs --- eigenstrapping/datasets/osf.json | 210 +++++++++++++++---------------- 1 file changed, 105 insertions(+), 105 deletions(-) diff --git a/eigenstrapping/datasets/osf.json b/eigenstrapping/datasets/osf.json index 8163489..ae07ccf 100644 --- a/eigenstrapping/datasets/osf.json +++ b/eigenstrapping/datasets/osf.json @@ -70,13 +70,13 @@ "hemi": "lh", "format": "emodes", "fname": "space-fsaverage_den-3k_hemi-lh_emodes.txt", - "rel_path": "eigenmodes/", - "checksum": "a6aa282ce0f0166f9f2caf83bee4e0d0", + "rel_path": "googledrive/", + "checksum": null, "title": null, "redir": null, "url": [ "mabr9", - "65f123e8e5e51c0f90bc57cb" + "668ded7cc727f8001c5b864d" ] }, { @@ -85,13 +85,13 @@ "hemi": "lh", "format": "evals", "fname": "space-fsaverage_den-3k_hemi-lh_evals.txt", - "rel_path": "eigenmodes/", - "checksum": "e92ed624d364b298ac8377b5232d7c1c", + "rel_path": "googledrive/", + "checksum": null, "title": null, "redir": null, "url": [ "mabr9", - "65f123e68992ec0f987886ae" + "6684c5b36f01f301812cf024" ] }, { @@ -100,13 +100,13 @@ "hemi": "rh", "format": "emodes", "fname": "space-fsaverage_den-3k_hemi-rh_emodes.txt", - "rel_path": "eigenmodes/", - "checksum": "5ecadc7c59df4aceefe31457781cb570", + "rel_path": "googledrive/", + "checksum": null, "title": null, "redir": null, "url": [ "mabr9", - "65f123e84dfd8c0f3827f864" + "668ded7cc727f8001c5b8649" ] }, { @@ -115,13 +115,13 @@ "hemi": "rh", "format": "evals", "fname": "space-fsaverage_den-3k_hemi-rh_evals.txt", - "rel_path": "eigenmodes/", - "checksum": "9df8db72993bb9a9a6a3df06febf1b5d", + "rel_path": "googledrive/", + "checksum": null, "title": null, "redir": null, "url": [ "mabr9", - "65f123e5719c060f78d49d7d" + "6684c5b36f01f301812cf022" ] }, { @@ -130,13 +130,13 @@ "hemi": "lh", "format": "emodes", "fname": "space-fsaverage_den-10k_hemi-lh_emodes.txt", - "rel_path": "eigenmodes/", - "checksum": "81b1772209132b99d85667f533c4ce7f", + "rel_path": "googledrive/", + "checksum": null, "title": null, "redir": null, "url": [ "mabr9", - "6566812ff0b8e24c97a9d80c" + "668ded7cc727f8001c5b865f" ] }, { @@ -145,13 +145,13 @@ "hemi": "lh", "format": "evals", "fname": "space-fsaverage_den-10k_hemi-lh_evals.txt", - "rel_path": "eigenmodes/", - "checksum": "731e0381d943c7dfb641b3b323c68eff", + "rel_path": "googledrive/", + "checksum": null, "title": null, "redir": null, "url": [ "mabr9", - "6566812479d42829de3e864c" + "6684c5b36f01f301812cf030" ] }, { @@ -160,13 +160,13 @@ "hemi": "rh", "format": "emodes", "fname": "space-fsaverage_den-10k_hemi-rh_emodes.txt", - "rel_path": "eigenmodes/", - "checksum": "28aa886f8c210c1d30dffac2c2018a8e", + "rel_path": "googledrive/", + "checksum": null, "title": null, "redir": null, "url": [ "mabr9", - "6566812ef0b8e24c97a9d80a" + "668ded7cc727f8001c5b865c" ] }, { @@ -175,13 +175,13 @@ "hemi": "rh", "format": "evals", "fname": "space-fsaverage_den-10k_hemi-rh_evals.txt", - "rel_path": "eigenmodes/", - "checksum": "4bac654fa66eccf2089646c841549ddb", + "rel_path": "googledrive/", + "checksum": null, "title": null, "redir": null, "url": [ "mabr9", - "65668124932b9f48b276087f" + "6684c5b36f01f301812cf02e" ] }, { @@ -190,13 +190,13 @@ "hemi": "lh", "format": "emodes", "fname": "space-fsaverage_den-41k_hemi-lh_emodes.txt", - "rel_path": "eigenmodes/", - "checksum": "e5a9171b8da679d03d0513c80972df32", + "rel_path": "googledrive/", + "checksum": null, "title": null, "redir": null, "url": [ "mabr9", - "65f1243e8520370f70880456" + "668ded7cc727f8001c5b8658" ] }, { @@ -205,13 +205,13 @@ "hemi": "lh", "format": "evals", "fname": "space-fsaverage_den-41k_hemi-lh_evals.txt", - "rel_path": "eigenmodes/", - "checksum": "24ae270a1c9533143f6114cbbecbaccf", + "rel_path": "googledrive/", + "checksum": null, "title": null, "redir": null, "url": [ "mabr9", - "65f123eb8520370f74880174" + "6684c5b36f01f301812cf02c" ] }, { @@ -220,13 +220,13 @@ "hemi": "rh", "format": "emodes", "fname": "space-fsaverage_den-41k_hemi-rh_emodes.txt", - "rel_path": "eigenmodes/", - "checksum": "57fe24dca37ac30dd2648e5e2108bb66", + "rel_path": "googledrive/", + "checksum": null, "title": null, "redir": null, "url": [ "mabr9", - "65f1243d719c060f78d49da3" + "668ded7cc727f8001c5b8656" ] }, { @@ -235,13 +235,13 @@ "hemi": "rh", "format": "evals", "fname": "space-fsaverage_den-41k_hemi-rh_evals.txt", - "rel_path": "eigenmodes/", - "checksum": "5d2a77f359e924a0ec4d9dacba3edbc4", + "rel_path": "googledrive/", + "checksum": null, "title": null, "redir": null, "url": [ "mabr9", - "65f123ec8520370f70880428" + "6684c5b36f01f301812cf02a" ] }, { @@ -250,13 +250,13 @@ "hemi": "lh", "format": "emodes", "fname": "space-fsaverage_den-164k_hemi-lh_emodes.txt", - "rel_path": "eigenmodes/", - "checksum": "6f2c37cbd2ae979c4570fd662ec58d4b", + "rel_path": "googledrive/", + "checksum": null, "title": null, "redir": null, "url": [ "mabr9", - "65f1257ce5e51c0f94bc5508" + "668ded7cc727f8001c5b8652" ] }, { @@ -265,13 +265,13 @@ "hemi": "lh", "format": "evals", "fname": "space-fsaverage_den-164k_hemi-lh_evals.txt", - "rel_path": "eigenmodes/", - "checksum": "b7b840ffa52e6660fac5e7705e2b9ebf", + "rel_path": "googledrive/", + "checksum": null, "title": null, "redir": null, "url": [ "mabr9", - "65f123fa8520370f74880183" + "6684c5b36f01f301812cf028" ] }, { @@ -280,13 +280,13 @@ "hemi": "rh", "format": "emodes", "fname": "space-fsaverage_den-164k_hemi-rh_emodes.txt", - "rel_path": "eigenmodes/", - "checksum": "884ac3d2700af219cb1f0d42de984159", + "rel_path": "googledrive/", + "checksum": null, "title": null, "redir": null, "url": [ "mabr9", - "65f1257ee5e51c0f94bc550a" + "668ded7cc727f8001c5b864f" ] }, { @@ -295,13 +295,13 @@ "hemi": "rh", "format": "evals", "fname": "space-fsaverage_den-164k_hemi-rh_evals.txt", - "rel_path": "eigenmodes/", - "checksum": "ef654df66341bcfa3c53dc8afa9dbd19", + "rel_path": "googledrive/", + "checksum": null, "title": null, "redir": null, "url": [ "mabr9", - "65f123fe4dfd8c0f3827f868" + "6684c5b36f01f301812cf026" ] }, { @@ -310,7 +310,7 @@ "hemi": "lh", "format": "emodes", "fname": "space-fsLR_den-4k_hemi-lh_emodes.txt", - "rel_path": "eigenmodes/", + "rel_path": "googledrive/", "checksum": "72d4411a3c914de40fd503d3bdf31561", "title": null, "redir": null, @@ -325,7 +325,7 @@ "hemi": "lh", "format": "evals", "fname": "space-fsLR_den-4k_hemi-lh_evals.txt", - "rel_path": "eigenmodes/", + "rel_path": "googledrive/", "checksum": "729d6cbae84aac9b6b06eb405f31dc8c", "title": null, "redir": null, @@ -340,7 +340,7 @@ "hemi": "rh", "format": "emodes", "fname": "space-fsLR_den-4k_hemi-rh_emodes.txt", - "rel_path": "eigenmodes/", + "rel_path": "googledrive/", "checksum": "a3733cc068ccc5d68f26653445598ac5", "title": null, "redir": null, @@ -355,7 +355,7 @@ "hemi": "rh", "format": "evals", "fname": "space-fsLR_den-4k_hemi-rh_evals.txt", - "rel_path": "eigenmodes/", + "rel_path": "googledrive/", "checksum": "9a814eb3d4f99c8b42fbbe59ec53f2ab", "title": null, "redir": null, @@ -370,7 +370,7 @@ "hemi": "lh", "format": "emodes", "fname": "space-fsLR_den-8k_hemi-lh_emodes.txt", - "rel_path": "eigenmodes/", + "rel_path": "googledrive/", "checksum": "1bb4a1c7dc6f7e6adc38d36772d8a0a7", "title": null, "redir": null, @@ -385,7 +385,7 @@ "hemi": "lh", "format": "evals", "fname": "space-fsLR_den-8k_hemi-lh_evals.txt", - "rel_path": "eigenmodes/", + "rel_path": "googledrive/", "checksum": "6d279d7887fc80c3ff12cc1c89ea1f13", "title": null, "redir": null, @@ -400,7 +400,7 @@ "hemi": "rh", "format": "emodes", "fname": "space-fsLR_den-8k_hemi-rh_emodes.txt", - "rel_path": "eigenmodes/", + "rel_path": "googledrive/", "checksum": "dcab069e2b353db94899e3b65a7b3ddf", "title": null, "redir": null, @@ -415,7 +415,7 @@ "hemi": "rh", "format": "evals", "fname": "space-fsLR_den-8k_hemi-rh_evals.txt", - "rel_path": "eigenmodes/", + "rel_path": "googledrive/", "checksum": "4e8a91bcf1a6b391a8a92a14a6912d11", "title": null, "redir": null, @@ -430,13 +430,13 @@ "hemi": "lh", "format": "emodes", "fname": "space-fsLR_den-32k_hemi-lh_emodes.txt", - "rel_path": "eigenmodes/", - "checksum": "c6d0b329011d368a911f27ba7ff4df6a", + "rel_path": "googledrive/", + "checksum": null, "title": null, "redir": null, "url": [ "mabr9", - "656928cc02fa96017e7d2a14" + "668ded7cc727f8001c5b863a" ] }, { @@ -445,13 +445,13 @@ "hemi": "lh", "format": "evals", "fname": "space-fsLR_den-32k_hemi-lh_evals.txt", - "rel_path": "eigenmodes/", - "checksum": "8260ab841726bbc1d456b185a87b1665", + "rel_path": "googledrive/", + "checksum": null, "title": null, "redir": null, "url": [ "mabr9", - "6569284a5022f6018f88ea99" + "6684c5b36f01f301812cf018" ] }, { @@ -460,13 +460,13 @@ "hemi": "rh", "format": "emodes", "fname": "space-fsLR_den-32k_hemi-rh_emodes.txt", - "rel_path": "eigenmodes/", - "checksum": "ffaddb605918978cda7194d1a9153597", + "rel_path": "googledrive/", + "checksum": null, "title": null, "redir": null, "url": [ "mabr9", - "656928db02fa96017e7d2a1e" + "668ded7cc727f8001c5b8638" ] }, { @@ -475,13 +475,13 @@ "hemi": "rh", "format": "evals", "fname": "space-fsLR_den-32k_hemi-rh_evals.txt", - "rel_path": "eigenmodes/", - "checksum": "b5c74a9127636ecdfb2119750d19708b", + "rel_path": "googledrive/", + "checksum": null, "title": null, "redir": null, "url": [ "mabr9", - "6569285f02fa9601827d2e2b" + "6684c5b36f01f301812cf016" ] }, { @@ -490,13 +490,13 @@ "hemi": "lh", "format": "emodes", "fname": "space-fsLR_den-164k_hemi-lh_emodes.txt", - "rel_path": "eigenmodes/", - "checksum": "6f2c37cbd2ae979c4570fd662ec58d4b", + "rel_path": "googledrive/", + "checksum": null, "title": null, "redir": null, "url": [ "mabr9", - "65f1257ce5e51c0f94bc5508" + "668ded7cc727f8001c5b8635" ] }, { @@ -505,13 +505,13 @@ "hemi": "lh", "format": "evals", "fname": "space-fsLR_den-164k_hemi-lh_evals.txt", - "rel_path": "eigenmodes/", - "checksum": "78b8d4c3ace9334abcba39b42ca8ce9a", + "rel_path": "googledrive/", + "checksum": null, "title": null, "redir": null, "url": [ "mabr9", - "65f12446719c060f8bd49aeb" + "6684c5b36f01f301812cf014" ] }, { @@ -520,13 +520,13 @@ "hemi": "rh", "format": "emodes", "fname": "space-fsLR_den-164k_hemi-rh_emodes.txt", - "rel_path": "eigenmodes/", - "checksum": "884ac3d2700af219cb1f0d42de984159", + "rel_path": "googledrive/", + "checksum": null, "title": null, "redir": null, "url": [ "mabr9", - "65f1257ee5e51c0f94bc550a" + "668ded7cc727f8001c5b8631" ] }, { @@ -535,13 +535,13 @@ "hemi": "rh", "format": "evals", "fname": "space-fsLR_den-164k_hemi-rh_evals.txt", - "rel_path": "eigenmodes/", - "checksum": "e07c3f1dbf5dadcc5bbaf1feaf1bd160", + "rel_path": "googledrive/", + "checksum": null, "title": null, "redir": null, "url": [ "mabr9", - "65f124554dfd8c0f3727f75c" + "6684c5b36f01f301812cf012" ] }, { @@ -550,13 +550,13 @@ "hemi": "lh", "format": "emodes", "fname": "space-civet_den-41k_hemi-lh_emodes.txt", - "rel_path": "eigenmodes/", - "checksum": "50d2d9f2bec51067da1393d868d553c6", + "rel_path": "googledrive/", + "checksum": null, "title": null, "redir": null, "url": [ "mabr9", - "65f125d14dfd8c0f4627f613" + "668ded7cc727f8001c5b8628" ] }, { @@ -565,13 +565,13 @@ "hemi": "lh", "format": "evals", "fname": "space-civet_den-41k_hemi-lh_evals.txt", - "rel_path": "eigenmodes/", - "checksum": "69b2aef1b7c5234545c496cae1fde3a2", + "rel_path": "googledrive/", + "checksum": null, "title": null, "redir": null, "url": [ "mabr9", - "65f125a2e5e51c0f82bc5872" + "6684c5b36f01f301812cf00c" ] }, { @@ -580,13 +580,13 @@ "hemi": "rh", "format": "emodes", "fname": "space-civet_den-41k_hemi-rh_emodes.txt", - "rel_path": "eigenmodes/", - "checksum": "b2ca361884de06cc9737e4c9e0294647", + "rel_path": "googledrive/", + "checksum": null, "title": null, "redir": null, "url": [ "mabr9", - "65f125d28992ec0fa5788af9" + "668ded7cc727f8001c5b8625" ] }, { @@ -595,13 +595,13 @@ "hemi": "rh", "format": "evals", "fname": "space-civet_den-41k_hemi-rh_evals.txt", - "rel_path": "eigenmodes/", - "checksum": "292f2678f838b61e1e8260c363ce2f69", + "rel_path": "googledrive/", + "checksum": null, "title": null, "redir": null, "url": [ "mabr9", - "65f125a18992ec0fa978865c" + "6684c5b36f01f301812cf00a" ] }, { @@ -610,13 +610,13 @@ "hemi": "lh", "format": "emodes", "fname": "space-civet_den-164k_hemi-lh_emodes.txt", - "rel_path": "eigenmodes/", - "checksum": "ccbeb4179cebba5dc9c11a0314b95a03", + "rel_path": "googledrive/", + "checksum": null, "title": null, "redir": null, "url": [ "mabr9", - "65f12a5a4dfd8c0f3727f99c" + "668ded7cc727f8001c5b862e" ] }, { @@ -625,13 +625,13 @@ "hemi": "lh", "format": "evals", "fname": "space-civet_den-164k_hemi-lh_evals.txt", - "rel_path": "eigenmodes/", - "checksum": "1d7223906d2c83ca042a3299d44c66bb", + "rel_path": "googledrive/", + "checksum": null, "title": null, "redir": null, "url": [ "mabr9", - "65f129fd8520370f70880861" + "6684c5b36f01f301812cf010" ] }, { @@ -640,13 +640,13 @@ "hemi": "rh", "format": "emodes", "fname": "space-civet_den-164k_hemi-rh_emodes.txt", - "rel_path": "eigenmodes/", - "checksum": "5a2f75f800fc4b7f04966d74b1694b71", + "rel_path": "googledrive/", + "checksum": null, "title": null, "redir": null, "url": [ "mabr9", - "65f12d514dfd8c0f4b27f76b" + "668ded7cc727f8001c5b862b" ] }, { @@ -655,13 +655,13 @@ "hemi": "rh", "format": "evals", "fname": "space-civet_den-164k_hemi-rh_evals.txt", - "rel_path": "eigenmodes/", - "checksum": "f351cbf1a489834ef47f773e4f9ab702", + "rel_path": "googledrive/", + "checksum": null, "title": null, "redir": null, "url": [ "mabr9", - "65f12cf28520370f628807ea" + "6684c5b36f01f301812cf00e" ] } ], @@ -970,4 +970,4 @@ ] -} \ No newline at end of file +} From 3e4c3661817ef18393f556574d68977824dfde24 Mon Sep 17 00:00:00 2001 From: Nikitas Koussis <31430935+nikitas-k@users.noreply.github.com> Date: Mon, 21 Oct 2024 11:29:54 +1100 Subject: [PATCH 02/19] Update utils.py --- eigenstrapping/datasets/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eigenstrapping/datasets/utils.py b/eigenstrapping/datasets/utils.py index ef58710..a1243a0 100644 --- a/eigenstrapping/datasets/utils.py +++ b/eigenstrapping/datasets/utils.py @@ -61,7 +61,7 @@ def _osfify_urls(data): Input data with all `url` dict keys formatted """ - OSF_API = "https://files.osf.io/v1/resources/{}/providers/osfstorage/{}" + OSF_API = "https://files.osf.io/v1/resources/{}/providers/{}/{}" if isinstance(data, str) or data is None: return data @@ -190,4 +190,4 @@ def get_dataset_info(name): raise KeyError("Provided dataset '{}' is not valid. Must be one of: {}" .format(name, sorted(osf_resources.keys()))) - return resource \ No newline at end of file + return resource From 810bee8c03a8b7723805c9e4930ac55b79acd620 Mon Sep 17 00:00:00 2001 From: Nikitas Koussis <31430935+nikitas-k@users.noreply.github.com> Date: Mon, 21 Oct 2024 11:37:25 +1100 Subject: [PATCH 03/19] Update osf.json --- eigenstrapping/datasets/osf.json | 96 ++++++++++++++++++++++++++------ 1 file changed, 80 insertions(+), 16 deletions(-) diff --git a/eigenstrapping/datasets/osf.json b/eigenstrapping/datasets/osf.json index ae07ccf..29bfd52 100644 --- a/eigenstrapping/datasets/osf.json +++ b/eigenstrapping/datasets/osf.json @@ -12,6 +12,7 @@ "redir": null, "url": [ "mabr9", + "osfstorage", "65668211a7a4834d7f714286" ] }, @@ -27,6 +28,7 @@ "redir": null, "url": [ "mabr9", + "osfstorage", "" ] }, @@ -43,6 +45,7 @@ "redir": null, "url": [ "mabr9", + "osfstorage", "65668164932b9f48ad7607c6" ] }, @@ -59,6 +62,7 @@ "redir": null, "url": [ "mabr9", + "osfstorage", "" ] } @@ -76,6 +80,7 @@ "redir": null, "url": [ "mabr9", + "googledrive", "668ded7cc727f8001c5b864d" ] }, @@ -91,6 +96,7 @@ "redir": null, "url": [ "mabr9", + "googledrive", "6684c5b36f01f301812cf024" ] }, @@ -106,6 +112,7 @@ "redir": null, "url": [ "mabr9", + "googledrive", "668ded7cc727f8001c5b8649" ] }, @@ -121,6 +128,7 @@ "redir": null, "url": [ "mabr9", + "googledrive", "6684c5b36f01f301812cf022" ] }, @@ -136,6 +144,7 @@ "redir": null, "url": [ "mabr9", + "googledrive", "668ded7cc727f8001c5b865f" ] }, @@ -151,6 +160,7 @@ "redir": null, "url": [ "mabr9", + "googledrive", "6684c5b36f01f301812cf030" ] }, @@ -166,6 +176,7 @@ "redir": null, "url": [ "mabr9", + "googledrive", "668ded7cc727f8001c5b865c" ] }, @@ -181,6 +192,7 @@ "redir": null, "url": [ "mabr9", + "googledrive", "6684c5b36f01f301812cf02e" ] }, @@ -196,6 +208,7 @@ "redir": null, "url": [ "mabr9", + "googledrive", "668ded7cc727f8001c5b8658" ] }, @@ -211,6 +224,7 @@ "redir": null, "url": [ "mabr9", + "googledrive", "6684c5b36f01f301812cf02c" ] }, @@ -226,6 +240,7 @@ "redir": null, "url": [ "mabr9", + "googledrive", "668ded7cc727f8001c5b8656" ] }, @@ -241,6 +256,7 @@ "redir": null, "url": [ "mabr9", + "googledrive", "6684c5b36f01f301812cf02a" ] }, @@ -256,6 +272,7 @@ "redir": null, "url": [ "mabr9", + "googledrive", "668ded7cc727f8001c5b8652" ] }, @@ -271,6 +288,7 @@ "redir": null, "url": [ "mabr9", + "googledrive", "6684c5b36f01f301812cf028" ] }, @@ -286,6 +304,7 @@ "redir": null, "url": [ "mabr9", + "googledrive", "668ded7cc727f8001c5b864f" ] }, @@ -301,6 +320,7 @@ "redir": null, "url": [ "mabr9", + "googledrive", "6684c5b36f01f301812cf026" ] }, @@ -311,12 +331,13 @@ "format": "emodes", "fname": "space-fsLR_den-4k_hemi-lh_emodes.txt", "rel_path": "googledrive/", - "checksum": "72d4411a3c914de40fd503d3bdf31561", + "checksum": null, "title": null, "redir": null, "url": [ "mabr9", - "65f124098992ec0fa978857a" + "googledrive", + "668ded7cc727f8001c5b8646" ] }, { @@ -326,12 +347,13 @@ "format": "evals", "fname": "space-fsLR_den-4k_hemi-lh_evals.txt", "rel_path": "googledrive/", - "checksum": "729d6cbae84aac9b6b06eb405f31dc8c", + "checksum": null, "title": null, "redir": null, "url": [ "mabr9", - "65f1240e8520370f61880392" + "googledrive", + "6684c5b36f01f301812cf020" ] }, { @@ -341,12 +363,13 @@ "format": "emodes", "fname": "space-fsLR_den-4k_hemi-rh_emodes.txt", "rel_path": "googledrive/", - "checksum": "a3733cc068ccc5d68f26653445598ac5", + "checksum": null, "title": null, "redir": null, "url": [ "mabr9", - "65f1241c8992ec0fa9788589" + "googledrive", + "668ded7cc727f8001c5b8644" ] }, { @@ -356,12 +379,13 @@ "format": "evals", "fname": "space-fsLR_den-4k_hemi-rh_evals.txt", "rel_path": "googledrive/", - "checksum": "9a814eb3d4f99c8b42fbbe59ec53f2ab", + "checksum": null, "title": null, "redir": null, "url": [ "mabr9", - "65f12420719c060f87d4a05a" + "googledrive", + "6684c5b36f01f301812cf01e" ] }, { @@ -371,12 +395,13 @@ "format": "emodes", "fname": "space-fsLR_den-8k_hemi-lh_emodes.txt", "rel_path": "googledrive/", - "checksum": "1bb4a1c7dc6f7e6adc38d36772d8a0a7", + "checksum": null, "title": null, "redir": null, "url": [ "mabr9", - "65f12437e5e51c0f85bc5ac8" + "googledrive", + "668ded7cc727f8001c5b8640" ] }, { @@ -386,12 +411,13 @@ "format": "evals", "fname": "space-fsLR_den-8k_hemi-lh_evals.txt", "rel_path": "googledrive/", - "checksum": "6d279d7887fc80c3ff12cc1c89ea1f13", + "checksum": null, "title": null, "redir": null, "url": [ "mabr9", - "65f1243c719c060f87d4a06d" + "googledrive", + "6684c5b36f01f301812cf01c" ] }, { @@ -401,12 +427,13 @@ "format": "emodes", "fname": "space-fsLR_den-8k_hemi-rh_emodes.txt", "rel_path": "googledrive/", - "checksum": "dcab069e2b353db94899e3b65a7b3ddf", + "checksum": null, "title": null, "redir": null, "url": [ "mabr9", - "65f124528520370f748801a8" + "googledrive", + "668ded7cc727f8001c5b863d" ] }, { @@ -416,12 +443,13 @@ "format": "evals", "fname": "space-fsLR_den-8k_hemi-rh_evals.txt", "rel_path": "googledrive/", - "checksum": "4e8a91bcf1a6b391a8a92a14a6912d11", + "checksum": null, "title": null, "redir": null, "url": [ "mabr9", - "65f124428992ec0fa5788a6b" + "googledrive", + "6684c5b36f01f301812cf01a" ] }, { @@ -436,6 +464,7 @@ "redir": null, "url": [ "mabr9", + "googledrive", "668ded7cc727f8001c5b863a" ] }, @@ -451,6 +480,7 @@ "redir": null, "url": [ "mabr9", + "googledrive", "6684c5b36f01f301812cf018" ] }, @@ -466,6 +496,7 @@ "redir": null, "url": [ "mabr9", + "googledrive", "668ded7cc727f8001c5b8638" ] }, @@ -481,6 +512,7 @@ "redir": null, "url": [ "mabr9", + "googledrive", "6684c5b36f01f301812cf016" ] }, @@ -496,6 +528,7 @@ "redir": null, "url": [ "mabr9", + "googledrive", "668ded7cc727f8001c5b8635" ] }, @@ -511,6 +544,7 @@ "redir": null, "url": [ "mabr9", + "googledrive", "6684c5b36f01f301812cf014" ] }, @@ -526,6 +560,7 @@ "redir": null, "url": [ "mabr9", + "googledrive", "668ded7cc727f8001c5b8631" ] }, @@ -541,6 +576,7 @@ "redir": null, "url": [ "mabr9", + "googledrive", "6684c5b36f01f301812cf012" ] }, @@ -556,6 +592,7 @@ "redir": null, "url": [ "mabr9", + "googledrive", "668ded7cc727f8001c5b8628" ] }, @@ -571,6 +608,7 @@ "redir": null, "url": [ "mabr9", + "googledrive", "6684c5b36f01f301812cf00c" ] }, @@ -586,6 +624,7 @@ "redir": null, "url": [ "mabr9", + "googledrive", "668ded7cc727f8001c5b8625" ] }, @@ -601,6 +640,7 @@ "redir": null, "url": [ "mabr9", + "googledrive", "6684c5b36f01f301812cf00a" ] }, @@ -616,6 +656,7 @@ "redir": null, "url": [ "mabr9", + "googledrive", "668ded7cc727f8001c5b862e" ] }, @@ -631,6 +672,7 @@ "redir": null, "url": [ "mabr9", + "googledrive", "6684c5b36f01f301812cf010" ] }, @@ -646,6 +688,7 @@ "redir": null, "url": [ "mabr9", + "googledrive", "668ded7cc727f8001c5b862b" ] }, @@ -661,6 +704,7 @@ "redir": null, "url": [ "mabr9", + "googledrive", "6684c5b36f01f301812cf00e" ] } @@ -678,6 +722,7 @@ "redir": null, "url": [ "mabr9", + "osfstorage", "65668144aa3a762736d6ab2b" ] }, @@ -693,6 +738,7 @@ "redir": null, "url": [ "mabr9", + "osfstorage", "65668144932b9f48b2760891" ] }, @@ -705,6 +751,7 @@ "redir": null, "url": [ "mabr9", + "osfstorage", "6566c28879d4282a903e8365" ] }, @@ -720,6 +767,7 @@ "redir": null, "url": [ "mabr9", + "osfstorage", "6566c28879d4282a903e8365" ] }, @@ -735,6 +783,7 @@ "redir": null, "url": [ "mabr9", + "osfstorage", "65692b63a0121a0190317a60" ] } @@ -750,6 +799,7 @@ "redir": null, "url": [ "mabr9", + "osfstorage", "6566c25caa3a7627e8d6aabb" ] }, @@ -765,6 +815,7 @@ "redir": null, "url": [ "mabr9", + "osfstorage", "6566c25caa3a7627e8d6aabb" ] }, @@ -780,6 +831,7 @@ "redir": null, "url": [ "mabr9", + "osfstorage", "6566c25caa3a7627e8d6aabb" ] }, @@ -795,6 +847,7 @@ "redir": null, "url": [ "mabr9", + "osfstorage", "6566c25caa3a7627e8d6aabb" ] }, @@ -810,6 +863,7 @@ "redir": null, "url": [ "mabr9", + "osfstorage", "6566c25caa3a7627e8d6aabb" ] }, @@ -825,6 +879,7 @@ "redir": null, "url": [ "mabr9", + "osfstorage", "6566c25caa3a7627e8d6aabb" ] }, @@ -840,6 +895,7 @@ "redir": null, "url": [ "mabr9", + "osfstorage", "6566c25caa3a7627e8d6aabb" ] } @@ -857,6 +913,7 @@ "redir": null, "url": [ "mabr9", + "osfstorage", "6566c25caa3a7627e8d6aabb" ] }, @@ -872,6 +929,7 @@ "redir": null, "url": [ "mabr9", + "osfstorage", "6566c25caa3a7627e8d6aabb" ] }, @@ -887,6 +945,7 @@ "redir": null, "url": [ "mabr9", + "osfstorage", "6566c25caa3a7627e8d6aabb" ] }, @@ -902,6 +961,7 @@ "redir": null, "url": [ "mabr9", + "osfstorage", "6566c25caa3a7627e8d6aabb" ] }, @@ -917,6 +977,7 @@ "redir": null, "url": [ "mabr9", + "osfstorage", "6566c25caa3a7627e8d6aabb" ] }, @@ -932,6 +993,7 @@ "redir": null, "url": [ "mabr9", + "osfstorage", "6566c25caa3a7627e8d6aabb" ] } @@ -949,6 +1011,7 @@ "redir": null, "url": [ "mabr9", + "osfstorage", "65e92b1385203706eb8802c3" ] }, @@ -963,6 +1026,7 @@ "redir": null, "url": [ "mabr9", + "osfstorage", "65e92b13e5e51c06dfbc54c7" ] } From 4981954e339e5af5158ece7b8be3f44724571e26 Mon Sep 17 00:00:00 2001 From: Nikitas Koussis <31430935+nikitas-k@users.noreply.github.com> Date: Mon, 21 Oct 2024 11:40:48 +1100 Subject: [PATCH 04/19] Update setup.py --- setup.py | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/setup.py b/setup.py index 95e3154..8ed8483 100644 --- a/setup.py +++ b/setup.py @@ -5,11 +5,6 @@ from setuptools import setup, find_packages # run the setup -setup(name='eigenstrapping', - version='0.0.1.11', - description="For generating surrogate brain maps with spatial autocorrelation using geometric eigenmodes.", - author='Nikitas C. Koussis, Systems Neuroscience Group Newcastle', - author_email='nikitas.koussis@gmail.com', - url='https://github.com/SNG-newy/eigenstrapping', - packages=find_packages(), - ) +setup( + packages=find_packages(), +) From e4555a4c9822977f35903eb1a335bf653c0a56e3 Mon Sep 17 00:00:00 2001 From: Nikitas Koussis <31430935+nikitas-k@users.noreply.github.com> Date: Mon, 21 Oct 2024 11:43:58 +1100 Subject: [PATCH 05/19] Update setup.py --- setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.py b/setup.py index 8ed8483..28505db 100644 --- a/setup.py +++ b/setup.py @@ -7,4 +7,5 @@ # run the setup setup( packages=find_packages(), + include_package_data=True, ) From 205d5741c0050e2a56a510342b25a4d9eda8740b Mon Sep 17 00:00:00 2001 From: Nikitas Koussis <31430935+nikitas-k@users.noreply.github.com> Date: Mon, 21 Oct 2024 11:46:08 +1100 Subject: [PATCH 06/19] Update setup.py --- setup.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/setup.py b/setup.py index 28505db..3ca3bdc 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,13 @@ from setuptools import setup, find_packages # run the setup -setup( - packages=find_packages(), - include_package_data=True, -) +setup(name='eigenstrapping', + version='0.0.2', + description="For generating surrogate brain maps with spatial autocorrelation using geometric eigenmodes.", + author='Nikitas C. Koussis, Systems Neuroscience Group Newcastle', + author_email='nikitas.koussis@gmail.com', + url='https://github.com/SNG-newy/eigenstrapping', + packages=find_packages(), + package_data={'': ['datasets/osf.json']}, + include_package_data=True, + ) From dd4d68b4c6aec096a1e93c72e961b8468ba0ccd4 Mon Sep 17 00:00:00 2001 From: Nikitas Koussis <31430935+nikitas-k@users.noreply.github.com> Date: Mon, 21 Oct 2024 11:53:17 +1100 Subject: [PATCH 07/19] Update utils.py --- eigenstrapping/datasets/utils.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/eigenstrapping/datasets/utils.py b/eigenstrapping/datasets/utils.py index a1243a0..cb4f697 100644 --- a/eigenstrapping/datasets/utils.py +++ b/eigenstrapping/datasets/utils.py @@ -62,6 +62,7 @@ def _osfify_urls(data): """ OSF_API = "https://files.osf.io/v1/resources/{}/providers/{}/{}" + DRIVE_FORMAT = "https://osf.io/download/{}" if isinstance(data, str) or data is None: return data @@ -72,6 +73,9 @@ def _osfify_urls(data): # if the url isn't a string assume we're supposed to format it elif not isinstance(data['url'], str): data['url'] = OSF_API.format(*data['url']) + + if 'googledrive' in data['url']: + data['url'] = DRIVE_FORMAT.format(data['url'][-1]) try: for key, value in data.items(): @@ -81,7 +85,7 @@ def _osfify_urls(data): data[n] = _osfify_urls(value) # drop the invalid entries data = [d for d in data if d is not None] - + return data def get_data_dir(data_dir=None): From 4ed7dbc53dae9b06db07bb99808dbb53b32d4576 Mon Sep 17 00:00:00 2001 From: Nikitas Koussis <31430935+nikitas-k@users.noreply.github.com> Date: Mon, 21 Oct 2024 11:54:44 +1100 Subject: [PATCH 08/19] Update utils.py --- eigenstrapping/datasets/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eigenstrapping/datasets/utils.py b/eigenstrapping/datasets/utils.py index cb4f697..602628f 100644 --- a/eigenstrapping/datasets/utils.py +++ b/eigenstrapping/datasets/utils.py @@ -74,8 +74,8 @@ def _osfify_urls(data): elif not isinstance(data['url'], str): data['url'] = OSF_API.format(*data['url']) - if 'googledrive' in data['url']: - data['url'] = DRIVE_FORMAT.format(data['url'][-1]) + if 'googledrive' in data['url']: + data['url'] = DRIVE_FORMAT.format(data['url'][-1]) try: for key, value in data.items(): From aa2b018c53a0413633920fa46efb32c92f4ba567 Mon Sep 17 00:00:00 2001 From: Nikitas Koussis <31430935+nikitas-k@users.noreply.github.com> Date: Mon, 21 Oct 2024 11:56:16 +1100 Subject: [PATCH 09/19] Update utils.py --- eigenstrapping/datasets/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eigenstrapping/datasets/utils.py b/eigenstrapping/datasets/utils.py index 602628f..4c81cc4 100644 --- a/eigenstrapping/datasets/utils.py +++ b/eigenstrapping/datasets/utils.py @@ -73,7 +73,7 @@ def _osfify_urls(data): # if the url isn't a string assume we're supposed to format it elif not isinstance(data['url'], str): data['url'] = OSF_API.format(*data['url']) - + print(data['url']) if 'googledrive' in data['url']: data['url'] = DRIVE_FORMAT.format(data['url'][-1]) From 5cefd56bd5211640324ae69021c2786c0ecd779e Mon Sep 17 00:00:00 2001 From: Nikitas Koussis <31430935+nikitas-k@users.noreply.github.com> Date: Mon, 21 Oct 2024 12:00:59 +1100 Subject: [PATCH 10/19] Update utils.py --- eigenstrapping/datasets/utils.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/eigenstrapping/datasets/utils.py b/eigenstrapping/datasets/utils.py index 4c81cc4..ebc3cd9 100644 --- a/eigenstrapping/datasets/utils.py +++ b/eigenstrapping/datasets/utils.py @@ -73,9 +73,6 @@ def _osfify_urls(data): # if the url isn't a string assume we're supposed to format it elif not isinstance(data['url'], str): data['url'] = OSF_API.format(*data['url']) - print(data['url']) - if 'googledrive' in data['url']: - data['url'] = DRIVE_FORMAT.format(data['url'][-1]) try: for key, value in data.items(): @@ -83,6 +80,8 @@ def _osfify_urls(data): except AttributeError: for n, value in enumerate(data): data[n] = _osfify_urls(value) + if 'googledrive' in data[n]: + data[n] = DRIVE_FORMAT.format(data[n].split('/')[-1]) # drop the invalid entries data = [d for d in data if d is not None] From 455cd0f7ca4b7b8cd803126c7db54d8e95fd88fe Mon Sep 17 00:00:00 2001 From: Nikitas Koussis <31430935+nikitas-k@users.noreply.github.com> Date: Mon, 21 Oct 2024 12:03:36 +1100 Subject: [PATCH 11/19] Update utils.py --- eigenstrapping/datasets/utils.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/eigenstrapping/datasets/utils.py b/eigenstrapping/datasets/utils.py index ebc3cd9..253648a 100644 --- a/eigenstrapping/datasets/utils.py +++ b/eigenstrapping/datasets/utils.py @@ -77,6 +77,8 @@ def _osfify_urls(data): try: for key, value in data.items(): data[key] = _osfify_urls(value) + if 'googledrive' in data[key]: + data[key] = DRIVE_FORMAT.format(data[n].split('/')[-1]) except AttributeError: for n, value in enumerate(data): data[n] = _osfify_urls(value) From b8820f275f382c6c222ee0e9c5f65387145d543e Mon Sep 17 00:00:00 2001 From: Nikitas Koussis <31430935+nikitas-k@users.noreply.github.com> Date: Mon, 21 Oct 2024 12:05:19 +1100 Subject: [PATCH 12/19] Update utils.py --- eigenstrapping/datasets/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eigenstrapping/datasets/utils.py b/eigenstrapping/datasets/utils.py index 253648a..1a587ad 100644 --- a/eigenstrapping/datasets/utils.py +++ b/eigenstrapping/datasets/utils.py @@ -77,12 +77,12 @@ def _osfify_urls(data): try: for key, value in data.items(): data[key] = _osfify_urls(value) - if 'googledrive' in data[key]: + if value is not None and 'googledrive' in value: data[key] = DRIVE_FORMAT.format(data[n].split('/')[-1]) except AttributeError: for n, value in enumerate(data): data[n] = _osfify_urls(value) - if 'googledrive' in data[n]: + if value is not None and 'googledrive' in value: data[n] = DRIVE_FORMAT.format(data[n].split('/')[-1]) # drop the invalid entries data = [d for d in data if d is not None] From 2ffe8cfbe05a43f224ec0c2766d8c6cee109d9c9 Mon Sep 17 00:00:00 2001 From: Nikitas Koussis <31430935+nikitas-k@users.noreply.github.com> Date: Mon, 21 Oct 2024 12:06:05 +1100 Subject: [PATCH 13/19] Update utils.py --- eigenstrapping/datasets/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eigenstrapping/datasets/utils.py b/eigenstrapping/datasets/utils.py index 1a587ad..79dabea 100644 --- a/eigenstrapping/datasets/utils.py +++ b/eigenstrapping/datasets/utils.py @@ -78,7 +78,7 @@ def _osfify_urls(data): for key, value in data.items(): data[key] = _osfify_urls(value) if value is not None and 'googledrive' in value: - data[key] = DRIVE_FORMAT.format(data[n].split('/')[-1]) + data[key] = DRIVE_FORMAT.format(data[key].split('/')[-1]) except AttributeError: for n, value in enumerate(data): data[n] = _osfify_urls(value) From b3d2d0e8afcdc3352aee067b5e7e272f7531b0c2 Mon Sep 17 00:00:00 2001 From: Nikitas Koussis <31430935+nikitas-k@users.noreply.github.com> Date: Mon, 21 Oct 2024 12:16:36 +1100 Subject: [PATCH 14/19] Update utils.py --- eigenstrapping/datasets/utils.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/eigenstrapping/datasets/utils.py b/eigenstrapping/datasets/utils.py index 79dabea..44d370b 100644 --- a/eigenstrapping/datasets/utils.py +++ b/eigenstrapping/datasets/utils.py @@ -77,13 +77,13 @@ def _osfify_urls(data): try: for key, value in data.items(): data[key] = _osfify_urls(value) - if value is not None and 'googledrive' in value: - data[key] = DRIVE_FORMAT.format(data[key].split('/')[-1]) + if data[key]['url'] is not None and 'googledrive' in data[key]['url']: + data[key]['url'] = DRIVE_FORMAT.format(data[key]['url'].split('/')[-1]) except AttributeError: for n, value in enumerate(data): data[n] = _osfify_urls(value) - if value is not None and 'googledrive' in value: - data[n] = DRIVE_FORMAT.format(data[n].split('/')[-1]) + if data[n]['url'] is not None and 'googledrive' in data[n]['url']: + data[n]['url'] = DRIVE_FORMAT.format(data[n]['url'].split('/')[-1]) # drop the invalid entries data = [d for d in data if d is not None] From 5cc55734f9f403931908876ed1f282765bf10522 Mon Sep 17 00:00:00 2001 From: Nikitas Koussis <31430935+nikitas-k@users.noreply.github.com> Date: Mon, 21 Oct 2024 12:17:47 +1100 Subject: [PATCH 15/19] Update utils.py --- eigenstrapping/datasets/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eigenstrapping/datasets/utils.py b/eigenstrapping/datasets/utils.py index 44d370b..08ab81f 100644 --- a/eigenstrapping/datasets/utils.py +++ b/eigenstrapping/datasets/utils.py @@ -77,12 +77,12 @@ def _osfify_urls(data): try: for key, value in data.items(): data[key] = _osfify_urls(value) - if data[key]['url'] is not None and 'googledrive' in data[key]['url']: + if data[key] is not None and 'googledrive' in data[key]['url']: data[key]['url'] = DRIVE_FORMAT.format(data[key]['url'].split('/')[-1]) except AttributeError: for n, value in enumerate(data): data[n] = _osfify_urls(value) - if data[n]['url'] is not None and 'googledrive' in data[n]['url']: + if data[n] is not None and 'googledrive' in data[n]['url']: data[n]['url'] = DRIVE_FORMAT.format(data[n]['url'].split('/')[-1]) # drop the invalid entries data = [d for d in data if d is not None] From 3673a07089d753730b34778bd3d364c133d9788d Mon Sep 17 00:00:00 2001 From: Nikitas Koussis <31430935+nikitas-k@users.noreply.github.com> Date: Mon, 21 Oct 2024 12:19:22 +1100 Subject: [PATCH 16/19] Update utils.py --- eigenstrapping/datasets/utils.py | 1 + 1 file changed, 1 insertion(+) diff --git a/eigenstrapping/datasets/utils.py b/eigenstrapping/datasets/utils.py index 08ab81f..61034f4 100644 --- a/eigenstrapping/datasets/utils.py +++ b/eigenstrapping/datasets/utils.py @@ -77,6 +77,7 @@ def _osfify_urls(data): try: for key, value in data.items(): data[key] = _osfify_urls(value) + print(data[key]) if data[key] is not None and 'googledrive' in data[key]['url']: data[key]['url'] = DRIVE_FORMAT.format(data[key]['url'].split('/')[-1]) except AttributeError: From 6c64ca55166ca60210736b2c2bfec887e098f667 Mon Sep 17 00:00:00 2001 From: Nikitas Koussis <31430935+nikitas-k@users.noreply.github.com> Date: Mon, 21 Oct 2024 12:27:17 +1100 Subject: [PATCH 17/19] Update utils.py --- eigenstrapping/datasets/utils.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/eigenstrapping/datasets/utils.py b/eigenstrapping/datasets/utils.py index 61034f4..28dd2e8 100644 --- a/eigenstrapping/datasets/utils.py +++ b/eigenstrapping/datasets/utils.py @@ -73,18 +73,15 @@ def _osfify_urls(data): # if the url isn't a string assume we're supposed to format it elif not isinstance(data['url'], str): data['url'] = OSF_API.format(*data['url']) + if 'googledrive' in data['url']: + data['url'] = DRIVE_FORMAT.format(data['url'].split('/')[-1]) try: for key, value in data.items(): data[key] = _osfify_urls(value) - print(data[key]) - if data[key] is not None and 'googledrive' in data[key]['url']: - data[key]['url'] = DRIVE_FORMAT.format(data[key]['url'].split('/')[-1]) except AttributeError: for n, value in enumerate(data): data[n] = _osfify_urls(value) - if data[n] is not None and 'googledrive' in data[n]['url']: - data[n]['url'] = DRIVE_FORMAT.format(data[n]['url'].split('/')[-1]) # drop the invalid entries data = [d for d in data if d is not None] From 0c465e3e0f2c0e23f0ca8663df0c2530ffd6ccf7 Mon Sep 17 00:00:00 2001 From: Nikitas Koussis <31430935+nikitas-k@users.noreply.github.com> Date: Mon, 21 Oct 2024 12:30:06 +1100 Subject: [PATCH 18/19] Update osf.json --- eigenstrapping/datasets/osf.json | 80 ++++++++++++++++---------------- 1 file changed, 40 insertions(+), 40 deletions(-) diff --git a/eigenstrapping/datasets/osf.json b/eigenstrapping/datasets/osf.json index 29bfd52..e09b631 100644 --- a/eigenstrapping/datasets/osf.json +++ b/eigenstrapping/datasets/osf.json @@ -74,7 +74,7 @@ "hemi": "lh", "format": "emodes", "fname": "space-fsaverage_den-3k_hemi-lh_emodes.txt", - "rel_path": "googledrive/", + "rel_path": "eigenmodes/", "checksum": null, "title": null, "redir": null, @@ -90,7 +90,7 @@ "hemi": "lh", "format": "evals", "fname": "space-fsaverage_den-3k_hemi-lh_evals.txt", - "rel_path": "googledrive/", + "rel_path": "eigenmodes/", "checksum": null, "title": null, "redir": null, @@ -106,7 +106,7 @@ "hemi": "rh", "format": "emodes", "fname": "space-fsaverage_den-3k_hemi-rh_emodes.txt", - "rel_path": "googledrive/", + "rel_path": "eigenmodes/", "checksum": null, "title": null, "redir": null, @@ -122,7 +122,7 @@ "hemi": "rh", "format": "evals", "fname": "space-fsaverage_den-3k_hemi-rh_evals.txt", - "rel_path": "googledrive/", + "rel_path": "eigenmodes/", "checksum": null, "title": null, "redir": null, @@ -138,7 +138,7 @@ "hemi": "lh", "format": "emodes", "fname": "space-fsaverage_den-10k_hemi-lh_emodes.txt", - "rel_path": "googledrive/", + "rel_path": "eigenmodes/", "checksum": null, "title": null, "redir": null, @@ -154,7 +154,7 @@ "hemi": "lh", "format": "evals", "fname": "space-fsaverage_den-10k_hemi-lh_evals.txt", - "rel_path": "googledrive/", + "rel_path": "eigenmodes/", "checksum": null, "title": null, "redir": null, @@ -170,7 +170,7 @@ "hemi": "rh", "format": "emodes", "fname": "space-fsaverage_den-10k_hemi-rh_emodes.txt", - "rel_path": "googledrive/", + "rel_path": "eigenmodes/", "checksum": null, "title": null, "redir": null, @@ -186,7 +186,7 @@ "hemi": "rh", "format": "evals", "fname": "space-fsaverage_den-10k_hemi-rh_evals.txt", - "rel_path": "googledrive/", + "rel_path": "eigenmodes/", "checksum": null, "title": null, "redir": null, @@ -202,7 +202,7 @@ "hemi": "lh", "format": "emodes", "fname": "space-fsaverage_den-41k_hemi-lh_emodes.txt", - "rel_path": "googledrive/", + "rel_path": "eigenmodes/", "checksum": null, "title": null, "redir": null, @@ -218,7 +218,7 @@ "hemi": "lh", "format": "evals", "fname": "space-fsaverage_den-41k_hemi-lh_evals.txt", - "rel_path": "googledrive/", + "rel_path": "eigenmodes/", "checksum": null, "title": null, "redir": null, @@ -234,7 +234,7 @@ "hemi": "rh", "format": "emodes", "fname": "space-fsaverage_den-41k_hemi-rh_emodes.txt", - "rel_path": "googledrive/", + "rel_path": "eigenmodes/", "checksum": null, "title": null, "redir": null, @@ -250,7 +250,7 @@ "hemi": "rh", "format": "evals", "fname": "space-fsaverage_den-41k_hemi-rh_evals.txt", - "rel_path": "googledrive/", + "rel_path": "eigenmodes/", "checksum": null, "title": null, "redir": null, @@ -266,7 +266,7 @@ "hemi": "lh", "format": "emodes", "fname": "space-fsaverage_den-164k_hemi-lh_emodes.txt", - "rel_path": "googledrive/", + "rel_path": "eigenmodes/", "checksum": null, "title": null, "redir": null, @@ -282,7 +282,7 @@ "hemi": "lh", "format": "evals", "fname": "space-fsaverage_den-164k_hemi-lh_evals.txt", - "rel_path": "googledrive/", + "rel_path": "eigenmodes/", "checksum": null, "title": null, "redir": null, @@ -298,7 +298,7 @@ "hemi": "rh", "format": "emodes", "fname": "space-fsaverage_den-164k_hemi-rh_emodes.txt", - "rel_path": "googledrive/", + "rel_path": "eigenmodes/", "checksum": null, "title": null, "redir": null, @@ -314,7 +314,7 @@ "hemi": "rh", "format": "evals", "fname": "space-fsaverage_den-164k_hemi-rh_evals.txt", - "rel_path": "googledrive/", + "rel_path": "eigenmodes/", "checksum": null, "title": null, "redir": null, @@ -330,7 +330,7 @@ "hemi": "lh", "format": "emodes", "fname": "space-fsLR_den-4k_hemi-lh_emodes.txt", - "rel_path": "googledrive/", + "rel_path": "eigenmodes/", "checksum": null, "title": null, "redir": null, @@ -346,7 +346,7 @@ "hemi": "lh", "format": "evals", "fname": "space-fsLR_den-4k_hemi-lh_evals.txt", - "rel_path": "googledrive/", + "rel_path": "eigenmodes/", "checksum": null, "title": null, "redir": null, @@ -362,7 +362,7 @@ "hemi": "rh", "format": "emodes", "fname": "space-fsLR_den-4k_hemi-rh_emodes.txt", - "rel_path": "googledrive/", + "rel_path": "eigenmodes/", "checksum": null, "title": null, "redir": null, @@ -378,7 +378,7 @@ "hemi": "rh", "format": "evals", "fname": "space-fsLR_den-4k_hemi-rh_evals.txt", - "rel_path": "googledrive/", + "rel_path": "eigenmodes/", "checksum": null, "title": null, "redir": null, @@ -394,7 +394,7 @@ "hemi": "lh", "format": "emodes", "fname": "space-fsLR_den-8k_hemi-lh_emodes.txt", - "rel_path": "googledrive/", + "rel_path": "eigenmodes/", "checksum": null, "title": null, "redir": null, @@ -410,7 +410,7 @@ "hemi": "lh", "format": "evals", "fname": "space-fsLR_den-8k_hemi-lh_evals.txt", - "rel_path": "googledrive/", + "rel_path": "eigenmodes/", "checksum": null, "title": null, "redir": null, @@ -426,7 +426,7 @@ "hemi": "rh", "format": "emodes", "fname": "space-fsLR_den-8k_hemi-rh_emodes.txt", - "rel_path": "googledrive/", + "rel_path": "eigenmodes/", "checksum": null, "title": null, "redir": null, @@ -442,7 +442,7 @@ "hemi": "rh", "format": "evals", "fname": "space-fsLR_den-8k_hemi-rh_evals.txt", - "rel_path": "googledrive/", + "rel_path": "eigenmodes/", "checksum": null, "title": null, "redir": null, @@ -458,7 +458,7 @@ "hemi": "lh", "format": "emodes", "fname": "space-fsLR_den-32k_hemi-lh_emodes.txt", - "rel_path": "googledrive/", + "rel_path": "eigenmodes/", "checksum": null, "title": null, "redir": null, @@ -474,7 +474,7 @@ "hemi": "lh", "format": "evals", "fname": "space-fsLR_den-32k_hemi-lh_evals.txt", - "rel_path": "googledrive/", + "rel_path": "eigenmodes/", "checksum": null, "title": null, "redir": null, @@ -490,7 +490,7 @@ "hemi": "rh", "format": "emodes", "fname": "space-fsLR_den-32k_hemi-rh_emodes.txt", - "rel_path": "googledrive/", + "rel_path": "eigenmodes/", "checksum": null, "title": null, "redir": null, @@ -506,7 +506,7 @@ "hemi": "rh", "format": "evals", "fname": "space-fsLR_den-32k_hemi-rh_evals.txt", - "rel_path": "googledrive/", + "rel_path": "eigenmodes/", "checksum": null, "title": null, "redir": null, @@ -522,7 +522,7 @@ "hemi": "lh", "format": "emodes", "fname": "space-fsLR_den-164k_hemi-lh_emodes.txt", - "rel_path": "googledrive/", + "rel_path": "eigenmodes/", "checksum": null, "title": null, "redir": null, @@ -538,7 +538,7 @@ "hemi": "lh", "format": "evals", "fname": "space-fsLR_den-164k_hemi-lh_evals.txt", - "rel_path": "googledrive/", + "rel_path": "eigenmodes/", "checksum": null, "title": null, "redir": null, @@ -554,7 +554,7 @@ "hemi": "rh", "format": "emodes", "fname": "space-fsLR_den-164k_hemi-rh_emodes.txt", - "rel_path": "googledrive/", + "rel_path": "eigenmodes/", "checksum": null, "title": null, "redir": null, @@ -570,7 +570,7 @@ "hemi": "rh", "format": "evals", "fname": "space-fsLR_den-164k_hemi-rh_evals.txt", - "rel_path": "googledrive/", + "rel_path": "eigenmodes/", "checksum": null, "title": null, "redir": null, @@ -586,7 +586,7 @@ "hemi": "lh", "format": "emodes", "fname": "space-civet_den-41k_hemi-lh_emodes.txt", - "rel_path": "googledrive/", + "rel_path": "eigenmodes/", "checksum": null, "title": null, "redir": null, @@ -602,7 +602,7 @@ "hemi": "lh", "format": "evals", "fname": "space-civet_den-41k_hemi-lh_evals.txt", - "rel_path": "googledrive/", + "rel_path": "eigenmodes/", "checksum": null, "title": null, "redir": null, @@ -618,7 +618,7 @@ "hemi": "rh", "format": "emodes", "fname": "space-civet_den-41k_hemi-rh_emodes.txt", - "rel_path": "googledrive/", + "rel_path": "eigenmodes/", "checksum": null, "title": null, "redir": null, @@ -634,7 +634,7 @@ "hemi": "rh", "format": "evals", "fname": "space-civet_den-41k_hemi-rh_evals.txt", - "rel_path": "googledrive/", + "rel_path": "eigenmodes/", "checksum": null, "title": null, "redir": null, @@ -650,7 +650,7 @@ "hemi": "lh", "format": "emodes", "fname": "space-civet_den-164k_hemi-lh_emodes.txt", - "rel_path": "googledrive/", + "rel_path": "eigenmodes/", "checksum": null, "title": null, "redir": null, @@ -666,7 +666,7 @@ "hemi": "lh", "format": "evals", "fname": "space-civet_den-164k_hemi-lh_evals.txt", - "rel_path": "googledrive/", + "rel_path": "eigenmodes/", "checksum": null, "title": null, "redir": null, @@ -682,7 +682,7 @@ "hemi": "rh", "format": "emodes", "fname": "space-civet_den-164k_hemi-rh_emodes.txt", - "rel_path": "googledrive/", + "rel_path": "eigenmodes/", "checksum": null, "title": null, "redir": null, @@ -698,7 +698,7 @@ "hemi": "rh", "format": "evals", "fname": "space-civet_den-164k_hemi-rh_evals.txt", - "rel_path": "googledrive/", + "rel_path": "eigenmodes/", "checksum": null, "title": null, "redir": null, From d30e834697e5a9503cb34a650fcfa44123a8bb0d Mon Sep 17 00:00:00 2001 From: Nikitas Koussis <31430935+nikitas-k@users.noreply.github.com> Date: Thu, 24 Oct 2024 12:16:47 +1100 Subject: [PATCH 19/19] eigen permutations --- eigenstrapping/base.py | 117 ++++++++++++++++++++++++------------- eigenstrapping/geometry.py | 2 +- 2 files changed, 77 insertions(+), 42 deletions(-) diff --git a/eigenstrapping/base.py b/eigenstrapping/base.py index 4a88250..3f55dfd 100644 --- a/eigenstrapping/base.py +++ b/eigenstrapping/base.py @@ -16,7 +16,10 @@ from .geometry import (calc_surface_eigenmodes, get_tkrvox2ras, - make_tetra) + make_tetra, + spin_single, + gen_eigensamples, + truncate_emodes) import copy @@ -311,7 +314,10 @@ def __init__(self, data, surface=None, evals=None, emodes=None, num_modes=200, save_surface=False, seed=None, decomp_method='matrix', medial=None, randomize=False, resample=False, n_jobs=1, use_cholmod=False, permute=False, add_res=False, - save_rotations=False, parcellation=None, normalize=True): + truncate_modes=False, ret_fwhm=False, truncate_args=None, + save_rotations=False, parcellation=None, + normalize=True, use_nn=False, nn_method='original', + eigen_perms=None): # initialization of variables if surface is None: @@ -347,6 +353,11 @@ def __init__(self, data, surface=None, evals=None, emodes=None, num_modes=200, self.save_rotations = save_rotations self.parcellation = parcellation self.normalize = normalize + self.truncate_modes = truncate_modes + self.use_nn = use_nn + self.nn_method = nn_method + self.eigen_perms = eigen_perms + self.truncate_args = truncate_args self._lm = LinearRegression(fit_intercept=True) self.add_res = add_res @@ -417,13 +428,23 @@ def __init__(self, data, surface=None, evals=None, emodes=None, num_modes=200, if self.emodes.shape[1] != self.evals.shape[0]: raise ValueError("There must be as many eigenmodes as there are eigenvalues") + # actually the indices that AREN'T medial wall self.medial_wall = self.medial_wall.astype(np.bool_) - - self.n_vertices = self.emodes.shape[0] - + # actually ARE the indices of medial wall self.medial_mask = np.logical_not(self.medial_wall) + + self.n_vertices = self.emodes.shape[0] + self.data_no_mwall = self.data # deepcopy original data so it's not modified self.data_no_mwall = self.data[self.medial_wall] + + # truncate eigenmodes at nearest eigengroup + if self.truncate_modes: + if self.surface is None: + raise ValueError('in order to compute kernel density estimate for data re:\n' + 'number of modes (groups) to use, surface geometry must be given.') + self.fwhm, self.emodes, self.evals = truncate_emodes(self.data_no_mwall, self.surface, self.emodes, self.evals, mask=self.medial_wall, seed=self._rs, ret_fwhm=self.ret_fwhm, **self.truncate_args) + self._emodes = copy.deepcopy(self.emodes) self._emodes = self._emodes[self.medial_wall] @@ -459,9 +480,11 @@ def __call__(self, n=1): ``self.medial_wall``. """ - if self.save_rotations: - self.rotations = np.zeros((n, *self.emodes.shape)) rs = self._rs.randint(np.iinfo(np.int32).max, size=n) + if self.use_nn is True or self.eigen_perms is not None: + if self.eigen_perms is None: + self.eigen_perms = gen_eigensamples(self.emodes, self.evals, mask=self.medial_wall, num_modes=self.num_modes, + n_rotate=n, method=self.nn_method, n_jobs=self.n_jobs) surrs = np.row_stack( Parallel(self.n_jobs)( delayed(self._call_method)(rs=i) for i in rs @@ -497,33 +520,42 @@ def generate(self, output_modes=False): mask = self.medial_wall coeffs = copy.deepcopy(self.coeffs) reconstructed_data = copy.deepcopy(self.reconstructed_data) - residuals = copy.deepcopy(self.residuals) - - # initialize the new modes - new_modes = np.zeros_like(emodes) - - # resample the hypersphere (except for groups 1 and 2) - for idx in range(len(groups)): - if idx > 100: - gen = True - group_modes = emodes[:, groups[idx]] - group_evals = evals[groups[idx]] - p = group_modes - # else, transform to spheroid and index the angles properly - if self.normalize: - p = transform_to_spheroid(group_evals, group_modes) - - p_rot = self.rotate_modes(p, gen=True) - - # transform back to ellipsoid - if self.normalize: - p_rot = transform_to_ellipsoid(group_evals, p_rot) + #residuals = copy.deepcopy(self.residuals) + + if self.eigen_perms is None: + # initialize the new modes + new_modes = np.zeros_like(emodes) + # resample the hypersphere (except for groups 1 and 2) + for idx in range(len(groups)): + if idx > 100: + gen = True + group_modes = emodes[:, groups[idx]] + group_evals = evals[groups[idx]] + p = group_modes + # else, transform to spheroid and index the angles properly + if self.normalize: + p = transform_to_spheroid(group_evals, group_modes) + + p_rot = self.rotate_modes(p, gen=True) + + # transform back to ellipsoid + if self.normalize: + p_rot = transform_to_ellipsoid(group_evals, p_rot) + + new_modes[:, groups[idx]] = p_rot - new_modes[:, groups[idx]] = p_rot - - if output_modes: - return new_modes + if output_modes: + return new_modes + else: + new_modes = spin_single( + self.emodes, + evals, + mask=mask, + eigen_perms=self.eigen_perms[self._rs.randint(0, len(self.eigen_perms))], + num_modes=self.num_modes, + return_masked=True, + ) # matrix multiply the estimated coefficients by the new modes surrogate = np.zeros_like(self.data)*np.nan # original data @@ -538,13 +570,6 @@ def generate(self, output_modes=False): # Mask the data and surrogate_data excluding the medial wall surr_no_mwall = copy.deepcopy(surrogate) surr_no_mwall = surr_no_mwall[mask] - - # now add the residuals of the original data - if self.permute: - surr_no_mwall += self._rs.permutation(residuals) - - if self.add_res: - surr_no_mwall += residuals # if self.resample: # # Get the rank ordered indices @@ -558,9 +583,19 @@ def generate(self, output_modes=False): sorted_map = np.sort(data) ii = np.argsort(surr_no_mwall) np.put(surr_no_mwall, ii, sorted_map) - else: # demean - surr_no_mwall = surr_no_mwall - np.nanmean(surr_no_mwall) + else: # force match the minimum and maximum + sf = (np.nanmax(data) - np.nanmin(data)) / (np.nanmax(surr_no_mwall) - np.nanmin(surr_no_mwall)) + shift = np.nanmin(data) - sf * np.nanmin(surr_no_mwall) + surr_no_mwall = surr_no_mwall * sf + shift + + # now add the residuals of the original data + residuals = data - surr_no_mwall + if self.permute: + surr_no_mwall += self._rs.permutation(residuals) + if self.add_res: + surr_no_mwall += residuals + # else: # force match the minima # indices = np.nonzero(surr_no_mwall)[0] # Indices where s is non-zero diff --git a/eigenstrapping/geometry.py b/eigenstrapping/geometry.py index 8fbdea6..7a0c4af 100644 --- a/eigenstrapping/geometry.py +++ b/eigenstrapping/geometry.py @@ -1019,7 +1019,7 @@ def find_wavelength(surface, data, roi=None, column=None, demean=True): os.unlink(tmpf) - return 2*float(output[0].decode('ascii').split(' ')[1]) + return 2*np.pi*float(output[0].decode('ascii').split(' ')[1]) def truncate_emodes(surface, data, emodes, evals, mask=None, ret_fwhm=False, find_group_only=False,