lipase/tests/test0001.py

30 lines
1.2 KiB
Python
Raw Normal View History

"""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
#@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
sys.path.append('/Users/graffy/ownCloud/ipr/lipase/lipase.git') # necessary if run from fiji as script otherwise jython fails to find lipase's modules such as catalog
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()