bm_experiments.bm_bUnwarpJ module

Benchmark for ImageJ plugin - bUnwarpJ


  1. Enter the application folder in this project:

    cd <BIRL>/applications
  2. Download Fiji -

  3. Extract the downloaded application:

  4. Try to run Fiji:


Run the basic bUnwarpJ registration with original parameters:

python bm_experiments/         -t ./data-images/pairs-imgs-lnds_histol.csv         -d ./data-images         -o ./results         -Fiji $HOME/Applications/         -cfg ./configs/ImageJ_bUnwarpJ_histol.yaml         --visual --unique

The bUnwarpJ is supporting SIFT and MOPS feature extraction as landmarks see:

python bm_experiments/         -t ./data-images/pairs-imgs-lnds_histol.csv         -d ./data-images         -o ./results         -Fiji $HOME/Applications/         -cfg ./configs/ImageJ_bUnwarpJ-SIFT_histol.yaml         --visual --unique


tested for version ImageJ 1.52i & 2.35

Copyright (C) 2017-2019 Jiri Borovec <>

class bm_experiments.bm_bUnwarpJ.BmUnwarpJ(params)[source]

Bases: birl.benchmark.ImRegBenchmark

Benchmark for ImageJ plugin - bUnwarpJ no run test while this method requires manual installation of ImageJ

For the app installation details, see module details.


>>> from birl.utilities.data_io import create_folder, update_path
>>> path_out = create_folder('temp_results')
>>> fn_path_conf = lambda n: os.path.join(update_path('configs'), n)
>>> path_csv = os.path.join(update_path('data-images'), 'pairs-imgs-lnds_mix.csv')
>>> params = {'path_table': path_csv,
...           'path_out': path_out,
...           'exec_Fiji': 'ImageJ-linux64',
...           'nb_workers': 2,
...           'unique': False,
...           'path_config': fn_path_conf('ImageJ_bUnwarpJ_histol.yaml')}
>>> benchmark = BmUnwarpJ(params)
>>> params['path_config'] = fn_path_conf('ImageJ_bUnwarpJ-SIFT_histol.yaml')
>>> benchmark = BmUnwarpJ(params)
>>> shutil.rmtree(path_out, ignore_errors=True)

initialise benchmark


params (dict) – parameters


get registration results - warped registered images and landmarks


item (dict) – dictionary with registration params

Return dict

paths to warped images/landmarks


generate the registration command(s)


item (dict) – dictionary with registration params

Return str|list(str)

the execution commands


prepare Benchmark - copy configurations

static extend_parse(arg_parser)[source]

extent the basic arg parses by some extra required parameters

Return object

COMMAND_REGISTRATION = '%(exec_Fiji)s --headless %(path_bsh)s %(source)s %(target)s %(params)s %(output)s/transform-direct.txt %(output)s/transform-inverse.txt'[source]

command for executing the image registration

COMMAND_WARP_LANDMARKS = '%(exec_Fiji)s --headless %(path_bsh)s %(source)s %(target)s %(output)s/source_landmarks.pts %(output)s/warped_source_landmarks.pts %(transf-inv)s %(transf-dir)s %(warp)s'[source]

command for executing the warping image and landmarks

DEFAULT_PARAMS = {'SIFT': {'fdBins': 8, 'fdSize': 8, 'initialSigma': 1.6, 'maxEpsilon': 25, 'maxOctaveSize': 1024, 'minInlierRatio': 0.05, 'minOctaveSize': 64, 'modelIndex': 1, 'rod': 0.92, 'steps': 3}, 'bUnwarpJ': {'consistencyWeight': 10.0, 'curlWeight': 0.1, 'divWeight': 0.1, 'imageWeight': 1.0, 'landmarkWeight': 0.0, 'maxScale': 3, 'minScale': 0, 'mode': 1, 'stopThreshold': 0.01, 'subsampleFactor': 0}}[source]

default bUnwarpJ and SIFT parameters

NAME_LANDMARKS = 'source_landmarks.pts'[source]

internal name of converted landmarks for tranf. script

NAME_LANDMARKS_WARPED = 'warped_source_landmarks.pts'[source]

name of warped moving landmarks by tranf. script

NAME_TRANSF_DIRECT = 'transform-direct.txt'[source]

resulting direct transformation

NAME_TRANSF_INVERSE = 'transform-inverse.txt'[source]

resulting inverse transformation

PATH_IJ_SCRIPTS = '/home/docs/checkouts/'[source]

path to IJ scripts

PATH_SCRIPT_REGISTRATION_BASE = '/home/docs/checkouts/'[source]

path/name of image registration script

PATH_SCRIPT_REGISTRATION_SIFT = '/home/docs/checkouts/'[source]

path/name of image registration script with features

PATH_SCRIPT_WARP_LANDMARKS = '/home/docs/checkouts/'[source]

path/name of image/landmarks warping script

REQUIRED_PARAMS = ['path_out', 'path_table', 'exec_Fiji', 'path_config'][source]

required experiment parameters

REQUIRED_PARAMS_BUNWARPJ = ('mode', 'subsampleFactor', 'minScale', 'maxScale', 'divWeight', 'curlWeight', 'landmarkWeight', 'imageWeight', 'consistencyWeight', 'stopThreshold')[source]

required parameters in the configuration file for bUnwarpJ

REQUIRED_PARAMS_SIFT = ('initialSigma', 'steps', 'minOctaveSize', 'maxOctaveSize', 'fdSize', 'fdBins', 'rod', 'maxEpsilon', 'minInlierRatio', 'modelIndex')[source]

required parameters in the configuration file for SIFT features