Experimental Physics and
| |||||||||||||||||
|
Thanks for sharing! I can't make your code work, though. Every time I get some gibberish image, You might have forgotten to convert int to string? I am using the following script. Image file -> waveform: import Image import StringIO from epics import PV f = open('hello.bmp') #source image file data = ""> chan = PV ('file') chan.put(data) Waveform -> image file: import os, sys import Image import StringIO from epics import PV chan = PV ('file') #waveform pv data = "" #waveform.val sdata = ''.join(chr(x) for x in data) sfile = StringIO.StringIO(sdata) im = Image.open(sfile) im.save("yoyo.bmp") im.show() Another thing I can't understand - the Intensity widget in BOY. I don't know how to set its properties. I set PV name, Data height, Data width, Max, Min. And get an ugly image. Could you also explain to me how the trasformation image binary file -> waveform and back happens? As I understand an image is roughly a set of pixels each with its own color. There is also a header (which we don't need?) Then we read the file and forward every byte into the waveform record which is of type unsigned char (integers 0-255) with a size = 1byte. So in order to get an image out of the waveform we should break the waveform N times with an interval M (if our image dimensions are N*M). There is also a Color map which specifies what color our integers equal to. Now when we want to convert our waveform back to file we are using the chr(x) function, I don't know why. Next thing as you mentioned is the NELM field and EPICS_CA_MAX_ARRAY_BYTE variable. So if our image is say 400*300 24 bit BMP image, does it mean we should set NELM=400*300 and EPICS_CA_MAX_ARRAY_BYTE=400*300*24? I would be grateful to hear your comments. Thank you. Pavel On Mon, Apr 30, 2012 at 6:59 PM, Matt Newville <[email protected]> wrote: Hi Pavel, -- Best regards, Pavel Maslov, MS Controls Engineer at Pulsed power Lab Efremov Institute for Electro-Physical Apparatus St. Petersburg, Russia Mobile: +7 (951) 672 22 19 Landline: +7 (812) 461 01 01
| ||||||||||||||||
ANJ, 18 Nov 2013 |
·
Home
·
News
·
About
·
Base
·
Modules
·
Extensions
·
Distributions
·
Download
·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing · |