Skip to main content

MAGDI Data

This python package named magdi_data is responsible for data loading to be used for AI training. It also contains the definition of a specific dataset structure.

Setup

  • pip install -r requirements.txt to run AI experiments
  • pip install -r requirements-tests.txt to run pytest
  • Copy .env-example as .env file and set your credentials and other env variables there

dataset_meta.json

The dataset_meta.json describes a dataset in the Occurrence Instance Format. Its properties have to follow a strict format to be readable by humans and machines.

How to create a dataset

Read README_create_occ_inst_dataset.md

Terms

Occurrence

  • An occurrence is a real scanned object. It can have one or more instances (replicates or measurements).

Instance

  • An instance is a digitalized object.

Contents

property description input json type example
status Current status of the dataset. Default: "not_verified". Possible values: "not_verified", "verified", "deleted", "locked". auto string "not_verified"
id Identifier of the dataset. Used as the folder name. Automatically generated from name, release, and uuid. Immutable after creation. Immutable. auto string "Maize_2025.07.02_abc123..."
uuid Universally unique identifier assigned to this dataset. Immutable. auto string "abc123..."
measurement_channel Measurement channel, how the real object was scanned manual string "lipid"
species_en English name of the species. Replaces old field entity. manual string "Zea mays"
species_de German name of the species. manual string "Mais"
species_la Latin name of the species. manual string "Zea mays"
organ_en English name of the biological organ or structure. Replaces old field structure. manual string "maize"
organ_de German translation of the organ name. manual string "Mais"
development_stage_en Development stage of the biological sample (e.g., "seedling", "mature"). manual string "seedling"
development_stage_de German translation of development stage. manual string "Keimling"
name English name of the dataset. manual string "Maize"
name_de German translation of the dataset name. manual string "Mais"
original_name Optional. Previously used name manual string "technical_name_1234"
release Version release string (e.g., YYYY.MM.DD). Immutable. auto string "2025.07.02"
line_name Name of the plant line manual string "B73"
device The device used to scan the real objects manual string "Manufacturer NMR Device XYZ "
coil Coil of the device manual string "MICWB40 RES 400 1H 040/010 LTR"
description Short description of the dataset. manual string "NMR dataset with all maize samples..."
reference Source or publication where data was derived from. Can be URL or citation. manual string "Leibniz Institute of Plant Genetics and Crop Plant Research (IPK)"
license License under which the dataset is published. manual string "IPK proprietary"
publishing_venue Optional list of venues where the dataset or related work was published. manual array of string ["Zenodo", "Hugging Face", "MRI Hub"]
tags Modalities describing the dataset (e.g., imaging modality, domain). See Hugging Face modality list. manual array of string ["MRI", "3D", "Image"]
task_categories ML tasks the dataset is intended for. See Hugging Face task list. manual array of string ["image-segmentation"]
labels Optional class label mapping. Keys must be ascending integers starting at 0, formatted as strings. No gaps allowed. Missing keys must have empty string as value. manual object { "0": "background", "1": "embryo", "2": "endosperm" }
image_format File extension of the image files (e.g., .nii.gz, .png). auto string ".nii.gz"
annotation_format Optional. File extension of annotation files (e.g., masks). auto string ".nii.gz"
num_instances_total Total number of instances across all splits. Immutable. auto integer 4
num_instances_training Number of instances in training split. Immutable. auto integer 2
num_instances_test Optional. Number of instances in test split. Immutable. auto integer 2
num_instances_validation Optional. Number of instances in validation split. Immutable. auto integer 2
num_occurrences_total Total number of occurrences (biological samples). Immutable. auto integer 4
num_occurrences_training Number of occurrences in training split. Immutable. auto integer 2
num_occurrences_test Optional. Number of occurrences in test split. Immutable. auto integer 2
num_occurrences_validation Optional. Number of occurrences in validation split. Immutable. auto integer 2
image_data_type Data type of image values compatible with NumPy (np.dtype). auto string "int16"
annotation_data_type Optional. Data type of annotation values. auto string "uint8"
value_channels Number of channels per image (e.g., 1 for grayscale, 3 for RGB). auto integer 1
range auto specification of possible voxel value range across all instances. auto array of number [0, 1000]
range_max Maximum value across all instances. Automatically calculated during validation. auto number 1000
range_min Minimum value across all instances. Automatically calculated during validation. auto number 0
range_avg Average value across all instances. Automatically calculated during validation. auto number 500.0
dimensions_max Dimensions of the largest image. Automatically calculated. auto array of integer [96, 128, 150]
dimensions_min Dimensions of the smallest image. Same shape as dimensions_max. Automatically calculated. auto array of integer [41, 64, 78]
dimensions_avg Average dimensions across all images. Same shape as dimensions_max. Automatically calculated. auto array of number [57.496, 92.015, 115.603]
resolution_unit Unit used for voxel size (e.g., mm, µm). auto string "mm"
resolution_voxel_size auto specification of voxel size per dimension. auto array of number [0.1, 0.1, 0.1]
resolution_voxel_size_max Maximum voxel size across all instances. Automatically calculated. auto array of number [0.1, 0.1, 0.1]
resolution_voxel_size_min Minimum voxel size across all instances. Automatically calculated. auto array of number [0.1, 0.1, 0.1]
resolution_voxel_size_avg Average voxel size across all instances. Automatically calculated. auto array of number [0.1, 0.1, 0.1]
training List of image and annotation paths for training instances. "image" is required; "annotations" is required only for labeled data. Immutable. auto array of object [{"image": "occurrence-0001/instance-0000/image.nii.gz", "annotations": "occurrence-0001/instance-0000/annotations.nii.gz"}]
test Optional. Same structure as training for test split. auto array of object [{"image": "occurrence-0004/instance-0000/image.nii.gz", "annotations": "occurrence-0004/instance-0000/annotations.nii.gz"}]
validation Optional. Same structure as training for validation split. auto array of object [{"image": "occurrence-0002/instance-0000/image.nii.gz", "annotations": "occurrence-0002/instance-0000/annotations.nii.gz"}]
showcase_images Optional subset of instances for presentation (e.g., in websites). manual array of object [{"image": "occurrence-0001/instance-0000/image.nii.gz", "annotations": "occurrence-0001/instance-0000/annotations.nii.gz"}]
data_references Maps file paths to real-world identifiers (e.g., sample IDs). Used for traceability. Immutable. auto object {"occurrence-0000/instance-0000/image.nii.gz": "sample_001"}

