Labkit - How To Segment A Large Image On An HPC Cluster
High performance computing (HPC) cluster are helpful to process large images that do not fit on consumer computers at very high speed. In order to use Labkit to segment a very large image on an HPC cluster, we need to train a classifier on a small subimage and run the Labkit command tool line on the cluster.
On the local computer:
- Download the dataset of interest, unzip
- Use BigStitcher FIJI plugin to convert the dataset to BDV HDF5 + XML format:
- Install BigStitcher update site in Fiji
- Run Plugins > BigStitcher > Batch Processing > Define dataset … (Use Bioformats importer and make sure to select the correct pixel size)
- Open the image in Labkit using: Plugins > Labkit > Open Image File With Labkit
- Continue as described in the quick automatic segmentation
- Save the trained classifier Segmentation › Save Classifier …
On the HPC cluster:
- Copy the dataset HDF5 + XML to the cluster
- Copy the trained classifier to the cluster
- Download the Labkit command line tool
- Unzip the command line tool archive
- Edit the “Snakemake” file and change the following lines:
IMAGE = “/path/to/your/dataset.xml”
CLASSIFIER = “/path/to/your/pixel.classifier”
USE_GPU = ”true”
- Run the snakemake script:
$ snakemake --cluster=”sbatch --partition=gpu” --jobs=10 --local-cores=1 --restart-times=10