2019-07-17 16:56:05 +02:00
|
|
|
"""This script is supposed to be launched from fiji's jython interpreter
|
|
|
|
"""
|
|
|
|
# # note: fiji's jython doesn't support encoding keyword
|
|
|
|
|
|
|
|
#https://imagej.net/Scripting_Headless
|
2019-07-17 19:11:14 +02:00
|
|
|
#@String lipase_src_root_path
|
2019-07-17 16:56:05 +02:00
|
|
|
#@String raw_images_root_path
|
|
|
|
|
|
|
|
# String(label="Please enter your name",description="Name field") name
|
|
|
|
# OUTPUT String greeting
|
|
|
|
import sys
|
|
|
|
print('python version %s' % sys.version) # prints python version
|
|
|
|
|
2019-07-17 19:11:14 +02:00
|
|
|
sys.path.append(lipase_src_root_path) # necessary if run from fiji as script otherwise jython fails to find lipase's modules such as catalog
|
2019-07-17 16:56:05 +02:00
|
|
|
|
|
|
|
from ij import IJ
|
|
|
|
from lipase import Lipase, ImageLogger
|
|
|
|
from catalog import ImageCatalog
|
|
|
|
|
|
|
|
def run_script():
|
|
|
|
catalog = ImageCatalog(raw_images_root_path) # eg '/Users/graffy/ownCloud/ipr/lipase/raw-images'
|
|
|
|
lipase = Lipase(catalog, debugger=ImageLogger())
|
|
|
|
sequence = catalog.sequences['res_soleil2018/GGH/GGH_2018_cin2_phiG_I_327_vis_-40_1/Pos2']
|
|
|
|
white_estimate = lipase.estimate_white(sequence, 'DM300_327-353_fluo')
|
|
|
|
print(white_estimate)
|
|
|
|
IJ.saveAsTiff(white_estimate, './white_estimate.tiff')
|
|
|
|
print('end')
|
|
|
|
|
|
|
|
# note : when launched from fiji, __name__ doesn't have the value "__main__", as when launched from python
|
|
|
|
run_script()
|