34 lines
1.4 KiB
Python
34 lines
1.4 KiB
Python
"""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 lipase_src_root_path
|
|
#@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(lipase_src_root_path) # 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
|
|
from preprocessing import WhiteEstimator
|
|
|
|
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_estimator = WhiteEstimator(open_size=75, close_size=75, average_size=75)
|
|
white_estimator = WhiteEstimator(open_size=3, close_size=3, average_size=3)
|
|
white_estimate = white_estimator.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()
|