File: gui_usage.py

package info (click to toggle)
gamera 1%3A3.4.2%2Bgit20160808.1725654-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 22,312 kB
  • ctags: 24,991
  • sloc: xml: 122,324; ansic: 52,869; cpp: 50,664; python: 35,034; makefile: 118; sh: 101
file content (21 lines) | stat: -rw-r--r-- 469 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import sys

def my_application():
   image = load_image(sys.argv[-1])
   onebit = image.otsu_threshold()

   # Display the image in a window
   onebit.display()	       

   # Assign it do a global variable so the window doesn't
   # disappear
   global onebit_global
   onebit_global = onebit

# Import the Gamera core and initialise it
from gamera.core import *
init_gamera()

# Import the Gamera GUI and start it   
from gamera.gui import gui
gui.run(my_application)