flywheel-bids


Nameflywheel-bids JSON
Version 1.2.26 PyPI version JSON
download
home_pagehttps://gitlab.com/flywheel-io/public/bids-client
SummaryFlywheel BIDS Client
upload_time2024-12-16 22:33:44
maintainerNone
docs_urlNone
authorFlywheel
requires_python<4.0,>=3.8
licenseMIT
keywords flywheel flywheel bids sdk
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <!-- markdownlint-configure-file { "MD024": { "siblings_only": true } } -->

# 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.

```bash
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

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

### Docker Script

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

```bash
./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.

```bash
    -p '<PLACE PROJECT LABEL HERE>'
```

### Run Docker image locally

Startup container

```bash
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

```bash
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

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

Flags:

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

To standardize how a project is curated, follow this [Jupyter notebook](https://gitlab.com/flywheel-io/scientific-solutions/tutorials/notebooks/bids-sidecar-standardization/-/blob/main/BIDS_sidecar_hierarchy_curator.ipynb)

## 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:

```bash
fw export bids [dest folder] [flags]
```

Flags:

```bash
  -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

```bash
./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

```bash
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

```bash
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

```bash
./tests/bin/docker-test.sh
```

- If you want to drop into the container:

```bash
./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.

            

Raw data

            {
    "_id": null,
    "home_page": "https://gitlab.com/flywheel-io/public/bids-client",
    "name": "flywheel-bids",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.8",
    "maintainer_email": null,
    "keywords": "Flywheel, flywheel, BIDS, SDK",
    "author": "Flywheel",
    "author_email": "support@flywheel.io",
    "download_url": null,
    "platform": null,
    "description": "<!-- markdownlint-configure-file { \"MD024\": { \"siblings_only\": true } } -->\n\n# bids-client\n\n## Overview\n\nThe BIDS Client has three components:\n\n- Upload (Import)\n- Curate\n- Export\n\nBelow is more information about each of the components.\n\n[This information is old and may not be correct.]\n\n### Build the image\n\nThe following command will build the docker image containing all BIDS Client\ncomponents.\n\n```bash\ngit clone https://gitlab.com/flywheel-io/public/bids-client\ncd bids-client\ndocker build -t flywheel/bids-client .\n```\n\n## Upload\n\nThe upload script (upload_bids.py) takes a BIDS dataset and uploads it to\nFlywheel.\n\n### Flywheel CLI\n\nNOTE: This requires the Flywheel CLI.\n\nThe upload script has been integrated into the flywheel cli as\n\n```bash\nfw import bids [folder] [group] [project] [flags]\n```\n\n### Docker Script\n\nA docker script has been provided to simplify the below process. To run:\n\n```bash\n./docker/upload.sh \\\n    /path/to/BIDS/dir/in/container \\\n    --api-key '<PLACE YOUR API KEY HERE>' \\\n    --type 'Flywheel' \\\n    -g '<PLACE GROUP ID HERE>'\n```\n\nAn optional project flag can also be given if the given BIDS directory is not at\nthe project level.\n\n```bash\n    -p '<PLACE PROJECT LABEL HERE>'\n```\n\n### Run Docker image locally\n\nStartup container\n\n```bash\ndocker run -it --rm \\\n    -v /path/to/BIDS/dir/locally:/path/to/BIDS/dir/in/container \\\n     flywheel/bids-client /bin/bash\n```\n\nRun the upload script\n\n```bash\npython /code/upload_bids.py \\\n    --bids-dir /path/to/BIDS/dir/in/container \\\n    --api-key '<PLACE YOUR API KEY HERE>' \\\n    --type 'Flywheel' \\\n    -g '<PLACE GROUP ID HERE>'\n```\n\n## Curate\n\n### Gear\n\nThe BIDS Curation step (curate_bids.py) has been transformed into a gear for\nbetter usability. The git repo for the gear is here:\n<https://gitlab.com/flywheel-io/flywheel-apps/curate-bids>\n\n### Docker Script\n\nRun it using the docker script\n\n```bash\n./docker/curate.sh \\\n    --api-key '<PLACE YOUR API KEY HERE>' \\\n    -p '<PLACE PROJECT LABEL HERE>' \\\n    [optional flags]\n```\n\nFlags:\n\n```bash\n  --reset               Reset BIDS data before running\n  --template-file       Template file to use\n```\n\nTo standardize how a project is curated, follow this [Jupyter notebook](https://gitlab.com/flywheel-io/scientific-solutions/tutorials/notebooks/bids-sidecar-standardization/-/blob/main/BIDS_sidecar_hierarchy_curator.ipynb)\n\n## Export\n\nThe export script (export_bids.py) takes a curated dataset within Flywheel and\ndownloads it to local disk.\n\n### Flywheel CLI\n\nNOTE: This requires the Flywheel CLI.\n\nUsage:\n\n```bash\nfw export bids [dest folder] [flags]\n```\n\nFlags:\n\n```bash\n  -h, --help             help for bids\n  -p, --project string   The label of the project to export\n      --source-data      Include sourcedata in BIDS export\n```\n\n### Docker Script\n\nTo run\n\n```bash\n./docker/export.sh \\\n    /path/to/BIDS/dir/in/container \\\n    --api-key '<PLACE YOUR API KEY HERE>' \\\n    -p '<PLACE PROJECT LABEL HERE>'\n```\n\n### Run Docker image locally\n\nStartup container\n\n```bash\ndocker run -it --rm \\\n    -v /path/to/BIDS/dir/locally:/path/to/BIDS/dir/in/container \\\n     flywheel/bids-client /bin/bash\n```\n\nRun the export script\n\n```bash\npython /code/export_bids.py \\\n    --bids-dir /path/to/BIDS/dir/in/container \\\n    --api-key '<PLACE YOUR API KEY HERE>' \\\n    -p '<PROJECT LABEL TO DOWNLOAD>'\n```\n\n## Testing and contributing\n\n- Build the test container and run the tests\n\n```bash\n./tests/bin/docker-test.sh\n```\n\n- If you want to drop into the container:\n\n```bash\n./tests/bin/docker-test.sh -B -s   # \"-B\" prevents building, \"-s\" run the shell\ndocker container ls\n```\n\n1. Find the container name\n2. `docker run -ti exec <container name>`\n3. Inside the container, run the tests: `/src/tests/bin/tests.sh`\n\n- If you are using PyCharm as your IDE, you can build the docker image as above.\n  Add the interpreter, making note of the python path (by dropping in the\n  container and `which python`). Edit the configurations (top toolbar by\n  debugging) to have the API key made available to the docker image. To do so,\n  add to the container settings. Your home directory/.config/flywheel/user.json\n  should point to /root/.config/flywheel/user.json in the container. N.B.\n  Relative or path expansions don't work. From there, you should be able to\n  debug whichever tests you desire.\n\n- Setting conditional breakpoints in PyCharm: Click on the link to set a\n  breakpoint. Right click to add a condition. As an example, one of the handiest\n  spots to debug is `bidsify_flywheel` line 139. Add a condition like: (\"file\"\n  in context) and (rule.id == \"reproin_func_file\") and (\"task-bart\" in\n  context[\"acquisition\"].data[\"label\"]) and debug. All the tests will continue\n  to run until that condition is satisfied. Then, you can step through.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Flywheel BIDS Client",
    "version": "1.2.26",
    "project_urls": {
        "Homepage": "https://gitlab.com/flywheel-io/public/bids-client",
        "Repository": "https://gitlab.com/flywheel-io/public/bids-client"
    },
    "split_keywords": [
        "flywheel",
        " flywheel",
        " bids",
        " sdk"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3b62e4bab8e54b12948a03c5eb48f527c32ee43a874b0feeaf4ec622b38fb562",
                "md5": "3555b307857e3175851db81810022930",
                "sha256": "5f6dc66ae86ead418db679ba793faca3900fcf903c7483cb7eb60abe4d34d9e7"
            },
            "downloads": -1,
            "filename": "flywheel_bids-1.2.26-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "3555b307857e3175851db81810022930",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.8",
            "size": 188234,
            "upload_time": "2024-12-16T22:33:44",
            "upload_time_iso_8601": "2024-12-16T22:33:44.170649Z",
            "url": "https://files.pythonhosted.org/packages/3b/62/e4bab8e54b12948a03c5eb48f527c32ee43a874b0feeaf4ec622b38fb562/flywheel_bids-1.2.26-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-12-16 22:33:44",
    "github": false,
    "gitlab": true,
    "bitbucket": false,
    "codeberg": false,
    "gitlab_user": "flywheel-io",
    "gitlab_project": "public",
    "lcname": "flywheel-bids"
}
        
Elapsed time: 4.47604s