Supported formats
A project takes the formats its modalities list: the setup wizard’s Modalities step shows each modality’s formats, and a project admin picks among them. The Upload page and the ygg command read a file only when one of the project’s modalities takes its format, and they say why they leave out any other file. Nothing is converted: the platform stores each file as it came, with only what identifies the patient removed, and viewers read the stored format.
Formats
Section titled “Formats”Files are recognised by their first bytes where the format has a signature, so their extension does not matter; STL, OBJ, WFDB and gzipped NIfTI files, which have none, are recognised by their name.
| Format | ID | Extensions |
|---|---|---|
| DICOM | dicom |
.dcm, .dicom, .dic, none |
| NIfTI-1, NIfTI-2 | nifti |
.nii, .nii.gz, .hdr + .img |
| NRRD | nrrd |
.nrrd, .nhdr + data |
| PNG | png |
.png |
| JPEG | jpeg |
.jpg, .jpeg |
| HEIC | heic |
.heic, .heif |
| MP4, QuickTime | mp4 |
.mp4, .m4v, .mov |
| WebM, Matroska | webm |
.webm, .mkv |
| TIFF, BigTIFF | tiff |
.svs, .tif, .tiff |
| STL | stl |
.stl |
| PLY | ply |
.ply |
| Wavefront OBJ | obj |
.obj |
| EDF, EDF+, BDF | edf |
.edf, .bdf |
| WFDB | wfdb |
.hea + .dat |
- DICOM: the
DICMmarker after the 128-byte preamble, or a data set that starts with a valid group 0002 or 0008 element, so files without the Part 10 preamble and files without an extension are accepted. The file’s Modality (0008,0060) picks the modality that takes it (table below). A file named as DICOM that is not DICOM is refused as not Part 10; the same instance twice is left out. - NIfTI: the header’s magic (
n+1,n+2); gzipped files by name. A two-file pair is a.hdr(magicni1,ni2) and an.img, either of them possibly gzipped, with the same name in the same folder; one without the other is refused. - NRRD: the
NRRD000magic. A detached header (.nhdr) needs the data files it names (.raw,.raw.gz,.zrawor any other name) in its folder; a header without them, or a data file no header names, is refused. Data compressed with bzip2 is refused. - HEIC: a file type box naming a HEIC brand (phone photos). AVIF and HEIF image sequences are not HEIC.
- MP4, QuickTime, WebM, Matroska: a file type box (but a HEIF or AVIF picture’s), older QuickTime files by a
moov,mdat,wide,freeorskipbox and a video name; WebM and Matroska by the EBML signature. The browser decodes the frames (WebCodecs), so the video’s codec must be one it decodes. - TIFF: either byte order. Tiled pyramidal slides (Aperio SVS, OME-TIFF) and stacks of planes; tiles in JPEG 2000 or another compression the viewers do not decode are refused.
- STL, PLY, OBJ: binary or ASCII STL and OBJ by name, PLY by its
plymagic line. Point clouds without faces, unknown PLY formats and inconsistent files are refused. - EDF, BDF, WFDB: EDF and BDF by their header’s first bytes; a WFDB record by name, a
.heaheader with the.datsignal files it names. Discontinuous EDF+ (EDF+D), annotation-only files, multi-segment WFDB records and WFDB formats other than 16, 61, 80, 160, 212, 24 and 32 are refused.
Files larger than the browser can de-identify in memory are refused as too large.
Modalities
Section titled “Modalities”A modality is a plugin: it says which formats it takes and, for DICOM, which Modality (0008,0060) values. A DICOM file of a Modality no modality of the project takes is left out and named. CBCT is stored as CT.
| Modality | Formats | DICOM Modality |
|---|---|---|
2D images (ygg.image2d) |
DICOM, PNG, JPEG, HEIC | CR, DX, MG, IO, PX |
Volumes (ygg.volume) |
DICOM, NIfTI, NRRD | CT, MR, PT |
Ultrasound (ygg.ultrasound) |
DICOM stills and cine, MP4, WebM | US |
Video (ygg.video) |
MP4, WebM | none |
Whole-slide image (ygg.slide) |
Pyramidal TIFF, DICOM | SM |
Surface mesh (ygg.mesh) |
STL, PLY, OBJ | none |
Signals (ygg.signal) |
DICOM, EDF, BDF, WFDB | ECG, EEG, EMG, EOG, HD, RESP |
Forms only (ygg.forms) |
none | none |
The setup wizard groups them by category: projection radiography (2D images), volumetric radiology (volumes), ultrasound, video, digital pathology (whole-slide images), surface mesh, signals and forms.
When two modalities of a project take the same format (an ultrasound and a video modality both take MP4), the first one in the manifest that takes the file gets it. Each DICOM waveform instance is a series of its own. The label, overview and thumbnail pictures of a DICOM whole-slide image are left out, since they show the glass slide’s label.
Catalog plugins can add modalities and formats of their own: see Writing a modality plugin.
Viewers
Section titled “Viewers”| Modality | Layouts | Viewer |
|---|---|---|
| 2D images | single |
Image stack |
| Volumes | mpr, plane, mpr-3d, stack |
MPR (three planes), one plane, MPR with 3D, or slice stack; brain MRI studies can open as four linked planes (T1, T1c, T2, FLAIR) |
| Ultrasound | cine |
Frame-by-frame player on the image stack |
| Video | player |
Frame-by-frame player on the image stack |
| Whole-slide image | slide |
Tiled slide viewer |
| Surface mesh | mesh |
3D mesh viewer |
| Signals | waveform |
Waveform viewer with channels, gain and time scale |
A project’s manifest picks the layout of each modality; the setup wizard offers the layouts its plugin lists.
Not supported
Section titled “Not supported”These files are left out with a reason on the Upload page and in ygg. Convert them first, then upload the result.
| Files | What to do |
|---|---|
| ZIP and other archives | Extract them, then pick or drop the folder. |
| DICOMDIR | The index file is not an image and is left out. Pick or drop the whole folder: the images it lists are read by their bytes, extension or not. |
MetaImage (.mha, .mhd) |
Convert to NIfTI or NRRD (for example with SimpleITK or 3D Slicer). |
| AVI | Convert to MP4 or WebM (for example with FFmpeg). |
Hamamatsu NDPI, MIRAX (.mrxs) |
Convert to a pyramidal TIFF or OME-TIFF (for example with bfconvert or vips). |
| NRRD with bzip2-compressed data | Save it again with raw or gzip encoding. |