When using parallel processing, PlantCV collects analysis outputs into a hierarchical JSON file. This structure is designed to be flexible, allowing different entities (like individual images) to have different sets of observations without requiring a rigid schema.
The JSON file consists of two top-level sections:
variables: A collection of all observation names found across the entire dataset, defining their category (either metadata or observations) and datatype.entities: A list of data blocks for each unit of analysis (e.g., an image or sub-region). Each entity contains:metadata: Key-value pairs for image or experimental metadata (e.g., timestamp, treatment).observations: A set of data blocks containing measurements. Each observation contains samples that follow the MIAPPE guidelines, including:trait: The name of the observation.method: The PlantCV function used.scale: The units of measurement.datatype: The Python data type.value: The actual measurement value(s).label: The data/category label.
You can convert this JSON structure into tables for downstream analysis using the plantcv-utils json2csv command.
{
"variables": {
"area": {
"category": "observations",
"datatype": "<class 'int'>"
}
},
"entities": [
{
"metadata": {
"image": {
"label": "image file",
"datatype": "<class 'str'>",
"value": "./images/snapshot57393/VIS_SV_0_z1_h1_g0_e65_117881.png"
}
},
"observations": {
"sample1": {
"pixel_area": {
"trait": "area",
"method": "plantcv.plantcv.analyze.size",
"scale": "pixels",
"datatype": "<class 'int'>",
"value": 10000,
"label": "pixels"
}
}
}
}
]
}