Skip to content

Probability Map Viewer in collection mode

Chris Churas edited this page Jul 18, 2018 · 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

Step 1) Download Probability Map Viewer

The following is required to run Probability Map Viewer locally

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

To Download: Instructions can be found here

Step 1a) Alternate - Run via AWS CloudFormation

Launch Probability Map Viewer via AWS CloudFormation

Once the CloudFormation template is complete just ssh into the machine and continue with Step 2

ssh ubuntu@PUBLIC_IP_ADDRESS

Step 2) 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 3) Launch Probability Map Viewer

java -jar probabilitymapviewer-3.0.0-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 of probability map generation jobs that can run concurrently.

Step 4) 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 Threshold which is a probability map generator that was added via the --custom flag:

NOTE: Replace localhost with PUBLIC_IP_ADDRESS if using AWS CloudFormation to run Probability Map Viewer

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 Threshold 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