Esempio n. 1
0
arguments = docopt(__doc__, version='NER 0.1')

input_dir = arguments['INPUT']
output_dir = arguments['OUTPUT']
filter_window = float(arguments['--filter-window']) if arguments['--filter-window'] else 5.0
gamma = float(arguments['--gamma']) if arguments['--gamma'] else 0.50
channel = int(arguments['--channel']) if arguments['--channel'] else 1
objective = int(arguments['--objective']) if arguments['--objective'] else 20
microscope = arguments['--microscope'] if arguments['--microscope'] else "SD"
pixel_size = float(arguments['--pixel-size']) if arguments['--pixel-size'] else None
rolling_ball_size = int(arguments['--rolling-ball-size']) if arguments['--pixel-size'] else 30

channel_splitter = ChannelSplitter()
contrast_enhancer = ContrastEnhancer()
contrast_enhancer.setNormalize(True)

if pixel_size is None:
  if objective == 20 and microscope == "SD":
    pixel_size = 0.5089
  else:
    pixel_size = 1.0

files = glob.glob(input_dir + "*.tif")
files.sort()

frame_i = 1
for file in files:
  print("Processing frame \033[1m" + str(frame_i) + "\033[0m")
  frame = IJ.openImage(file) # ImagePlus