This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import numpy as np | |
| import zarr | |
| import s3fs | |
| from zarr.storage import FsspecStore | |
| from ome_zarr.writer import write_image | |
| import os | |
| # Create data | |
| size_xy = 128 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import zarr | |
| group = zarr.open_group('/home/UWO/akhan488/graham/lightsheet/test_eed/SPIMprep/bids/sub-M1A1Te3/micr/sub-M1A1Te3_sample-brain_acq-imaris_SPIM.ome.zarr.zip',mode='r') | |
| from cvpl_tools.ome_zarr.napari.add import group as add_group | |
| add_group(viewer=viewer,zarr_group=group,merge_channels=False) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| set -euo pipefail | |
| shopt -s expand_aliases | |
| alias osf='uvx --from osfclient osf' | |
| CACHE_DIR=".osfcli.cache" | |
| CACHE_FILE="${CACHE_DIR}/filelist.txt" | |
| CACHE_TTL=3600 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| rule screenshot_unfold: | |
| input: | |
| surf_gii=bids( | |
| root=work, | |
| datatype="surf", | |
| suffix="midthickness.surf.gii", | |
| desc="nostruct", | |
| space="unfold", | |
| hemi="{hemi}", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| subjects,=glob_wildcards('sub-{subject}/qc.html') | |
| print(subjects) | |
| snaps,=glob_wildcards(f'sub-{subjects[0]}/{{snap}}.png') | |
| print(snaps) | |
| rule all: | |
| input: | |
| expand('{ext}s/{snap}.{ext}',ext=['gif','pdf'],snap=snaps) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import nibabel as nib | |
| subjects = ['01'] | |
| hemis = ['L','R'] | |
| subfield_labels={1:'Sub',2:'CA1',3:'CA2',4:'CA3',5:'CA4'} | |
| hipp_metrics = ['thickness','gyrification'] | |
| dentate_metrics = ['gyrification'] | |
| with open('table.csv','w') as f: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from snakebids.utils.snakemake_io import glob_wildcards | |
| configfile: 'config.yml' | |
| subject,session,task = glob_wildcards(config['bold']) | |
| print(subject) | |
| print(session) | |
| print(task) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| bids_dir: '/path/to/bids_dir' | |
| output_dir: '/path/to/output_dir' | |
| #enable printing debug statements during parsing -- disable if generating dag visualization | |
| debug: False | |
| derivatives: False #will search in bids/derivatives if True; can also be path(s) to derivatives datasets | |
| #list of analysis levels in the bids app | |
| analysis_levels: &analysis_levels |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def bids (root=None, prefix=None, suffix=None, subject=None, session=None,include_subject_dir=True,include_session_dir=True,**entities): | |
| """Helper function for generating bids paths for snakemake workflows | |
| File path is of the form: | |
| [root]/[sub-{subject}]/[ses-{session]/[prefix]_[sub-{subject}]_[ses-{session}]_[{key}-{val}_ ... ]_[suffix] | |
| root -- root folder to include in the path (e.g. 'results')) | |
| prefix -- string to prepend to the file name (typically not defined, unless you want tpl-{tpl}, or a subfolder) | |
| suffix -- bids suffix including extension (e.g. 'T1w.nii.gz') |
NewerOlder