Closedown
This commit is contained in:
@@ -1,2 +1,2 @@
|
|||||||
#Thu Oct 31 09:49:25 CET 2019
|
#Thu Oct 31 10:08:08 CET 2019
|
||||||
FileSequentialNumber=73
|
FileSequentialNumber=74
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
import ij
|
|
||||||
from ij.io import Opener
|
|
||||||
from ijutils import *
|
from ijutils import *
|
||||||
from ch.psi.pshell.imaging.Overlays import *
|
from ch.psi.pshell.imaging.Overlays import *
|
||||||
from ch.psi.pshell.imaging.Utils import *
|
from ch.psi.pshell.imaging.Utils import *
|
||||||
@@ -34,20 +32,6 @@ class RoiIntensity(ReadonlyRegisterBase):
|
|||||||
# Frame integration
|
# Frame integration
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
def integrate_ips(ips, as_float=True):
|
|
||||||
aux = None
|
|
||||||
for i in range(len(ips)):
|
|
||||||
if i==0:
|
|
||||||
img_type = "float" if as_float else "short"
|
|
||||||
aux = new_image(ips[i].width, ips[i].height, image_type=img_type, title = "sum", fill_color = None)
|
|
||||||
op_image(aux, ips[i], "add", float_result=as_float, in_place=True)
|
|
||||||
return aux
|
|
||||||
|
|
||||||
def average_ips (ips, roi=None, as_float=True):
|
|
||||||
aux = integrate_ips(ips, as_float)
|
|
||||||
op_const(aux, "divide", float(len(ips)), in_place=True)
|
|
||||||
return aux
|
|
||||||
|
|
||||||
def get_image(source, roi=None, wait_next=False):
|
def get_image(source, roi=None, wait_next=False):
|
||||||
if wait_next:
|
if wait_next:
|
||||||
source.waitNext(-1)
|
source.waitNext(-1)
|
||||||
@@ -70,21 +54,3 @@ def integrate_frames(source, samples=1, roi=None, wait_next=False, sleep=0, as_f
|
|||||||
return integrate_ips(grab_frames(source, samples, roi, wait_next, sleep), as_float)
|
return integrate_ips(grab_frames(source, samples, roi, wait_next, sleep), as_float)
|
||||||
|
|
||||||
|
|
||||||
###############################################################################
|
|
||||||
# Image manipulation
|
|
||||||
###############################################################################
|
|
||||||
|
|
||||||
def get_ip_array(ip):
|
|
||||||
if type(ip.getProcessor()) == ij.process.FloatProcessor:
|
|
||||||
return ip.getProcessor().getFloatArray()
|
|
||||||
else:
|
|
||||||
return ip.getProcessor().getIntArray()
|
|
||||||
|
|
||||||
def open_image(file_name):
|
|
||||||
file_name = get_context().setup.expandPath(file_name)
|
|
||||||
#return Opener().openTiff(file_name, 1)
|
|
||||||
return Opener().openImage(file_name)
|
|
||||||
|
|
||||||
#Save TIFF from
|
|
||||||
#save_image(av, "{images}/float.tif","tiff")
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user