v1.8
This commit is contained in:
@@ -1,10 +1,16 @@
|
||||
import json
|
||||
import java.math.BigInteger as BigInteger
|
||||
import org.python.core.PyLong as PyLong
|
||||
import org.python.core.PyFloat as PyFloat
|
||||
import traceback
|
||||
import datetime
|
||||
|
||||
run("Devices/Elements")
|
||||
|
||||
def get_processing_parameters(stream_value):
|
||||
return json.loads(stream_value.getValue("processing_parameters"))
|
||||
|
||||
def _create_tables(paths, stream_value, data_type, shape):
|
||||
def _create_tables(paths, stream_value, data_type, shape, images):
|
||||
root = paths["root"]
|
||||
create_dataset(paths["image"], data_type, dimensions = [images, shape[0], shape[1]])
|
||||
create_dataset(paths["pid"], 'l', dimensions = [images])
|
||||
@@ -60,7 +66,7 @@ def _append_frame(paths, stream_value, index, data_type, shape):
|
||||
print "Saved frame: ", index
|
||||
|
||||
|
||||
def _write_metadata(paths, camera, images = 1, interval = -1):
|
||||
def _write_metadata(paths, camera, images, interval):
|
||||
root = paths["root"]
|
||||
set_attribute(root, "Camera", camera)
|
||||
set_attribute(root, "Images", images)
|
||||
@@ -90,9 +96,8 @@ def save_camera_data(server, images = 1, interval = -1, root = "/camera1", paral
|
||||
for i in range(images):
|
||||
print i
|
||||
if i==0:
|
||||
_create_tables(paths, stream_value, data_type, shape)
|
||||
_write_metadata(paths, camera, images, interval)
|
||||
|
||||
_create_tables(paths, stream_value, data_type, shape, images)
|
||||
_write_metadata(paths, camera, images, interval)
|
||||
start = time.time()
|
||||
stream_value = server.stream.take()
|
||||
if parallel:
|
||||
|
||||
@@ -1,10 +1,5 @@
|
||||
import ch.psi.pshell.imaging.ImageBuffer as ImageBuffer
|
||||
import java.math.BigInteger as BigInteger
|
||||
import org.python.core.PyLong as PyLong
|
||||
import org.python.core.PyFloat as PyFloat
|
||||
import json
|
||||
import traceback
|
||||
import datetime
|
||||
import ch.psi.pshell.bs.PipelineServer as PipelineServer
|
||||
import ch.psi.pshell.imaging.Colormap as Colormap
|
||||
|
||||
|
||||
Reference in New Issue
Block a user