# download and unzip test dataset
from pyodide.http import pyfetch
ds005_zip = await pyfetch("https://raw.githubusercontent.com/ANCPLabOldenburg/ancp-bids-dataset/main/ds005-testdata.zip")
if ds005_zip.status == 200:
with open("ds005-testdata.zip", "wb") as f:
f.write(await ds005_zip.bytes())
# unzip dataset archive
import zipfile
with zipfile.ZipFile('ds005-testdata.zip', 'r') as zip_ref:
zip_ref.extractall('./ds005')
# install and import ancpBIDS
import micropip
await micropip.install('ancpbids')
import ancpbids
# load layout of dataset
ds005_layout = ancpbids.BIDSLayout('ds005')
#run queries
ds005_layout.get_subjects()
>>> ds005_layout = ancpbids.BIDSLayout('ds005')
>>> ds005_layout.get_subjects()
['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12', '13', '14', '15', '16']
>>> ds005_layout.get_runs()
['1', '2', '3']
>>> ds005_layout.get_tasks()
['mixedgamblestask']
>>> ds005_layout.get_entities()
OrderedDict([('task', {'mixedgamblestask'}), ('sub', {'16', '06', '07', '04', '05', '02', '03', '10', '01', '11', '12', '13', '14', '15', '08', '09'}),
('run', {'3', '2', '1'}), ('desc', {'mypipeline', 'extra'}), ('ds', {'005'}), ('type', {'test', 'mfx'})])
>>> ds005_layout.get(suffix='bold', subject='02', return_type='filename')
['ds005/ds005/sub-02/func/sub-02_task-mixedgamblestask_run-01_bold.nii.gz', 'ds005/ds005/sub-02/func/sub-02_task-mixedgamblestask_run-02_bold.nii.gz',
'ds005/ds005/sub-02/func/sub-02_task-mixedgamblestask_run-03_bold.nii.gz']
--
We are all colleagues working together to shape brain imaging for tomorrow, please be respectful, gracious, and patient with your fellow group members.
---
You received this message because you are subscribed to the Google Groups "bids-discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bids-discussi...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bids-discussion/eb264a88-21dd-44ab-b9e0-c665a2b32479n%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bids-discussion/90210da3-b5a6-4754-85c1-02369e829ff9n%40googlegroups.com.
You received this message because you are subscribed to a topic in the Google Groups "bids-discussion" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/bids-discussion/Z3fRsk5IXRM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to bids-discussi...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bids-discussion/10f6e506-4511-4f87-a63a-426e9c4ce8a4n%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bids-discussion/CAN8S%2B%3DfS%2BSkOMYbdT1xvKnwW%3DYi0HsGf7kWXfuqtLch9bnP8aw%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bids-discussion/CAN8S%2B%3DfS%2BSkOMYbdT1xvKnwW%3DYi0HsGf7kWXfuqtLch9bnP8aw%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bids-discussion/CAF%3DPoJMrZMb3FzteRAiVGhLid8ySRmUJ21gxEYci%3DOYA51E33Q%40mail.gmail.com.
Sorry I'm late to this discussion. Ross Blair from Poldrack Lab did something similar to what Sebastian did.He used pyiodide to run ancp_bids in the browser, and if I recall correctly he was able to index a local dataset... and perhaps even read event files (which was our end goal-- in order to support BIDS StasModel generation).
Unfortunately, Ross is out on vacation for a few weeks, and it was just a quick prototype he didn't push anywhere, but I thought I'd mention his name, and that it would be good to loop him into this discussion.
Seems like it would be great to come up with a generalized solution to using ancp_bids in the browser (e.g. maybe it can be written as a npm package or vue/react component?)
On Thursday, June 9, 2022 at 3:15:29 AM UTC-5 remi...@gmail.com wrote:Fairly low hanging fruit that could go in there.- run pybids reports to give the user a human-readable "methods section like" version of the dataset
I have had it on the back burner for ages to improve this pybids functionality.- generate a "diagnostic figure" to see how many files there are per subject
Happy to discuss and hack on some of this.
To view this discussion on the web visit https://groups.google.com/d/msgid/bids-discussion/c8d46b3b-df73-428e-ab78-45b87c8f9f75n%40googlegroups.com.
BIDSLayout('bids:/dataset-dir-123')
BIDSLayout('/mnt/xyz/dataset-dir-123')
To view this discussion on the web visit https://groups.google.com/d/msgid/bids-discussion/CAN8S%2B%3DedxV4Je0CUpGAH6m%2BLvgoKXSCvTMTLhQprC2w8jThA2g%40mail.gmail.com.