Skip to main content

bids-client

Overview

The BIDS Client has three components:

  • Upload (Import)
  • Curate
  • Export

Below is more information about each of the components.

[This information is old and may not be correct.]

Build the image

The following command will build the docker image containing all BIDS Client components.

git clone https://gitlab.com/flywheel-io/public/bids-client
cd bids-client
docker build -t flywheel/bids-client .

Upload

The upload script (upload_bids.py) takes a BIDS dataset and uploads it to Flywheel.

Flywheel CLI

NOTE: This requires the Flywheel CLI.

The upload script has been integrated into the flywheel cli as

fw import bids [folder] [group] [project] [flags]

Docker Script

A docker script has been provided to simplify the below process. To run:

./docker/upload.sh \
    /path/to/BIDS/dir/in/container \
    --api-key '<PLACE YOUR API KEY HERE>' \
    --type 'Flywheel' \
    -g '<PLACE GROUP ID HERE>'

An optional project flag can also be given if the given BIDS directory is not at the project level.

    -p '<PLACE PROJECT LABEL HERE>'

Run Docker image locally

Startup container

docker run -it --rm \
    -v /path/to/BIDS/dir/locally:/path/to/BIDS/dir/in/container \
     flywheel/bids-client /bin/bash

Run the upload script

python /code/upload_bids.py \
    --bids-dir /path/to/BIDS/dir/in/container \
    --api-key '<PLACE YOUR API KEY HERE>' \
    --type 'Flywheel' \
    -g '<PLACE GROUP ID HERE>'

Curate

Gear

The BIDS Curation step (curate_bids.py) has been transformed into a gear for better usability. The git repo for the gear is here: https://gitlab.com/flywheel-io/flywheel-apps/curate-bids

Docker Script

Run it using the docker script

./docker/curate.sh \
    --api-key '<PLACE YOUR API KEY HERE>' \
    -p '<PLACE PROJECT LABEL HERE>' \
    [optional flags]

Flags:

  --reset               Reset BIDS data before running
  --template-file       Template file to use

To standardize how a project is curated, follow this Jupyter notebook

Export

The export script (export_bids.py) takes a curated dataset within Flywheel and downloads it to local disk.

Flywheel CLI

NOTE: This requires the Flywheel CLI.

Usage:

fw export bids [dest folder] [flags]

Flags:

  -h, --help             help for bids
  -p, --project string   The label of the project to export
      --source-data      Include sourcedata in BIDS export

Docker Script

To run

./docker/export.sh \
    /path/to/BIDS/dir/in/container \
    --api-key '<PLACE YOUR API KEY HERE>' \
    -p '<PLACE PROJECT LABEL HERE>'

Run Docker image locally

Startup container

docker run -it --rm \
    -v /path/to/BIDS/dir/locally:/path/to/BIDS/dir/in/container \
     flywheel/bids-client /bin/bash

Run the export script

python /code/export_bids.py \
    --bids-dir /path/to/BIDS/dir/in/container \
    --api-key '<PLACE YOUR API KEY HERE>' \
    -p '<PROJECT LABEL TO DOWNLOAD>'

Testing and contributing

  • Build the test container and run the tests
./tests/bin/docker-test.sh
  • If you want to drop into the container:
./tests/bin/docker-test.sh -B -s   # "-B" prevents building, "-s" run the shell
docker container ls
  1. Find the container name
  2. docker run -ti exec <container name>
  3. Inside the container, run the tests: /src/tests/bin/tests.sh
  • If you are using PyCharm as your IDE, you can build the docker image as above. Add the interpreter, making note of the python path (by dropping in the container and which python). Edit the configurations (top toolbar by debugging) to have the API key made available to the docker image. To do so, add to the container settings. Your home directory/.config/flywheel/user.json should point to /root/.config/flywheel/user.json in the container. N.B. Relative or path expansions don't work. From there, you should be able to debug whichever tests you desire.

  • Setting conditional breakpoints in PyCharm: Click on the link to set a breakpoint. Right click to add a condition. As an example, one of the handiest spots to debug is bidsify_flywheel line 139. Add a condition like: ("file" in context) and (rule.id == "reproin_func_file") and ("task-bart" in context["acquisition"].data["label"]) and debug. All the tests will continue to run until that condition is satisfied. Then, you can step through.

Metadata

Release files for flywheel-bids 1.2.34

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for flywheel-bids 1.2.34
File Interpreter ABI Platform
flywheel_bids-1.2.34-py3-none-any.whl Python 3 none any Details

Release files / flywheel_bids-1.2.34-py3-none-any.whl

Download URL flywheel_bids-1.2.34-py3-none-any.whl
Size 206.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
18ed8b1947c109f87326b158911d443c59189f2981efd3b0364f7bcf93c5a7b7
BLAKE2b-256 checksum
How to use checksums
63bb7d2e06483a8a0a1a2f41a8b95cd8db8ca7c8033cc78ce988d40b72bdb22e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.10.12 {"installer":{"name":"uv","version":"0.10.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Alpine Linux","version":"3.24.0_alpha20260127","id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

This release

1.2.34 This release

1 release file

1.2.33

1 release file

1.2.32

1 release file

1.2.31

1 release file

1.2.30

1 release file

1.2.29

1 release file

1.2.28

1 release file

1.2.27

1 release file

1.2.26

1 release file

1.2.25

1 release file

1.2.24

1 release file

1.2.23

1 release file

1.2.22

1 release file

1.2.21

1 release file

1.2.20

1 release file

1.2.19

1 release file

1.2.18

1 release file

1.2.17

1 release file

1.2.15

1 release file

1.2.14

1 release file

1.2.13

1 release file

1.2.12

1 release file

1.2.11

1 release file

1.2.10

1 release file

1.2.9

1 release file

1.2.6

1 release file

1.2.5

1 release file

1.2.4

1 release file

1.2.3

1 release file

1.2.2

1 release file

1.2.1

1 release file

1.2.0

1 release file

1.1.5

1 release file

1.1.4

1 release file

1.1.3

1 release file

1.1.2

1 release file

1.1.1

1 release file

1.1.0

1 release file

1.0.9

1 release file

1.0.8

1 release file

1.0.7

1 release file

1.0.5

1 release file

1.0.4

2 release files

1.0.3

1 release file

1.0.2

1 release file

1.0.1

1 release file

1.0.0

1 release file

0.9.4

1 release file

0.9.2

1 release file

0.9.1

1 release file

0.9.0

1 release file

0.8.2

1 release file

0.8.1

1 release file

0.8.0

1 release file

0.7.1

1 release file

0.7.0

1 release file

0.6.8

1 release file

0.6.7

1 release file

0.6.6

1 release file

0.6.5

1 release file

0.6.4

1 release file

0.6.3

1 release file

0.6.2

1 release file

0.6.1

1 release file

0.6.0

1 release file

0.5.3

1 release file

0.5.2

1 release file

0.5.1

1 release file

0.5.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page