Skip to content
Snippets Groups Projects
Forked from Swain Lab / aliby / aliby-mirror
262 commits behind the upstream repository.
Arin Wongprommoon's avatar
Arin Wongprommoon authored
WHY IS THIS CHANGE NEEDED?:
- it complained that ImageDummy object has no .shape attribute when
  Tiler methods like ._run_tp() were called

HOW DOES THE CHANGE SOLVE THE PROBLEM?:
- first argument of the object to be returned by .dummy() is mistakenly
  an Image instance (i.e. ImageDummy); it should be a dask array like
  those returned by e.g. .from_image(), .from_h5()
- fixed by using the .data attribute, consistent with the other methods mentioned

WHAT SIDE EFFECTS DOES THIS CHANGE HAVE?:
- order of dimensions is inconsistent: it is tczxy in io.image.py but
  ctzxy in the .shape() method in tiler.py.  this may break things down
  the line
f1500426
History

ALIBY (Analyser of Live-cell Imaging for Budding Yeast)

docs PyPI version pipeline dev pipeline coverage

End-to-end processing of cell microscopy time-lapses. ALIBY automates segmentation, tracking, lineage predictions, post-processing and report production. It leverages the existing Python ecosystem and open-source scientific software available to produce seamless and standardised pipelines.

Quickstart Documentation

We use (and recommend) OMERO to manage our microscopy database, but ALIBY can process both locally-stored experiments and remote ones hosted on a server.

Setting up a server

For testing and development, the easiest way to set up an OMERO server is by using Docker images. The software carpentry and the Open Microscopy Environment, have provided instructions to do this.

The docker-compose.yml file can be used to create an OMERO server with an accompanying PostgreSQL database, and an OMERO web server. It is described in detail here.

Our version of the docker-compose.yml has been adapted from the above to use version 5.6 of OMERO.

To start these containers (in background):

cd pipeline-core
docker-compose up -d

Omit the -d to run in foreground.

To stop them, in the same directory, run:

docker-compose stop

Installation

See our installation instructions for more details.

Raw data access

ALIBY's tooling can also be used as an interface to OMERO servers, taking care of fetching data when needed.

from aliby.io.dataset import Dataset
from aliby.io.image import Image

server_info= {
           "host": "host_address",
           "username": "user",
           "password": "xxxxxx"}
expt_id = XXXX
tps = [0, 1] # Subset of positions to get.

with Dataset(expt_id, **server_info) as conn:
   image_ids = conn.get_images()

#To get the first position
with Image(list(image_ids.values())[0], **server_info) as image:
   dimg = image.data
   imgs = dimg[tps, image.metadata["channels"].index("Brightfield"), 2, ...].compute()
   # tps timepoints, Brightfield channel, z=2, all x,y

Tiling the raw data

A Tiler object performs trap registration. It may be built in different ways but the simplest one is using an image and a the default parameters set.

from aliby.tile.tiler import Tiler, TilerParameters
with Image(list(image_ids.values())[0], **server_info) as image:
    tiler = Tiler.from_image(image, TilerParameters.default())
    tiler.run_tp(0)

The initialisation should take a few seconds, as it needs to align the images in time.

It fetches the metadata from the Image object, and uses the TilerParameters values (all Processes in aliby depend on an associated Parameters class, which is in essence a dictionary turned into a class.)

Get a timelapse for a given trap

fpath = "h5/location"

trap_id = 9
trange = list(range(0, 30))
ncols = 8

riv = remoteImageViewer(fpath)
trap_tps = riv.get_trap_timepoints(trap_id, trange, ncols)

This can take several seconds at the moment. For a speed-up: take fewer z-positions if you can.

Get the traps for a given time point

Alternatively, if you want to get all the traps at a given timepoint:

timepoint = 0
seg_expt.get_tiles_timepoints(timepoint, tile_size=96, channels=None,
                                z=[0,1,2,3,4])

Contributing

See CONTRIBUTING on how to help out or get involved.