Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 25 additions & 2 deletions src/common-principles.md
Original file line number Diff line number Diff line change
Expand Up @@ -480,8 +480,13 @@ It is also RECOMMENDED to set the `SourceDatasets` field in `dataset_description

### Imaging files

All imaging data MUST be stored using the NIfTI file format. We RECOMMEND using
compressed NIfTI files (.nii.gz), either version 1.0 or 2.0. If using compressed files,
Imaging data SHOULD be stored using the NIfTI file format.
Large imaging data MAY instead be stored using the
[OME-Zarr (OME-NGFF)](https://ngff.openmicroscopy.org/) file format.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if some schema-level check /could/should be added here based on some characteristics of the volume(s) -- e.g. any dimension having over 1k elements?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could: yes

checkname:
  issue: ...
  selectors:
    - type(nifti_header) != 'null'
  checks:
    - max(nifti_header.shape) <= 1000

Should: 🤷🏻

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. I don't feel too strongly here, but if we do add a check let's use level: warning.


#### NIfTI

We RECOMMEND using compressed NIfTI files (.nii.gz), either version 1.0 or 2.0. If using compressed files,
the gzip header SHOULD lack source filenames and timestamps. Imaging data SHOULD
be converted to the NIfTI format using a tool that provides as much of the NIfTI
header information (such as orientation and slice timing information) as
Expand All @@ -501,6 +506,24 @@ The [BIDS-validator](https://github.com/bids-standard/bids-validator)
will check for conflicts between the JSON file and the data recorded in the
NIfTI header.

#### OME-Zarr

[Zarr](https://zarr-specs.readthedocs.io/) is a chunked, cloud-optimized format that provides efficient access to
large multidimensional datasets without requiring a full download.
[OME-Zarr](https://ngff.openmicroscopy.org/), developed by the Open Microscopy Environment (OME),
extends Zarr with bioimaging-specific metadata.
OME-Zarr is particularly suitable for very large imaging volumes (for example, high-resolution
ex vivo MRI) where NIfTI would be impractical for streaming or web-based visualization.

OME-Zarr filesets are stored with the `.ome.zarr` extension.
Spatial metadata (such as the axis names and units, and coordinate transformations) SHOULD
be stored within the OME-Zarr metadata following the
[OME-Zarr version 0.5 specification](https://ngff.openmicroscopy.org/specifications/0.5/index.html)
(the latest released version).
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought to scream "duplication is evil!" but apparently we do not really disclose much in microscopy section about OME or NGFF

❯ git grep -i -e OME.Zarr -e ngff -- src/modality-specific-files/microscopy.md
src/modality-specific-files/microscopy.md:file's header. Further, OME-ZARR (sometimes referred to as OME-NGFF or NGFF) has been developed to provide improved
src/modality-specific-files/microscopy.md:-   [OME-ZARR/NGFF](https://ngff.openmicroscopy.org/latest/) (`.ome.zarr` directories)

but then we should at least take an opportunity to point to this section here from within that microscopy.md section. attn @bids-standard/bep031

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea. I have just pushed a commit.

An example dataset containing an OME-Zarr can be found in the
[BIDS examples repository](https://github.com/bids-standard/bids-examples/tree/master/micr_XPCTzarr)
and can be used as helpful guidance when curating new datasets.

### Tabular files

Tabular data MUST be saved as plain-text, tab-delimited values (TSV) files
Expand Down
5 changes: 3 additions & 2 deletions src/modality-specific-files/microscopy.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,9 @@ by the [Open Microscopy Environment](https://www.openmicroscopy.org/) for whole-
the [OME-TIFF file specifications](https://docs.openmicroscopy.org/ome-model/6.1.2/ome-tiff/file-structure.html).
The OME-TIFF file allows for multi-page TIFF files to store multiple image planes and supports
multi-resolution pyramidal tiled images. An OME-XML data block is also embedded inside the
file's header. Further, OME-ZARR (sometimes referred to as OME-NGFF or NGFF) has been developed to provide improved
file's header. Further, OME-Zarr (sometimes referred to as OME-NGFF or NGFF) has been developed to provide improved
access and storage for large data via chunked and compressed N-dimensional arrays.
For details on using OME-Zarr in BIDS, see the [Common Principles](../common-principles.md#ome-zarr).

The BIDS standard accepts microscopy data in a number of file formats to accommodate datasets
stored in 2D image formats and whole-slide imaging formats, to accommodate lossless and lossy
Expand All @@ -57,7 +58,7 @@ Microscopy raw data MUST be stored in one of the following formats:
(`.ome.tif` for standard TIFF files or `.ome.btf` for
[BigTIFF](https://web.archive.org/web/20240706160214/https://www.awaresystems.be/imaging/tiff/bigtiff.html) files)

- [OME-ZARR/NGFF](https://ngff.openmicroscopy.org/latest/) (`.ome.zarr` directories)
- [OME-Zarr/NGFF](https://ngff.openmicroscopy.org/latest/) (`.ome.zarr` directories)

### Modality suffixes
Microscopy data currently support the following imaging modalities:
Expand Down
1 change: 1 addition & 0 deletions src/schema/meta/templates.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ deriv:
extensions:
- .nii.gz
- .nii
- .ome.zarr/
- .json
entities:
$ref: meta.templates.deriv.spatial.entities
Expand Down
10 changes: 10 additions & 0 deletions src/schema/rules/files/raw/anat.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ nonparametric:
extensions:
- .nii.gz
- .nii
- .ome.zarr/
- .json
datatypes:
- anat
Expand Down Expand Up @@ -46,6 +47,7 @@ parametric:
extensions:
- .nii.gz
- .nii
- .ome.zarr/
- .json
datatypes:
- anat
Expand All @@ -59,6 +61,7 @@ defacemask:
extensions:
- .nii.gz
- .nii
- .ome.zarr/
- .json
datatypes:
- anat
Expand All @@ -73,6 +76,7 @@ megre:
extensions:
- .nii.gz
- .nii
- .ome.zarr/
- .json
datatypes:
- anat
Expand All @@ -88,6 +92,7 @@ mese:
extensions:
- .nii.gz
- .nii
- .ome.zarr/
- .json
datatypes:
- anat
Expand All @@ -104,6 +109,7 @@ multiflip:
extensions:
- .nii.gz
- .nii
- .ome.zarr/
- .json
datatypes:
- anat
Expand All @@ -120,6 +126,7 @@ multiinversion:
extensions:
- .nii.gz
- .nii
- .ome.zarr/
- .json
datatypes:
- anat
Expand All @@ -135,6 +142,7 @@ mp2rage:
extensions:
- .nii.gz
- .nii
- .ome.zarr/
- .json
datatypes:
- anat
Expand All @@ -153,6 +161,7 @@ vfamt:
extensions:
- .nii.gz
- .nii
- .ome.zarr/
- .json
datatypes:
- anat
Expand All @@ -170,6 +179,7 @@ mtr:
extensions:
- .nii.gz
- .nii
- .ome.zarr/
- .json
datatypes:
- anat
Expand Down
3 changes: 3 additions & 0 deletions src/schema/rules/files/raw/dwi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ dwi:
extensions:
- .nii.gz
- .nii
- .ome.zarr/
- .json
- .bvec
- .bval
Expand All @@ -22,6 +23,7 @@ sbref:
extensions:
- .nii.gz
- .nii
- .ome.zarr/
- .json
datatypes:
- dwi
Expand All @@ -41,6 +43,7 @@ ScannerDerivatives:
extensions:
- .nii.gz
- .nii
- .ome.zarr/
- .json
datatypes:
- dwi
Expand Down
8 changes: 8 additions & 0 deletions src/schema/rules/files/raw/fmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ fieldmaps:
extensions:
- .nii.gz
- .nii
- .ome.zarr/
- .json
datatypes:
- fmap
Expand All @@ -25,6 +26,7 @@ pepolar:
extensions:
- .nii.gz
- .nii
- .ome.zarr/
- .json
- .bval
- .bvec
Expand All @@ -38,6 +40,7 @@ pepolar_m0scan:
extensions:
- .nii.gz
- .nii
- .ome.zarr/
- .json
datatypes:
- fmap
Expand All @@ -48,6 +51,7 @@ TB1DAM:
extensions:
- .nii.gz
- .nii
- .ome.zarr/
- .json
datatypes:
- fmap
Expand All @@ -63,6 +67,7 @@ TB1EPI:
extensions:
- .nii.gz
- .nii
- .ome.zarr/
- .json
datatypes:
- fmap
Expand All @@ -82,6 +87,7 @@ RFFieldMaps:
extensions:
- .nii.gz
- .nii
- .ome.zarr/
- .json
datatypes:
- fmap
Expand All @@ -98,6 +104,7 @@ TB1SRGE:
extensions:
- .nii.gz
- .nii
- .ome.zarr/
- .json
datatypes:
- fmap
Expand All @@ -116,6 +123,7 @@ parametric:
extensions:
- .nii.gz
- .nii
- .ome.zarr/
- .json
datatypes:
- fmap
1 change: 1 addition & 0 deletions src/schema/rules/files/raw/func.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ func:
extensions:
- .nii.gz
- .nii
- .ome.zarr/
- .json
datatypes:
- func
Expand Down
1 change: 1 addition & 0 deletions src/schema/rules/files/raw/perf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ asl:
extensions:
- .nii.gz
- .nii
- .ome.zarr/
- .json
datatypes:
- perf
Expand Down
1 change: 1 addition & 0 deletions src/schema/rules/files/raw/pet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ pet:
extensions:
- .nii.gz
- .nii
- .ome.zarr/
- .json
datatypes:
- pet
Expand Down
Loading