Skip to content

Python scripts for working with TIFF stacks

Notifications You must be signed in to change notification settings

TheLaueLab/tiffutil

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TIFF Utils

A collection of useful scripts for handling .tif stacks.

Installation

The scripts are designed to be installed with setup.py. Detailed instructions can be found in the official documentation.

Dependencies

Python 3, Numpy and tifffile. All are available from PyPI and can be installed as described in the pip documentation.

Usage

The entry point tiffutil is installed. This should be followed by the command to be used, e.g. crop, unstack, smooth or project. For further details, consult the help provided for each command (e.g. tiffutil project --help).

Some examples are shown below.

Unstack

This command unstacks TIFF files where multiple channels are interleaved. For example:

tiffutil unstack stack.tif DAPI.tif CENPA.tif

splits the file stack.tif into DAPI.tif and CENPA.tif, with even-numbered (starting at 0) frames in DAPI.tif and odd-numbered frames in CENPA.tif. Any number of output images is permitted.

Project

This command projects multiple TIFF images into a single frame, optionally with a running-median filter. Custom start and end frames are also possible. It only loads the frames currently being processed, so is useful in memory-constrained situations. For example:

tiffutil project --projection max --end 4000 in001.tif in002.tif out.tif

projects the first 4000 frames of a video (split over two files) into out.tif using a maximum intensity projection.

Smooth

The smooth function runs a rolling-ball smoothing pass over each image in a stack of images. The smoothed image approximates the background. Pass the --correct option to subtract the background instead of extracting it.

tiffutil smooth --radius 2.0 in001.tif in002.tif out.tif

Note: 3D (or nD) smoothing would be straightforward to add, please file a bug if this is a feature you would like.

About

Python scripts for working with TIFF stacks

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%