jipipe package

Submodules

jipipe.data_slot module

This file provides functions that are used to manage the contents of a data slot

Zoltán Cseresnyés, Ruman Gerst

Research Group Applied Systems Biology - Head: Prof. Dr. Marc Thilo Figge https://www.leibniz-hki.de/en/applied-systems-biology.html HKI-Center for Systems Biology of Infection Leibniz Institute for Natural Product Research and Infection Biology - Hans Knöll Institute (HKI) Adolf-Reichwein-Straße 23, 07745 Jena, Germany

The project code is licensed under BSD 2-Clause. See the LICENSE file provided with the code for the full license.

class jipipe.data_slot.DataSlot(data_type: str, storage_path: Path, node_id='', internal_path: Path = '', name: str = '', slot_type: str = '')[source]

Bases: object

Models a JIPipe data slot.

add_row(n: int = 1, text_annotations: dict | None = None, data_annotations: dict | None = None, true_data_type: str | None = None)[source]

Adds n rows into the slot :param true_data_type: the true data type ID of this entry. If none, the slot data type is used :param text_annotations: annotations to set for these rows :param data_annotations: annotations to set for these rows :param n: how many rows to add :return: the last row index

copy_row(source_data_slot, source_row: int)[source]

Copies data from the source slot into this slot :param source_data_slot: the source slot :param source_row: the source row

get_row_storage_path(row: int)[source]

Returns the storage path for the provided row :param row: the row index :return: the storage path for the row

save(with_csv=False)[source]

Saves all metadata related to this slot in the storage folder. This will overwrite data-table.json and data-table.csv (if enabled) :param with_csv: Also write the table as CSV. The format is equivalent to the one generated by JIPipe. Writing with CSV requires pandas to be installed. :return: None

to_dict()[source]

Converts the data slot into a dict that can be serialized into JSON :return: a dictionary that describes this slot

to_table()[source]

Converts the data slot into a Pandas table.The format is equivalent to data-table.csv generated by JIPipe. :return: Pandas table

jipipe.data_slot.import_from_folder(storage_path: Path)[source]

Imports a data slot from a storage path. A valid storage path contains ‘data-table.json’ and multiple numeric folders. :param storage_path: the storage path :return: a DataSlot instance

jipipe.filesystem module

This file provides functions to read/write ImageJ data types

Zoltán Cseresnyés, Ruman Gerst

Research Group Applied Systems Biology - Head: Prof. Dr. Marc Thilo Figge https://www.leibniz-hki.de/en/applied-systems-biology.html HKI-Center for Systems Biology of Infection Leibniz Institute for Natural Product Research and Infection Biology - Hans Knöll Institute (HKI) Adolf-Reichwein-Straße 23, 07745 Jena, Germany

The project code is licensed under BSD 2-Clause. See the LICENSE file provided with the code for the full license.

jipipe.filesystem.add_file(path, data_slot: DataSlot, text_annotations: dict | None = None, data_annotations: dict | None = None)[source]

Adds a new path into a new row of the specified slot :param path: a path-like object :param data_slot: the data slot :param text_annotations: optional annotations (a dict of string keys and string values) :param data_annotations: optional annotations (a dict of string keys and dict values that contain true-data-type and row-storage-folder) :return: index of the newly added row

jipipe.filesystem.add_folder(path, data_slot: DataSlot, text_annotations: dict | None = None, data_annotations: dict | None = None)[source]

Adds a new path into a new row of the specified slot :param path: a path-like object :param data_slot: the data slot :param text_annotations: optional annotations (a dict of string keys and string values) :param data_annotations: optional annotations (a dict of string keys and dict values that contain true-data-type and row-storage-folder) :return: index of the newly added row

jipipe.filesystem.add_path(path, data_slot: DataSlot, text_annotations: dict | None = None, data_annotations: dict | None = None, data_type_id='path')[source]

Adds a new path into a new row of the specified slot :param data_type_id: The ID of the generated path data type :param path: a path-like object :param data_slot: the data slot :param text_annotations: optional annotations (a dict of string keys and string values) :param data_annotations: optional annotations (a dict of string keys and dict values that contain true-data-type and row-storage-folder) :return: index of the newly added row

jipipe.filesystem.get_file(data_slot: DataSlot, row: int = 0) str

Gets a path data from a data slot :param data_slot: the data slot :param row: the row :return: path data as string

jipipe.filesystem.get_folder(data_slot: DataSlot, row: int = 0) str

Gets a path data from a data slot :param data_slot: the data slot :param row: the row :return: path data as string

jipipe.filesystem.get_path(data_slot: DataSlot, row: int = 0) str[source]

Gets a path data from a data slot :param data_slot: the data slot :param row: the row :return: path data as string

jipipe.imagej module

This file provides functions to read/write ImageJ data types

Zoltán Cseresnyés, Ruman Gerst

Research Group Applied Systems Biology - Head: Prof. Dr. Marc Thilo Figge https://www.leibniz-hki.de/en/applied-systems-biology.html HKI-Center for Systems Biology of Infection Leibniz Institute for Natural Product Research and Infection Biology - Hans Knöll Institute (HKI) Adolf-Reichwein-Straße 23, 07745 Jena, Germany

The project code is licensed under BSD 2-Clause. See the LICENSE file provided with the code for the full license.

jipipe.imagej.add_image(data, data_slot: DataSlot, text_annotations: dict | None = None, data_annotations: dict | None = None, convert_64_to_32=True, imagej=True, **kwargs)[source]

Adds a new image into a new row of the specified slot. The image will be saved as TIFF. Requires tifffile. This method accepts all parameters utilized by tifffile.imsave :param convert_64_to_32: If enabled, convert 64-bit float to 32-bit float. ImageJ does not support 64 bit :param data: an image. must be a numpy array. Can be None. In this case, you must provide shape and dtype (like tifffile’s method requires) :param data_slot: the data slot :param text_annotations: optional annotations (a dict of string keys and string values) :param data_annotations: optional annotations (a dict of string keys and dict values that contain true-data-type and row-storage-folder) :param imagej: if the generated output should have the necessary metadata for ImageJ loading :return: index of the newly added row

jipipe.imagej.add_table(table, data_slot: DataSlot, text_annotations: dict | None = None, data_annotations: dict | None = None)[source]

Adds a new table into a new row of the specified slot :param table: the table. must be a Pandas table or dictionary that can be converted into a data frame :param data_slot: the data slot :param text_annotations: optional annotations (a dict of string keys and string values) :param data_annotations: optional annotations (a dict of string keys and dict values that contain true-data-type and row-storage-folder) :return: index of the newly added row

jipipe.imagej.get_image_file(data_slot: DataSlot, row: int)[source]

Finds the image file located in imagej-imgplus-* data slot rows :param data_slot: the data slot :param row: the row :return: path to the image file or None if not found

jipipe.imagej.get_table_file(data_slot: DataSlot, row: int = 0)[source]

Finds the CSV table file located in imagej-results-table (and related) data slow rows :param data_slot: the data slot :param row: the row :return: path to the CSV file or None if not found

jipipe.imagej.load_image_file(data_slot: DataSlot, row: int = 0)[source]

Finds and loads the image file located in imagej-imgplus-* data slot rows and loads it with Skimage. Requires that Skimage is installed. :param data_slot: the data slot :param row: the row :return: Image data or None if no image was found

jipipe.imagej.load_table_file(data_slot: DataSlot, row: int = 0)[source]

Finds and loads the CSV table file in imagej-results-table (and related) data slow rows as pandas data frame Requires that pandas is installed. :param data_slot: the data slot :param row: the row :return: Image data or None if no image was found

Module contents