Skip to content

Probability Map Viewer in collection mode

Chris Churas edited this page May 10, 2017 · 12 revisions

This page contains instructions on running Probability Map Viewer in collection mode where the images are pre-tiled.

For instructions on DM4 collection mode see Probability Map Viewer Collection mode with DM4 files

Requirements to run this tutorial

  • Centos 6+, Ubuntu 12+, and most other linux distributions should work
  • Java 7+ (jdk to build)
  • Image Magick command line programs (namely convert)
  • Internet connection
  • Web browser. This tutorial was tested on Chrome 52 on linux.
  • Wget

Step 1) Install MATLAB compiled runtime

Instructions can be found here

Step 2) Download Probability Map Viewer

Instructions can be found here

Step 3) Download and create example collection slice

This step does a two things, first it downloads example.png and tiles it using ImageMagick's convert command. Second a trained CHM model is downloaded and extracted. This later step is needed cause collection mode does not yet support adding CHM models from the web interface.

wget https://github.com/CRBS/probabilitymapviewer/wiki/images/example.png
mkdir -p collection/slice_000
echo "name=mycollection" > collection/readme.props
convert example.png -crop 128x128 -set filename:tile "r%[fx:page.y/128]_c%[fx:page.x/128]" +repage +adjoin "collection/slice_000/0-%[filename:tile].png"
wget https://github.com/CRBS/probabilitymapviewer/wiki/data/myprobmapgenerator.sh
chmod a+x myprobmapgenerator.sh

Step 4) Launch Probability Map Viewer

java -jar probabilitymapviewer-2.4.0-SNAPSHOT-jar-with-dependencies.jar --inputimage ./collection/ --disableanalyzingtile --imageheight 4000 --imagewidth 5500 --cores 1 --expectedslices 1000 --collectiondelay 240 --collectionmode --custom Threshold,red,./myprobmapgenerator.sh,52%

Things to note about above command:

  • --collectionmode turns on collection mode where Probability Map Viewer will watch for new directories named slice_###

  • --collectiondelay delay in seconds that Probability Map Viewer waits before looking for a new slice_### directory

  • --inputimage path is where Probability Map Viewer will look for directories of format slice_### loading the directory with the highest ###

  • --expectedslices Tells Probability Map Viewer how many images are in the collection. This is used to move the green progress bar line on the cartoon 3d cube image.

  • --custom This parameter lets the caller set an external command line script to perform probability map generation. See Custom Flag for more information.

  • --imageheight and --imagewidth are set to the size of this example image. For larger images set accordingly.

  • --disableanalyzingtile turns off a feature in Probability Map Viewer that displays a lighter color overlay tile for the tiles that are currently being processed. Reason for this is some browsers (firefox) seem to cache this tile and never show the real segmentation.

  • --cores sets the number or CHM probability map generation jobs that can run concurrently. For 128x128 tiles (default) each CHM job can take a few hundred megabytes of memory so setting the --cores should take into account available memory and cores.

Step 5) View Probability Map Viewer in browser

Launch browser and go to: http://localhost:8080 which should bring a page that looks like the following screenshot where the "layer" cake in the upper left corner has been clicked on showing the base image radio button and Mitochdondria_D8 which is a [CHM][chm] model that was added via the --custom flag:

Initial collection mode

Just like in Probability Map Viewer in single image analysis mode the "layer" cake needs to be clicked on and the Base image and Mitochondria_D8 check box needs to be clicked.

Collection mode

To shutdown Probability Map Viewer click the red power icon in the browser or in the window the Probability Map Viewer jar was invoked hit Ctrl-c