Skip to content

Create TIFF stacks containing cutouts of the original image data where a given mask exists, using syGlass-exported segmentation as input.

Notifications You must be signed in to change notification settings

IstoVisio/mask_cutout

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

mask_cutout

Create TIFF stacks containing cutouts of the original image data where a given mask exists, using syGlass-exported segmentation as input.

Usage

First, ensure that Python 3 and all dependecies are installed. If a dependency such as tifffile is missing, you can typically install it via pip from the command line, e.g. pip install tifffile.

Modify the mask, image, and results directories in mask_cutout.py. The mask and image directories should correspond to the directories where the mask and image TIFF files were exported from syGlass. The results directory is the directory in which you'd like the output image stacks to be placed.

# Configure these three fields to match the directories containin the outputs from syGlass
# and the directory where you'd like the result images to be written
IMAGE_DIR = r'C:\Users\natha\Downloads\88-0412-OG_647_ROI-2\Image'
MASK_DIR = r'C:\Users\natha\Downloads\88-0412-OG_647_ROI-2\Mask'
RESULTS_DIR = r'C:\Users\natha\Downloads\mask_labels_results'

Finally, from the command line, run python mask_cutout.py. When the script has finished, a separate TIFF stack for each mask should be written to the results directory, each containing the bits of the original image stack that were overlapped by that mask, with black (zero) values elsewhere.

About

Create TIFF stacks containing cutouts of the original image data where a given mask exists, using syGlass-exported segmentation as input.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages