Jun 2024
This commit is contained in:
35
script/test/test_append_tiff2.py
Normal file
35
script/test/test_append_tiff2.py
Normal file
@@ -0,0 +1,35 @@
|
||||
from ijutils import *
|
||||
|
||||
def get_file(index):
|
||||
scan = "/Users/gobbo_a/dev/pshell/config/home/data/2024_03/20240319/20240319_105604_TeztTiff/scan 1/"
|
||||
return scan + ("det image_%04d.tiff" % (index))
|
||||
|
||||
imgs_per_row=2
|
||||
imgs_per_col=2
|
||||
|
||||
images = []
|
||||
for i in range(4):
|
||||
filename = get_file(i)
|
||||
images.append(ImagePlus(filename))
|
||||
|
||||
proc=images[0].getProcessor()
|
||||
combined_image = ImagePlus("Combined Image", proc.createProcessor(proc.getWidth()*imgs_per_row, imgs_per_col * proc.getHeight()))
|
||||
|
||||
p=None
|
||||
for i in range(len(images)):
|
||||
proc = images[i].getProcessor()
|
||||
x,y = i%imgs_per_row, i/imgs_per_row
|
||||
combined_image.getProcessor().insert(proc, x * proc.getWidth(), y * proc.getHeight())
|
||||
|
||||
data = Convert.transpose(get_ip_array(combined_image))
|
||||
if p is None:
|
||||
p=plot(data, title="Combined")[0]
|
||||
else:
|
||||
p.getSeries(0).setData(data)
|
||||
time.sleep(1.0)
|
||||
|
||||
#plot(Convert.transpose(get_ip_array(combined_image)))
|
||||
#save_image(combined_image, get_file(6), "tiff")
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user