File: contourslice_demo2.py

package info (click to toggle)
scitools 0.7-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 17,252 kB
  • ctags: 2,871
  • sloc: python: 28,744; sh: 112; makefile: 15
file content (45 lines) | stat: -rwxr-xr-x 850 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/usr/bin/env python

# Example taken from:
# http://www.mathworks.com/access/helpdesk/help/techdoc/visualize/f5-3371.html

from scitools.easyviz import *
from time import sleep
from scipy import io

setp(interactive=False)

mri = io.loadmat('mri_matlab_v6.mat')
D = mri['D']
D = squeeze(D)

image_num = 8

x = xlim;
y = ylim;

# Displaying a 2-D Contour Slice:
contourslice(D,[],[],image_num,indexing='xy')
axis('ij')
xlim(x)
ylim(y)
daspect([1,1,1])
colormap('default')
show()

#hardcopy('tmp_contourslice2a.eps')
#hardcopy('tmp_contourslice2a.png')

figure()
BUG = 1
phandles = contourslice(D,[],[],[1,12,19,27-BUG],8,indexing='xy')
view(3)
axis('tight')
#set(phandles,'LineWidth',2)
setp(phandles, linewidth=4)
show()
#sleep(3)
raw_input('Press Return key to quit: ')

## hardcopy('tmp_contourslice2b.eps')
## hardcopy('tmp_contourslice2b.png')