Data Output: Converting output JSON format to CSV tables

Introduction

This document provides general instructions for data output after running an image analysis pipeline. For more information on running pipelines, see Using your PlantCV Pipeline to Batch Process Images.

 

How to convert the output JSON format to CSV tables

After an image analysis pipeline has finished running, you must convert the output JSON format into CSV files that can be used for subsequent analysis. Raw output from your pipeline will appear as a .json file containing a single line of information (Fig. 1).

Fig. 1. The raw output from the image analysis pipeline will be formatted as a .json file. This file needs to be converted to csv format.

Run a command to convert the JSON file to CSV files.

Run the following command from a terminal launched from your Anaconda “plantcv” environment:

plantcv-utils.py json2csv -j output.json -c result-table

  • In the above command, change “output.json” to the name of the .json file for your raw output.

Hint: The name of the .json file for your raw output is specified at “json” in your configuration file. In the sample configuration file below (Fig. 2), the name of the .json file is located at line 3.

Fig. 2. Example configuration file

Related articles

Filter by label

There are no items with the selected labels at this time.