Skip to content

Commit e936d25

Browse files
authored
Merge pull request #139 from brainlife/aws-tutorial
DRAFT: Adding tutorial files for AWS
2 parents 9c8f78f + 937069f commit e936d25

File tree

6 files changed

+70
-4
lines changed

6 files changed

+70
-4
lines changed

docs/apps/register.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ Finally, click `Submit`. Visit the Apps page to make sure everything looks OK.
144144

145145
## README / Description / Topics
146146

147-
Brainlife re-uses information stored in github repo.
147+
Brainlife reuses information stored in github repo.
148148

149149
* App Description / Topics
150150

docs/tutorial/aws-brainlife.md

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# Using Brainlife with Amazon Web Services
2+
3+
## Introduction
4+
5+
This tutorial guides you through accessing and using Brainlife datasets with various AWS services. Brainlife datasets are hosted on Amazon S3 and can be seamlessly integrated with SageMaker, Lambda, EC2, and Batch for neuroimaging analysis and processing.
6+
7+
## Accessing Brainlife Datasets
8+
9+
Brainlife datasets are stored in an S3 bucket at `s3://brainlife/`. Each dataset includes a `config.json` file containing essential metadata.
10+
11+
To list available datasets using the AWS CLI:
12+
13+
```
14+
aws s3 ls s3://brainlife/
15+
```
16+
17+
## Using Datasets with AWS Services
18+
19+
### SageMaker
20+
21+
In a SageMaker notebook, you can import Brainlife datasets using:
22+
23+
!!! info
24+
Replace `project_id` and `dataset_id` with Brainlife-specific identifiers
25+
26+
```
27+
!aws s3 cp s3://brainlife/project_id/dataset_id/ . --recursive
28+
```
29+
30+
### Lambda
31+
32+
For serverless applications, reference Brainlife datasets in your Lambda function by specifying the S3 path and using the AWS SDK to access the data.
33+
34+
### EC2 & Batch
35+
36+
For compute-intensive tasks, you can use EC2 instances or AWS Batch with Brainlife datasets. Access the datasets directly from S3 using the AWS SDK or CLI commands in your processing scripts. For neuroimaging workflows, you can either develop custom applications or leverage Brainlife's pre-built pipelines that are compatible with cloud-based execution environments.
37+
38+
## OME-Zarr on S3
39+
40+
OME-Zarr is a format for storing bioimaging data, often used in microscopy workflows. If you’re storing an OME-Zarr dataset in S3 (including Brainlife’s S3 buckets), you’ll find a directory structure containing various `.z*` files that specify metadata, multiscale images, and associated attributes.
41+
42+
Here’s an example of what an OME-Zarr layout might look like:
43+
44+
```
45+
OME-Zarr/
46+
├── .zattrs # Global attributes (JSON)
47+
├── .zgroup # Group metadata (JSON)
48+
├── 0 # Multiscale level 0 (highest resolution)
49+
│ ├── .zarray # Zarr array metadata (JSON)
50+
│ ├── 0 # Chunk file(s) containing raw data
51+
│ ├── 1
52+
│ └── 2
53+
└── 1 # Multiscale level 1
54+
├── .zarray
55+
├── 0
56+
├── 1
57+
└── 2
58+
```
59+
60+
- **`.zattrs`** and **`.zgroup`** store high-level metadata about the dataset.
61+
- The numbered directories (`0`, `1`, etc.) represent different resolutions or scales of the image data.
62+
- Each `.zarray` contains metadata for that specific resolution level.
63+
- The numbered files within each resolution directory (for example, `0`, `1`, `2`) contain the actual chunked pixel data.
64+
65+
When working with OME-Zarr data on S3, you can use tools such as [zarr-python](https://zarr.readthedocs.io/en/stable/) or [ome-zarr-py](https://github.com/ome/ome-zarr-py) to read and write image data directly from the bucket.

docs/tutorial/diffusion-tractography.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ Once you're happy with the results, you can move onto fitting the CSD, DTI, and
161161
* Hit 'Submit'
162162
1. Once the app is finished running, view the results by clicking the 'eye' icon to the right of the dataset
163163
* Choose 'mrview' as your viewer
164-
* This will overlay the tractogram on the generated fractional anistropy (FA) image
164+
* This will overlay the tractogram on the generated fractional anisotropy (FA) image
165165
1. You can also generate a QA image of the whole-brain tractograms by running the 'Generate figures of whole-brain tractogram (tck)' using the whole-brain tractogram (tck) generated above! Archive the results and save with the tag 'qa whole brain tractogram'.
166166

167167
If you're happy with the results, you're ready to move onto segmenting major white matter tracts!

docs/tutorial/networkneuroscience-structural.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ Once you're happy with the results, you can move on to fitting the CSD, DTI, and
175175
* Hit 'Submit'
176176
1. Once the app is finished running, view the results by clicking the 'eye' icon to the right of the dataset
177177
* Choose 'mrview' as your viewer
178-
* This will overlay the tractogram on the generated fractional anistropy (FA) image
178+
* This will overlay the tractogram on the generated fractional anisotropy (FA) image
179179
1. You can also generate a QA image of the whole-brain tractograms by running the 'Generate figures of whole-brain tractogram (tck)' using the whole-brain tractogram (tck) generated above! Archive the results and save with the tag 'qa whole brain tractogram'.
180180

181181
If you're happy with the results, you're ready to move on to structural connectivity generation!

docs/tutorial/old/networkneuroscience.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ Once you're happy with the results, you can move onto fitting the CSD, DTI, and
239239
* Hit 'Submit'
240240
1. Once the app is finished running, view the results by clicking the 'eye' icon to the right of the dataset
241241
* Choose 'mrview' as your viewer
242-
* This will overlay the tractogram on the generated fractional anistropy (FA) image
242+
* This will overlay the tractogram on the generated fractional anisotropy (FA) image
243243
1. You can also generate a QA image of the whole-brain tractograms by running the 'Generate figures of whole-brain tractogram (tck)' using the whole-brain tractogram (tck) generated above! Archive the results and save with the tag 'qa whole brain tractogram'.
244244

245245
If you're happy with the results, you're ready to move on to structural connectivity generation!

mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ nav:
3838
- Introduction: tutorial/introduction-to-brainlife.md
3939
- ezBIDS: tutorial/ezBIDS.md
4040
- Anatomy: tutorial/t1w-preprocessing.md
41+
- AWS: tutorial/aws-brainlife.md
4142
- FMRI Preprocessing: tutorial/fmri-preprocessing-tutorial.md
4243
- PRF Mapping: tutorial/prf-mapping.md
4344
- DWI Preprocessing : tutorial/diffusion-preprocessing.md

0 commit comments

Comments
 (0)