Metadata manager module

This module is responsible for extracting metadata from the CZI files.

class library.image_manipulation.meta_manager.MetaUtilities

Bases: object

Collection of methods used to extract meta-data from czi files and insert into database. Also includes methods for validating information in database and/or files [double-check]

all_slide_meta_data_exists_in_database(czi_files)

Determines whether or not all the slide info is already in the datbase

Parameters:

list – list of CZI files

Return status:

boolean on whether the files are valid

Return list:

list of CZI files

check_czi_file_exists()

Check that the CZI files are placed in the correct location

correct_multiples()

This method will take care of slides that have multiple slide physical IDs. It will take the one with the higher ID and update them to use the lower ID (the first one). This way, rescans of the same slide can be placed in the CZI directory and the end user can view/modify them in the slide QC area.

czi_directory_validation(czi_files)

CHECK IF DUPLICATE SLIDE NUMBERS EXIST IN FILENAMES. If there are duplicates, record the ID. ALSO CHECKS CZI FORMAT CHECK DB COUNT FOR SLIDE TABLE

Parameters:

czi_files – list of CZI files

Return status:

boolean on whether the files are valid

Return list:

list of CZI files

extract_slide_meta_data_and_insert_to_database()

-Scans the czi dir to extract the meta information for each tif file -ALSO CREATES SLIDE PREVIEW IMAGE

extract_slide_scene_data(czi_file: str)

Extracts the scene data from the CZI file and creates a preview image I don’t see the point in creating a full-size preview image. It also crashes my computer.

parallel_extract_slide_meta_data_and_insert_to_database(file_key)

A helper method to define some methods for extracting metadata. First test if existing slide is in the database, if not, add it. We find it by animal, slide physical id, and scan run id.