Bootstrapper Bootstrapper docs

Your data

bs prepare needs one raw image. At least one volume of the round also needs labels, which are the objects that you traced in its image.

Common layouts

  • Zarr container with raw and labels

    --raw data.zarr/raw --labels labels

  • OME-Zarr image (OME-NGFF 0.4)

    Give the image group or one level, such as --raw image.ome.zarr/0.

  • Tif stack or folder of 2D images

    --raw stack.tif --voxel-size 40,8,8

  • Labels in a tif

    First convert with bs utils convert -i labels.tif -o data.zarr/labels -d uint64 -vs 40 8 8.

A raw is z y x, or c z y x with channels. Labels must be z y x integer object IDs at the voxel size of the raw, and 0 means no object. A label path is relative to the raw's container, or to the current folder.

Tif and image-folder conversion

bs prepare converts a tif or an image folder into a uint8 Zarr array in the round folder. It scales the intensities so that the brightest voxel is 255. It reads files in name order, so number them with leading zeros, such as 007.png.

How you labelled

  • Only some objects

    --labelled sparsely

  • Every object

    --labelled densely

  • Every object inside a mask

    --labelled <mask array>

With sparse labels of cells on an empty slide, also add --untraced background. To measure the result against ground truth, add --gt <labels> to a volume.

CREMI A example

The CREMI A volume of the tutorial contains the raw and label arrays side by side.

bs prepare round_01 \
  --raw cremi_a/volume_1.zarr/raw \
  --labels sparse_labels --labelled sparsely

The attributes of each array give its voxel size and offset, in nm and z y x order. These are the attributes of sparse_labels:

{
  "offset": [1240, 0, 256],
  "voxel_size": [40, 8, 8],
  "axis_names": ["z", "y", "x"],
  "units": ["nm", "nm", "nm"]
}
The same round with the prepare dialogue

Give bs prepare the Zarr container, and it lists the label arrays:

$ bs prepare round_01
Set up a round: your arrays, then the models. '?' explains a question, '<' goes back, Tab completes.
Raw image (zarr array or container, tif, image folder; globs work) > cremi_a/volume_1.zarr
    1  labels         63 625 625  uint64  40 8 8 nm
    2  sparse_labels  1 616 593   uint64  40 8 8 nm  offset 1240 0 256
Labels (Enter: none, only predict) > sparse_labels

When bs prepare stops

  • No voxel size

    For a tif or image folder, give --voxel-size. For Zarr, add the voxel size to the metadata before preparing the round.

  • Zarr format 3 or OME-NGFF 0.5

    Export as OME-NGFF 0.4, or convert it.

  • Labels with a different voxel size

    Use the level with the raw's voxel size.

  • OME offset off the voxel grid

    The offset must be a whole number of voxels. Bootstrapper does not move data onto the voxel grid.

Bootstrapper rounds OME-Zarr scales and offsets to whole nanometers, and warns when a value changes by more than 1e-6 nm. Input formats gives the complete rules and a conversion script.