fijibin API reference

main module: fijibin

Latest Life-Line version of fiji for easy inclusion in Python projects.

fijibin.fetch(force=False)[source]

Fetch and extract latest Life-Line version of Fiji is just ImageJ to ~/.bin.

Parameters:force (bool) – Force overwrite of existing Fiji in ~/.bin.

submodule: fijibin.macro

Run Fiji is just ImageJ macros headless with python.

fijibin.macro.run(macro, output_files=[], force_close=True)[source]

Runs Fiji with the suplied macro. Output of Fiji can be viewed by setting environment variable DEBUG=fijibin.

Parameters:
  • macro (string or list of strings) – IJM-macro(s) to run. If list of strings, it will be joined with a space, so all statements should end with ;.
  • output_files (list) – Files to check if exists after macro has been run. Files specified that do not exist after macro is done will print a warning message.
  • force_close (bool) –

    Will add eval("script", "System.exit(42);"); to end of macro. Exit code 42 is used to overcome that errors in macro efficiently will exit Fiji with error code 0. In other words, if this line in the macro is reached, the macro has most probably finished without errors. This is the default behaviour.

    One should also note that Fiji doesn’t terminate right away if System.exit() is left out, and it may take several minutes for Fiji to close.

Returns:

Files from output_files which exists after running macro.

Return type:

int

fijibin.macro.stitch(folder, filenames, x_size, y_size, output_filename, x_start=0, y_start=0, overlap=10)[source]

Creates a Fiji Grid/Collection stitching macro. Parameters are the same as in the plugin and are described in further detail here: http://fiji.sc/Image_Stitching#Grid.2FCollection_Stitching.

Default stitch parameters:

  • Filename defined positions
  • Compute overlap
  • Subpixel accurancy
  • Save computation time (but use more RAM)
  • Fusion method: Linear blending
  • Regression threshold: 0.30
  • Max/avg displacement threshold: 2.50
  • Absolute displacement threshold: 3.50
Parameters:
  • folder (string) – Path to folder with images or folders with images. Example: /path/to/slide–S00/chamber–U01–V02/
  • filenames (string) – Filenames of images. Example: field-X{xx}-Y{yy}/image-X{xx}-Y{yy}.ome.tif
  • x_size (int) – Size of grid, number of images in x direction.
  • y_size (int) – Size of grid, number of images in y direction.
  • output_filename (string) – Where to store fused image. Should be .png.
  • x_start (int) – Which x position grid start with.
  • y_start (int) – Which y position grid start with.
  • overlap (number) – Tile overlap in percent. Fiji will find the optimal overlap, but a precise overlap assumption will decrase computation time.
Returns:

IJM-macro.

Return type:

string