Image cleaner module
This module takes clear of cleaning up the junk from outside the brain area by using masks.
- class library.image_manipulation.image_cleaner.ImageCleaner
Bases:
object
Methods for cleaning images [and rotation, if necessary]. ‘Cleaning’ means applying user-verified masks (QC step) to downsampled or full-resolution images
- create_cleaned_images()
This method applies the image masks that has been edited by the user to extract the tissue image from the surrounding debris 1. Set up the mask, input and output directories 2. clean images 3. Crop images if mask is set to FULL_MASK 4. Get biggest box size from all contours from all files and update DB with that info 5. Place images in new cropped image size with correct background color
- set_crop_size()
- setup_parallel_create_cleaned()
Do the image cleaning in parallel
- setup_parallel_place_images()
Do the image placing in parallel. Cleaning and cropping has already taken place. We first need to get all the correct image sizes and then update the DB.
- update_bg_color()
Updates the background color of the image.
This method retrieves the background color of the image using the ImageManager class, and then updates the corresponding field in the scan run table using the SQLController class.
- Parameters:
None
- Returns:
None