Closedown
This commit is contained in:
@@ -1,30 +1,9 @@
|
||||
import java.awt.Rectangle as Rectangle
|
||||
from ijutils import *
|
||||
|
||||
|
||||
def integrate_roi(source, x,y, w, h):
|
||||
if source.data is None:
|
||||
source.update()
|
||||
roi = source.data.getRoi(Rectangle(x,y, w, h))
|
||||
return sum(roi.integrateHorizontally(False))
|
||||
|
||||
|
||||
|
||||
class ImageRoi(ReadonlyRegisterBase):
|
||||
def __init__(self, name, source, x,y, w, h):
|
||||
ReadonlyRegisterBase.__init__(self, name)
|
||||
self.source=source
|
||||
self.roi = x,y, w, h
|
||||
|
||||
def doRead(self):
|
||||
x,y, w, h = self.roi
|
||||
return integrate_roi(self.source, x,y, w, h)
|
||||
|
||||
run("sim/utils")
|
||||
|
||||
|
||||
det.start()
|
||||
add_device(ImageRoi("Region1", image, 10, 50, 20, 10), True)
|
||||
add_device(ImageRoi("Region2", image, 10, 50, 30, 15), True)
|
||||
add_device(RoiIntensity("Region1", image, 10, 50, 20, 10), True)
|
||||
add_device(RoiIntensity("Region2", image, 10, 50, 30, 15), True)
|
||||
|
||||
|
||||
import ch.psi.pshell.data.ProviderCSV as ProviderCSV
|
||||
@@ -34,3 +13,17 @@ tscan((Region1, Region2), 10, 0.1, layout="table", provider = "csv")
|
||||
print integrate_roi(image, 10, 50, 20, 10)
|
||||
|
||||
#save_image(resized, get_context().setup.expandPath("{images}/out.tif") ,"tiff")
|
||||
|
||||
|
||||
|
||||
|
||||
ret = grab_frames(image, 10, sleep=0.1)
|
||||
av = average_ips(ret, None, True)
|
||||
print type(av.getProcessor())
|
||||
#db=av.getBufferedImage().getData().getDataBuffer()
|
||||
data = get_image_array(av)
|
||||
plot(data)
|
||||
|
||||
save_image(av, "{images}/float.tif","tiff")
|
||||
av = average_ips(ret, None, False)
|
||||
save_image(av, "{images}/int.tif","tiff")
|
||||
|
||||
@@ -74,7 +74,7 @@ def integrate_frames(source, samples=1, roi=None, wait_next=False, sleep=0, as_f
|
||||
# Image manipulation
|
||||
###############################################################################
|
||||
|
||||
def get_image_array(ip):
|
||||
def get_ip_array(ip):
|
||||
if type(ip.getProcessor()) == ij.process.FloatProcessor:
|
||||
return ip.getProcessor().getFloatArray()
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user