Module labcom.SampleImage3
retrieveのサンプル(画像データ)スクリプト
データを取り出し、画像を表示する。 Grayscaleのみ
$ python SampleImage3.py diag shot subshot channel frame or $ SampleImage3.py diag shot subshot channel frame
e.g) $ SampleImage3.py ECH_2Occd 110000 1 1 100
[ source code ]
import sys from labcom.Retriever import Retriever,RetrieveError
if name == 'main' : import matplotlib.pyplot as mpimg
argvs = sys.argv
argc = len(argvs)
if( argc != 6 ) :
print 'Usage: %s diag shot subshot channel frame' % argvs[0]
print ' or '
print 'Usage: pyhton %s diag shot subshot channel frame' % argvs[0]
print ' on python '
sys.exit(0)
print 'SampleImage3 START'
print Retriever.version()
try:
p = Retriever()
arc = p.get_frames( argvs[1], int(argvs[2]), int(argvs[3]), int(argvs[4]), int(argvs[5]))
fidx = 0
ary= arc.val()
print ary.dtype
print ary.ndim
print ary.shape
print arc.parameters
imgplot=mpimg.imshow(ary[fidx,:,:],cmap = mpimg.get_cmap('gray'))
mpimg.xticks([]), mpimg.yticks([])
mpimg.show()
except RetrieveError, e:
print 'Retrieve Error : ', e.func,e.msg,e.code
print 'SampleImage3 END'