Skip to content

A flowscope "fork" with additional script for parallelization and visualization.

Notifications You must be signed in to change notification settings

proudot/flowscope

Repository files navigation

README for bash-based use on biohpc (Danuser lab)

Compilation

cd flowscope/CSL2/
sh buildonbiohpc.sh

Test run

To run the computation on test data.

cd sh-script/
sh compOF.sh

To visualize results on the all stack

cd sh-script/
sh view-res.sh

To visualize results on a selected crop

cd sh-script/
sh view-blended-crop.sh

Original README for python

Author: Sandeep MANANDHAR Team Serpico, Inria-Rennes [email protected]

There are five essential folders involved in the installation and running of the flowscope code.

bioimagepy : framework to run the flowscope in jupyter notebook flowscope : contains main source code that you need to build prior to running the code flowscope-wrapping : contains wrapping function for flowscope flowvis : a library to visualize 2D flowfields in color output : output folder where the u,v,w and magnitude components will be saved in tif format

Installation (Two steps):

#Step 1: Build 3D variational optical flow code written in C++.

Go to inside the directory flowscope/CSL2/build.

Open a terminal in this directory run command:cmake.. run command:make

A binary file called CTvar will be created in this directory.

#Step 2: Installing python 3 with anaconda. This step will install necessary libraries to run the flowscope in jupyter notebook.

For instructions to install Anaconda for different platforms, go to : https://docs.anaconda.com/anaconda/install/

Following packages are necessary: matplotlib libtiff imageio scikit-image

Luckily, anaconda installation will take care of these packages.

Running the code with Jupyter notebook

  1. Open a terminal in the folder containing the five essential folders. It also contains a file named flowscope.ipynb which is the starting point to run the code.

  2. In the terminal, run command: jupyter notebook A browser will open with a notebook. If it does not open a browser window, the following prompt may appear:

To access the notebook, open this file in a browser:
file:///Users/smanandh/Library/Jupyter/runtime/nbserver-3595-open.html
Or copy and paste one of these URLs:
http://localhost:8889/?token=d79ad1dd40cac12e85c2c52f88b314cee9d39df610c4e502
or http://127.0.0.1:8889/?token=d79ad1dd40cac12e85c2c52f88b314cee9d39df610c4e502
0:86: execution error: "file:///Users/smanandh/Library/Jupyter/runtime/nbserver-3595-open.html" doesn’t understand the “open location” message. (-1708)

In this case, simply copy paste the url with localhost address in your internet browser, for e.g.

http://localhost:8889/?token=d79ad1dd40cac12e85c2c52f88b314cee9d39df610c4e502

  1. Once the notebook is open in the browser, simply click and open the file flowscope.ipynb.

  2. In the menubar, go to Kernel>Change kernel>Python3. Just make sure, python3 is selected.

  3. Hit Run to start the code. You can also go to Kernel>Restart & Run all.

Things to take care of

a) In the section "Load the data", make sure to set the path of source and target volumes correctly. b) Once the section "Interactive parameters selection" is ran, two sliders will appear below the section.

Gamma slider controls smoothness of the field. 
Set it to around 0.1-0.2.

Maximum_iteration slider controls the interation number (it larger the iteration, the longer it takes to compute). 
Set it to 5-10

d) The u,v,w components or (x,y,z) displacements are saved separately in the output folder.

e) x,y,z value is required to slice the volume to visualize the flow field

f) "Compute Magnitude" section computes the magnitude and saves it as 3D tif file in the output folder.

In case of any confusion, contact me: [email protected]

About

A flowscope "fork" with additional script for parallelization and visualization.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published