Spaces:
Running on Zero
Running on Zero
Download space/config.toml from rfick/brain-zero: direct link, hf CLI and curl.
- Browser
- Download file 9.32 kB
-
https://huggingface.co/spaces/rfick/brain-zero/resolve/main/space/config.toml
- Command line
-
hf download hf://spaces/rfick/brain-zero/space/config.toml
-
curl -L -o config.toml https://huggingface.co/spaces/rfick/brain-zero/resolve/main/space/config.toml
9.32 kB
| # The DiSCo Space: what is pinned. Every number the app shows comes from pipeline.py on this configuration. | |
| source = "disco" # space/sources/disco.py: the DiSCo phantom (demo: its layout, full: its columnar pack) | |
| [data] | |
| repo = "SubstrateCommons/disco-time-segments" # the public time-segment layout of the DiSCo v2 walk | |
| layout = "disco" # the layout's prefix in the dataset (dmipy_replay.replay.time_segments, format time_segments/2) | |
| revision = "a38679f061f1487b6688ebb37b7ee949da000ea3" # the dataset revision the layout is read at (the OGSE class cos-f50-T20 and the b-tensor class qte-now-80) | |
| manifest_sha256 = "0fe044fd6963de74c6174276e35dd2ddc219d9d4ef2a476df0150ada48e23ef9" # the layout manifest the page was accepted on (checked at load) | |
| pack = "hf://SubstrateCommons/disco-replay/disco" # the replay pack the layout was contracted from: the acceptance test's reference | |
| pack_revision = "b06eb4179a99ef885af73de1ddfbc2f3c230de37" | |
| strands = "substrate/DiSCo_Strands_Trajectories.tck" # the ground truth's strand centrelines (CC BY 4.0) in the replay dataset, read at pack_revision | |
| # The timing classes ("shapes"), each ONE waveform the layout stores (space/classes.py builds it with dmipy-replay's | |
| # sequence builders on the layout's grid, TE = 53.5 ms, 1000 samples; checked against the layout's partition at load): square | |
| # pulses (slew_rate = inf), PGSE unless kind = "pgste" (a stimulated echo storing for TM = Delta - delta) or "ogse" | |
| # (a cosine of `frequency` Hz over `duration` s on each side of the 180, its edges ramped at `slew_rate` T/m/s as built | |
| # at `b_built` s/mm^2: the class stores that one shape at every b). delta / Delta / TE in seconds (an OGSE's delta / | |
| # Delta are the scheme's nominal block and block separation); label is what the app shows. | |
| [shapes."d10.2-D16.7"] | |
| label = "DiSCo δ 10.2 / Δ 16.7 ms (shells b = 0, 1000, 1925)" | |
| delta = 0.0102 | |
| Delta = 0.0167 | |
| TE = 0.0535 | |
| [shapes."d7.6-D45.9"] | |
| label = "DiSCo δ 7.6 / Δ 45.9 ms (shell b = 3091)" | |
| delta = 0.0076 | |
| Delta = 0.0459 | |
| TE = 0.0535 | |
| [shapes."d17.7-D35.8"] | |
| label = "DiSCo δ 17.7 / Δ 35.8 ms (shell b = 13183)" | |
| delta = 0.0177 | |
| Delta = 0.0358 | |
| TE = 0.0535 | |
| [shapes."d12-D24"] | |
| label = "clinical δ 12 / Δ 24 ms" | |
| delta = 0.012 | |
| Delta = 0.024 | |
| TE = 0.0535 | |
| [shapes."d17-D30"] | |
| label = "research δ 17 / Δ 30 ms" | |
| delta = 0.017 | |
| Delta = 0.030 | |
| TE = 0.0535 | |
| [shapes."d8-D20"] | |
| label = "Connectome 2.0 δ 8 / Δ 20 ms" | |
| delta = 0.008 | |
| Delta = 0.020 | |
| TE = 0.0535 | |
| # The stimulated echo matched to DiSCo's b = 3091 shell: the same diffusion time (Delta = delta + TM = 45.9 ms) with | |
| # the magnetisation stored along z for TM, so susceptibility dephasing (and T2) act only during the two deltas. | |
| [shapes."ste-d7.6-TM38.3"] | |
| label = "stimulated echo δ 7.6 / TM 38.3 ms (Δ 45.9 ms, the PGSTE twin of the b = 3091 class)" | |
| delta = 0.0076 | |
| Delta = 0.0459 | |
| TE = 0.0535 | |
| kind = "pgste" | |
| # The paper's cosine OGSE (experiments/disco/disco_acq.py "ogse"): 50 Hz, one 20 ms period each side of the 180. | |
| [shapes."cos-f50-T20"] | |
| label = "cosine OGSE 50 Hz, one 20 ms period each side of the 180 (edges 200 T/m/s, as built at b = 1000)" | |
| kind = "ogse" | |
| frequency = 50.0 | |
| duration = 0.020 | |
| slew_rate = 200.0 | |
| b_built = 1000.0 | |
| delta = 0.019975 | |
| Delta = 0.020029 | |
| TE = 0.0535 | |
| # The b-tensor class: three gradient shapes on the spin echo, each in both encoding windows (six stored terms), so one | |
| # class plays every linear, planar and spherical encoding of them at any rotation and b (space/tensor.py). The shapes | |
| # are the three axes of NOW's maximum-b spherical encoding (Sjolund et al. 2015) at TE 53.5 ms designed at 80 mT/m and | |
| # 200 T/m/s per axis (a 4 ms window for the 180), the physical gradient in `waveform` (data/); rotated, a linear or | |
| # spherical row at b 2000 needs about 124 mT/m on one axis: Connectome-class hardware. delta / Delta are the scheme's | |
| # nominal encoding windows (the CSD and the scheme never read them: a b-tensor run fits maps, not FODs). | |
| [shapes."qte-now-80"] | |
| label = "b-tensor class qte-now-80: NOW spherical encoding at TE 53.5 ms, 80 mT/m and 200 T/m/s per axis (Connectome-class when rotated)" | |
| kind = "tensor" | |
| waveform = "classes/qte-now-80.npy" | |
| delta = 0.0229 | |
| Delta = 0.0253 | |
| TE = 0.0535 | |
| # DiSCo's own protocol: which timing class each shell of the dataset's gradient table plays (b in s/mm^2, the | |
| # table's rows are assigned to the nearest b here). | |
| [disco] | |
| shells = [ | |
| { b = 0, shape = "d10.2-D16.7" }, | |
| { b = 1000, shape = "d10.2-D16.7" }, | |
| { b = 1925, shape = "d10.2-D16.7" }, | |
| { b = 3091, shape = "d7.6-D45.9" }, | |
| { b = 13183, shape = "d17.7-D35.8" }, | |
| ] | |
| # Presets the app offers besides "DiSCo 364" (which comes from the dataset's table): the paper's flagship | |
| # acquisitions (experiments/disco/disco_acq.py), each its gradient table in data/protocols/ (the same files the paper | |
| # replays: b = 0 rows first, then every shell's directions spread by electrostatic repulsion) on one stored class. | |
| [presets."clinical b1000 x 30"] | |
| table = "protocols/clinical" | |
| shape = "d12-D24" | |
| [presets."research 3-shell x 90"] | |
| table = "protocols/research" | |
| shape = "d17-D30" | |
| [presets."Connectome 2.0 b6000 x 60"] | |
| table = "protocols/c2" | |
| shape = "d8-D20" | |
| [presets."cosine OGSE 50 Hz b1000 x 60"] | |
| table = "protocols/ogse" | |
| shape = "cos-f50-T20" | |
| # Tensor-valued encoding: linear and spherical b-tensors interleaved at four b-values on the b-tensor class, the | |
| # b-values and direction counts of Szczepankiewicz et al. 2019's clinical protocol (6, 6, 10, 16 per encoding); the | |
| # same axes for both encodings at each b; one b = 0 row. Its run fits FA (DTI on the linear rows), MD and the | |
| # microscopic FA (the powder averages), not a connectome. | |
| [presets."b-tensor: linear + spherical (Szczepankiewicz 2019), b 100-2000 s/mm²"] | |
| shape = "qte-now-80" | |
| n_b0 = 1 | |
| snr = 100 # its own starting SNR: µFA is noise-limited (the other presets start at [noise] snr) | |
| tensor = { bvalues = [100, 700, 1400, 2000], directions = [6, 6, 10, 16], encodings = ["LTE", "STE"] } | |
| # The noise a run starts with: the SNR at M0 (a full water voxel before relaxation) every preset starts at unless it | |
| # states its own. | |
| [noise] | |
| snr = 30 | |
| # The tissue and the scanner: the field presets the page offers (T), the default field, | |
| # and whether a run starts with the tiers on. Tissue defaults come from dmipy-sim's white-matter catalogue at the | |
| # nearest cited field (1.5 / 3 / 7 T) and are editable on the page. | |
| [physics] | |
| fields = [0.064, 1.5, 3.0, 7.0, 11.7] | |
| default_field = 3.0 | |
| default_on = true | |
| pools = ["intra", "extra"] # the pack's seeded pools (its spec also names a myelin pool nobody was seeded in) | |
| # The scanner menu after "ideal": catalogue machines of dmipy-replay (ScannerLimits.of(key)), each applied with every term | |
| # its entry carries (docs/scanner.md); the phantom sits at a distance from isocentre along a scanner axis (the panel's | |
| # placement, at most 7.9 cm: the whole 1 mm cube inside the Swoop's 8 cm anchor). The Swoop's own gradient needs the | |
| # layout's background vectors (segment_rows(background=True)); a layout without them refuses it by name. | |
| [scanners] | |
| machines = [ | |
| { label = "Hyperfine Swoop 64 mT (permanent magnet, field across the patient)", key = "hyperfine_swoop_64mT" }, | |
| { label = "Siemens Prisma 3 T", key = "siemens_magnetom_prisma_3T" }, | |
| { label = "Siemens Terra 7 T", key = "siemens_magnetom_terra_7T" }, | |
| ] | |
| default_offset_cm = 7.9 | |
| max_offset_cm = 7.9 | |
| delivery_per_meas = 0.0036 # s per measurement per replay: bore.delivered_moments over DiSCo's 31,802 live voxels, 1.3 s at 364 (a CPU host) | |
| # The mode: demo = the time-segment layout (the hosted Spaces; seconds; the stored waveforms), full = the columnar | |
| # replay pack itself (minutes per volume; any timing; the scheme upload), read from | |
| # DISCO_COLUMNS (a directory with the columns, or the Hub at 45 MB/s). DISCO_MODE in the environment overrides. | |
| [mode] | |
| mode = "demo" | |
| columns = "hf://SubstrateCommons/disco-replay/disco" | |
| workers = 16 | |
| # The compute backend: jax (the reference; the Docker Space) or torch (Hugging Face's shared GPU pool, disco-space#2); | |
| # DISCO_BACKEND in the environment overrides. resident = false streams the layout's packed words to the device a | |
| # chunk at a time on every image (nothing kept: a pool that drops the device between calls, a GPU smaller than one | |
| # class's columns, a CPU host); true keeps the columns an image reads on the device across calls. | |
| [compute] | |
| backend = "jax" | |
| resident = false | |
| [tracking] | |
| density = 4 # seeds per region voxel = density^3 (4 -> 659,840 seeds, the DiSCo score's setting) | |
| step_mm = 0.5 | |
| max_angle = 30.0 | |
| max_steps = 500 | |
| # The acceptance gate (tests/test_acceptance.py) on the DiSCo 364 protocol, noiseless. | |
| [gate] | |
| pearson_count_min = 0.90 | |
| missed_pairs_max = 0 | |
| reference_max_abs_diff = 1e-3 # the layout's signal against the replay pack's own replay of the same rows at the gate's voxels, over the bare b = 0 signal | |
| reference_voxels = 32 # voxels spread over the pack's index the reference is replayed at | |
| # The reconstruction: DiSCo is single-fibre white matter, so its CSD is the single-tissue Tournier 2007 one on the | |
| # response white_matter_response_tournier07 estimates from the volume. DISCO_RECONSTRUCTION in the environment overrides. | |
| [reconstruction] | |
| method = "tournier07" | |