Example:

{
  "id": "mais_seed_matured_2025-7-5_806fd055-b90d-46d5-a1ce-dd7e61b286ee",
  "uuid": "806fd055-b90d-46d5-a1ce-dd7e61b286ee",
  "species_en": "maize",
  "species_de": "Mais",
  "species_la": "frumentum",
  "organ_en": "seed",
  "organ_de": "Samen",
  "development_stage_en": "matured",
  "development_stage_de": "gereift",
  "name": "Maize Seed Matured",
  "name_de": "Mais Samen Gereift",
  "original_name": "Maize_mix_Classic_mix_M1_res_multi_inst",
  "release": "2025.7.5",
  "line name": "Mais",
  "development_state": "10 DAP",
  "device": "NMR Device",
  "coil": "CRP 13C/1H 5mm 400MHz",
  "measurement channel": "structure",
  "description": "NMR dataset with all maize samples. Test set dispersed among sets 7,8, 10, 11, tree set7 samples discarded.",
  "reference": "Leibniz Institute of Plant Genetics and Crop Plant Research (IPK) ",
  "license": "IPK proprietary",
  "publishing_venue": [],
  "tags": [
    "MRI",
    "3D",
    "Image"
  ],
  "task_categories": [
    "image-segmentation"
  ],
  "labels": {
    "0": "background",
    "1": "embryo",
    "2": "endosperm",
    "3": "aleuron"
  },
  "image_format": ".nii.gz",
  "annotation_format": ".nii.gz",
  "num_instances_total": 6,
  "num_instances_training": 2,
  "num_instances_test": 2,
  "num_instances_validation": 2,
  "num_occurrences_total": 6,
  "num_occurrences_training": 2,
  "num_occurrences_test": 2,
  "num_occurrences_validation": 2,
  "image_data_type": "int16",
  "annotation_data_type": "uint8",
  "value_channels": 1,
  "range": [
    0,
    16000
  ],
  "range_max": 1002,
  "range_min": 0,
  "range_avg": 167.57250248655913,
  "dimensions_max": [
    96,
    128,
    150
  ],
  "dimensions_min": [
    41,
    64,
    78
  ],
  "dimensions_avg": [
    57.49618320610687,
    92.01526717557252,
    115.6030534351145
  ],
  "resolution_unit": "mm",
  "resolution_voxel_size": [
    0.1,
    0.1,
    0.1
  ],
  "resolution_voxel_size_max": [
    0.1,
    0.1,
    0.1
  ],
  "resolution_voxel_size_min": [
    0.1,
    0.1,
    0.1
  ],
  "resolution_voxel_size_avg": [
    0.1,
    0.1,
    0.1
  ],
  "training": [
    {
      "annotations": "occurrence-0000/instance-0000/annotations.nii.gz",
      "image": "occurrence-0000/instance-0000/image.nii.gz"
    },
    {
      "annotations": "occurrence-0001/instance-0000/annotations.nii.gz",
      "image": "occurrence-0001/instance-0000/image.nii.gz"
    }
  ],
  "validation": [
    {
      "annotations": "occurrence-0002/instance-0000/annotations.nii.gz",
      "image": "occurrence-0002/instance-0000/image.nii.gz"
    },
    {
      "annotations": "occurrence-0003/instance-0000/annotations.nii.gz",
      "image": "occurrence-0003/instance-0000/image.nii.gz"
    }
  ],
  "test": [
    {
      "annotations": "occurrence-0004/instance-0000/annotations.nii.gz",
      "image": "occurrence-0004/instance-0000/image.nii.gz"
    },
    {
      "annotations": "occurrence-0005/instance-0000/annotations.nii.gz",
      "image": "occurrence-0005/instance-0000/image.nii.gz"
    }
  ],
  "showcase_images": [
    {
      "annotations": "occurrence-0000/instance-0000/annotations.nii.gz",
      "image": "occurrence-0000/instance-0000/image.nii.gz"
    }
  ],
  "data_references": {
    "occurrence-0000/instance-0000/image.nii.gz": "example1",
    "occurrence-0001/instance-0000/image.nii.gz": "example2",
    "occurrence-0002/instance-0000/image.nii.gz": "example3",
    "occurrence-0003/instance-0000/image.nii.gz": "folder_xyz/exampleA",
    "occurrence-0004/instance-0000/image.nii.gz": "folder_xyz/exampleB",
    "occurrence-0005/instance-0000/image.nii.gz": "folder_xyz/exampleC"
  }
}

