~ubuntu-branches/ubuntu/trusty/guiqwt/trusty

« back to all changes in this revision

Viewing changes to guiqwt/tests/image.py

  • Committer: Bazaar Package Importer
  • Author(s): Picca Frédéric-Emmanuel
  • Date: 2011-04-07 22:41:50 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20110407224150-kkhppnq7rp2c8b3c
Tags: 2.1.0-1
* Imported Upstream version 2.1.0
* debian/patches/
  - 0001-features-01_bts614083.patch (delete)
  - 0001-feature-fix-the-documentation-build.patch (new)
* add and install the sift desktop file
* recommends python-dicom (Closes: #621421)
  thanks Junqian Gordon Xu for the report

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
 
8
8
"""ImageDialog test"""
9
9
 
 
10
#FIXME: unexpected behavior when changing the xmin/xmax/ymin/ymax values in 
 
11
#       the image parameters (2nd tab: "Axes")
 
12
 
10
13
SHOW = True # Show test in GUI-based test launcher
11
14
 
12
15
import numpy as np
22
25
    win.show()
23
26
    win.exec_()
24
27
 
25
 
def compute_image(N=2000):
 
28
def compute_image(N=2000, grid=True):
26
29
    T = np.float32
27
30
    x = np.array(np.linspace(-5, 5, N), T)
28
31
    img = np.zeros( (N, N), T )
31
34
    x.shape = (N, 1)
32
35
    img += x**2
33
36
    np.cos(img, img) # inplace cosine
 
37
    if not grid:
 
38
        return img
34
39
    x.shape = (N,)
35
40
    for k in range( -5, 5 ):
36
41
        i = x.searchsorted(k)
102
107
    """Test"""
103
108
    # -- Create QApplication
104
109
    import guidata
105
 
    guidata.qapplication()
 
110
    _app = guidata.qapplication()
106
111
    # --    
107
112
    imshow(compute_image())
108
113