labcom.SampleImage (version 22.0.0, 2020-06-30) |
retrieveのサンプル(画像データ)スクリプト
データを取り出し、画像を表示する。 Grayscaleのみ
$ python SampleImage.py diag shot subshot channel frame
or
$ SampleImage.py diag shot subshot channel frame
e.g)
$ SampleImage.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 'SampleImage 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 'SampleImage END'