Data migration scripts:

There was a migration at Nov 2026.

Change TARGET_FOLDER to the folder of your local datasets and inside the file and then run it to migrate older files than Nov 2026.

migration_script_datasetmeta_json_11_2026.py

Metadata

Release files for magdi-data 0.4.5

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

Source distribution (sdist)

Source distribution for magdi-data 0.4.5
File Size Uploaded Provenance Actions
magdi_data-0.4.5.tar.gz 26.9 kB Without provenance Details for magdi_data-0.4.5.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for magdi-data 0.4.5
File Interpreter ABI Platform Actions
magdi_data-0.4.5-py3-none-any.whl Python 3 none any Details for magdi_data-0.4.5-py3-none-any.whl

Total release size: 55.7 kB

Release files / magdi_data-0.4.5.tar.gz

Download URL magdi_data-0.4.5.tar.gz
Size 26.9 kB
Tags Source
SHA-256 checksum
How to use checksums
d9ae0b2414e57d6057c6fdba2f16847e110fd164c99437c8fff04cb077903e2b
BLAKE2b-256 checksum
How to use checksums
0bab78bcdc7c096d3a9f01dcb6115e7d05cb81741bc09b59e12c9cc34d80c8e9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.18

Release files / magdi_data-0.4.5-py3-none-any.whl

Download URL magdi_data-0.4.5-py3-none-any.whl
Size 28.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
76bdc8220a9a29c03aca73b9808efcfabc42279b207940c14f6fb9ff85b4d27b
BLAKE2b-256 checksum
How to use checksums
09bd22f79bba2a91d622db2905c9fc015bdabd6c81f1cbd6e10f5c9dc0887a6c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.18

Security for magdi-data 0.4.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.4.5 This release

2 release files No provenance

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