Skip to content

Latest commit

 

History

11 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

mask_cutout & mask_split

mask_cutout.py creates separate TIFF stacks containing cutouts of the original image data where a given mask exists, using syGlass-exported segmentation as input. This can be useful for showing each part separately in Imaris, e.g.

mask_split.py create separate TIFF stacks as well, but each containing a binary mask (0 where mask doesn't exist, 1 where it does). This is useful for adding masks to Imaris.

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 or in mask_split.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 or python mask_split.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, or, in the case of mask_split.py, a binary mask.

About

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

Resources

Stars

1 star

Watchers

3 watching

Forks

Releases

Packages

Contributors

Languages