GitHub - BioDepot/fiji-demo (original) (raw)

Image analysis with Bwb

This repository demonstrates how the Biodepot-workflow-builder (Bwb) can be used for portable and reproducible image analysis on a laptop or on a cloud server. We include the Dockerfile for the biodepot/bwb:imaging__latest docker image and several workflows forBwb that demonstrate integration of image processing and analysis inFiji with other tools for processing and analysis, such as Jupyter Notebooks.

Publication

Cloud-enabled Biodepot workflow builder integrates image processing using Fiji with reproducible data analysis using Jupyter notebooks. Ling-Hong Hung, Evan Straw, Shishir Reddy, Robert Schmitz, Zachary Colburn, and Ka Yee Yeung. Scientific Reports 12: 14920, 2022. Earlier version in bioRxiv 10.1101/2021.10.22.465513.

Usage

Fiji and all the demo workflows are included in the imaging version of Bwb that is available from our Docker repository or can be built from the provided Dockerfile. It is also possible to run the regular version of Bwb and load the workflows in this github to use Fiji and the demo workflows. Instructions on how to use Fiji and access the demo workflows are given below.

1 Start the Bwb server

This requires that Docker be installed (instructions here). Then enter the command:

sudo docker run --rm
-p 5900:5900 -p 6080:6080
-v ${PWD}/:/data
-v /var/run/docker.sock:/var/run/docker.sock
-v /tmp/.X11-unix:/tmp/.X11-unix
--privileged --group-add root
biodepot/bwb:imaging__latest

Warning for Windows Subsystem for Linux Users

Running the workflow in WSL is not officially supported, as graphical support was only just recently added and is not robust yet. For the time being, it is strongly recommended that users on Windows run a Linux virtual machine inside a software like VirtualBox or QEMU.

2 Connect to Bwb with a browser or VNC client

To use Bwb, the user can use a browser (Chrome/Firefox/Safari) or a VNC client (e.g. RealVNC). Instructions are given in the Bwb documentation. In most cases, the browser should be set to localhost:6080 if the Bwb server is started on a laptop or the :6080 if started on a remote or cloud server. In addition, to connect to Bwb on the cloud, a port must be opened and forwarded to allow browser and client to communicate with Bwb. The exact methodology will depend on the cloud provider. Some instructions for Amazon web services are provided here

3 Using Fiji as a standalone app

Fiji can be started from Bwb and used as a standalone app on your laptop or on the cloud. To do this:

  1. From the Imaging panel (drawer) in the left sidebar (toolDock) drag the Fiji widget to the right onto the canvas. If the Imaging drawer is closed open the drawer by clicking on the closed drawer to reveal the widgets that are inside.
  2. Double-click on the Fiji widget and click on the Export graphics checkbox.
  3. Enter any optional parameters (starting macros or scripts, extra plugins directory etc) and then click on the start button on the bottom left hand corner.
  4. Fiji will launch.

4 Loading the workflows

The demo workflows are included with the Bwb imaging container image under the /workflows directory.

  1. From the Bwb menu bar, select File > Load Workflow
  2. Using the file navigator, navigate to /workflows (note the beginning "/") and choose one of the workflows from that directory to load. Details on each of the workflows are below.

5 How to use custom files, saving results and modified workflows

Interactions with the user file system are available through directories mounted when Bwb is launched. The example Docker command mounts the directory where Bwb is launched from to the /data mountpoint. Local files are accessible through this the /data directory for reading and writing. User files can be input, and customized workflows and results can be saved here. If Bwb was started on the cloud, files will be read and stored from a directory on the cloud instance.

6 How to build imaging and omics workflows

Different widgets from the drawers are available to be dragged and dropped onto the canvas to be connected into automated or semi-automated workflows. Other workflows can loaded into Bwb and widgets from these workflows also become available to construct custom workflows. All the widgets in this demo can be used in conjunction with any widget in any Bwb workflow. See the Bwb documentation for how workflows can be assembled, saved and executed.

7 How to quit Bwb

Closing the browser or VNC client does not shut down the Bwb server. If this happens by accident you can reconnect by re-entering the url. To shut down the server from Bwb, close the Bwb window (not the browser window - the close button is in the top right hand corner INSIDE the browser window). Right-click on the desktop inside the browser and choose "Quit container".

Setting up Fiji in the Biodepot-workflow-builder platform on Amazon Web Services (AWS).

A video tutorial can be found here.

Details for using Fiji widget

The Fiji widget can be dragged onto the canvas and used as a standalone application or connected with other widgets to form workflows. Once the widget is dragged onto the canvas, and double-clicking on it reveals a form with parameters that can be set to use different functionalities available in Fiji. Note that to use Fiji, one must check off the "Export graphics" box at the bottom of the form (unless running in headless mode)A screenshot of the Fiji widget, showing the different options.

The possible entries and their function(s) are describe below

Detail of workflows

fiji_workflow - To allow any version of Bwb to use Fiji

The fiji_workflow provides the base Fiji widget. This is to allow the standard and other versions of Bwb to load the Fiji widget for use as a standalone or to incorporate the widget into other workflows. The user would load the fiji_workflow workflow from the GitHub to load it into the sidebar tool dock.

focal_adhesion_segmentation - Focal Adhesion Segmentation and Analysis

This workflow implements focal adhesion segmentation using the algorithm described by Horzum et al. (seeCitations/Acknowledgements). To use it, open the workflow using the process described in Opening the Workflows above; once the workflow is open, double-click the "Start" widget and press the blue "Start" button.

The workflow will create a directory called fiji-test inside the /data volume (i.e. inside your clone of the repository), within which several files will be created; the final results will be in the form of a Jupyter notebook called Results.ipynb. Once the workflow is complete, a web browser will be opened to display the notebook.

A video tutorial can be found here.

bigstitcher - BigStitcher workflow

The workflow showcases BigStitcher -- a software package that enables efficient image alignment and deconvolution of multi-tile and multi-angle image datasets -- running as a Fiji plugin within Bwb. This workflow stitches an image from the Drosophila dataset and can be run within Bwb using the process described in Opening the Workflows above. This workflow will create an ImageJ macro using the parameters specified in the macro widget. The workflow will then run the macro to open BigStitcher in Fiji, define the dataset according to the parameters given, and will open the dataset for visualization using the FIJI widget.

After opening the workflow, double-click the "Start" widget and press the blue "Start" button. The workflow will automatically download the image data and additional files needed to a directory calledbigstitcher-data inside the /data volume. After the download widget is finished, BigStitcher will open with the Fiji plugin and begin stitching the Drosophila dataset provided. After stitching, the user will be left at the visualization stage in BigDataViewer where a manual transform can be selected and the resulting stitched image can be observed.

A video tutorial can be found here.

Citations/Acknowledgements

Troubleshooting