Running MIRACL on Compute Canada

This tutorial highlights the registration workflow but a similar approach applies to other commands.

When using Compute Canada, MIRACL can be used as a Apptainer container.

Copy your data to Compute Canada

For example, to copy a folder called input_clar containing tiff files you want to register to the Allen Atlas use:

$ scp -r input_clar niagara.computecanada.edu:/scratch/<username>/.

or

$ rsync -avPhz input_clar <username>@niagara.computecanada.edu:/scratch/<username>/.

Alternatively, for large datasets, or if you desire a GUI, you can setup a Globus transfer server by following instructions on the Digital Research Alliance of Canada wiki.

Log in to Compute Canada server

Log in to the Compute Canada server you copied your data to:

$ ssh -XY <username>@niagara.computecanada.edu

Setting up and using MIRACL

Load the specific Apptainer module you would like to use (e.g. Apptainer 1.3.5):

$ module load apptainer/1.3.5

Note

Not specifying the version will load the latest version available on your node

Since MIRACL will take up a significant amount of space, it is recommended to download and work with the MIRACL Apptainer container in the scratch directory. First, navigate there:

$ cd $SCRATCH

Then either build or directly download a MIRACL Apptainer container. For example, building the container would be done with:

$ apptainer build miracl_latest.sif docker://mgoubran/miracl:latest

To download a MIRACL Apptainer binary directly, do either of the following:

$ wget https://huggingface.co/datasets/AICONSlab/MIRACL/resolve/dev/apptainer/versions/miracl_v242.sif

or

$ curl -L -O https://huggingface.co/datasets/AICONSlab/MIRACL/resolve/dev/apptainer/versions/miracl_v242.sif

Note

Replace the version number with the version of MIRACL you want to download.

Note

If you have a particular Apptainer container of MIRACL that you want to use on Compute Canada, just copy it to the servers directly using e.g. scp or rsync instead of building or downloading the latest version of MIRACL from the Apptainer registry

Start the MIRACL Apptainer container with the default folders mounted:

$ apptainer shell miracl_latest.sif bash

Apptainer will automatically mount your scratch folder to your container. If you need to mount a specific directory into a specific location, use the following:

$ apptainer shell -v <location_outside_container>/<source_mount>:<location_in_container>/<target_mount> miracl_latest.sif bash

Once you are logged in to the container, load the GUI from the shell:

$ miraclGUI

Note

Please consult our Troubleshooting section on Apptainer if you experience problems with opening MIRACL's GUI on Compute Canada

Or use MIRACL from the command line. For example, run MIRACL's CLARITY registration workflow on the folder that you copied over previously:

$ miracl flow reg_clar -f input_clar -n "-d 5 -ch autofluo" -r "-o ARS -m combined -v 25"

Note

If you have a particular Apptainer container of MIRACL that you want to use on Compute Canada, just copy it to the servers directly using e.g. scp or rsync instead of pulling (downloading) the latest version of MIRACL from the Apptainer registry

Jupyter notebook

An accompanying Jupyter notebook for this tutorial can be found here.