Load and convert timelapse CZI files to movie formats
- Generate movies function that can operate on the
T
orZ
axis - General purpose CZI delayed reader
- Supported output formats:
mov
avi
mpg
mpeg
mp4
mkv
wmv
Read and interact with a large file:
from timelapse_tools import daread
# Dask array with delayed reads for every YX plane
img = daread("my_very_large_image.czi")
Generate all scene and channel movie pairs from a file:
from timelapse_tools import generate_movies
# Generates a folder with every scene and channel pair of movies in the file
generate_movies("my_very_large_image.czi")
If you want to generate these movies in a distributed fashion, spin up a Dask scheduler. The following settings generally work pretty well for our (AICS) SLURM cluster:
from dask_jobqueue import SLURMCluster
import dask, dask.distributed
cluster = SLURMCluster(
cores=2,
memory="16GB",
walltime="12:00:00",
queue="aics_cpu_general"
)
cluster.adapt(minimum_jobs=2, maximum_jobs=40)
client = dask.distributed.Client(cluster)
From there you simply need to pass the distributed executor port to the
generate_movies
function:
from timelapse_tools import generate_movies
generate_movies(
"my_very_large_image.czi",
distributed_executor_port=cluster.scheduler_info["address"].split(":")[-1]
)
It is also recommended that whichever machine you run the scheduler on, to also set the following environment variable:
export DASK_DISTRIBUTED__SCHEDULER__WORK_STEALING="False"
More details under the "work stealing" section here.
pip install git+https://github.com/AllenCellModeling/timelapse_tools.git
Note: If you want to produce workflow visualizations at the end of conversion, you will need to install pydot + graphviz.
For full package documentation please visit AllenCellModeling.github.io/timelapse_tools.
License: Allen Institute Software License