bm_experiments.bm_RVSS module¶
Benchmark for ImageJ plugin - RVSS
Installation¶
Enter the application folder in this project:
cd <BIRL>/applications
Download Fiji - https://fiji.sc/
wget https://downloads.imagej.net/fiji/latest/fiji-linux64.zip
Extract the downloaded application:
unzip fiji-linux64.zip
Try to run Fiji:
Fiji.app/ImageJ-linux64
Usage¶
Run the basic RVSS registration with original parameters:
python bm_experiments/bm_RVSS.py -t ./data_images/pairs-imgs-lnds_histol.csv -d ./data_images -o ./results -Fiji ~/Applications/Fiji.app/ImageJ-linux64 -cfg ./configs/ImageJ_RVSS_histol.yaml --visual --unique
Note
tested for version ImageJ 1.52i & 2.35
Copyright (C) 2017-2019 Jiri Borovec <jiri.borovec@fel.cvut.cz>
-
class
bm_experiments.bm_RVSS.
BmRVSS
(params)[source]¶ Bases:
birl.benchmark.ImRegBenchmark
Benchmark for ImageJ plugin - RVSS no run test while this method requires manual installation of ImageJ
For the app installation details, see module details.
Example
>>> 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_RVSS_histol.yaml')} >>> benchmark = BmRVSS(params) >>> benchmark.run() # doctest: +SKIP >>> del benchmark >>> shutil.rmtree(path_out, ignore_errors=True)
initialise benchmark
Parameters: params (dict) – parameters -
_clear_after_registration
(item)[source]¶ clean unnecessarily files after the registration
Parameters: item (dict) – dictionary with regist. information Return dict: the same or updated regist. info
-
_extract_warped_image_landmarks
(item)[source]¶ get registration results - warped registered images and landmarks
Parameters: item (dict) – dictionary with registration params Return dict: paths to warped images/landmarks
-
_generate_regist_command
(item)[source]¶ generate the registration command(s)
Parameters: item (dict) – dictionary with registration params Return str|list(str): the execution commands
-
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 %(dir_input)s/ %(dir_output)s/ %(dir_output)s/ %(ref_name)s %(params)s'[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)s %(warp)s'[source]¶ command for executing the warping image and landmarks
-
DEFAULT_PARAMS
= {'RVSS': {'featuresModelIndex': 1, 'registrationModelIndex': 3, 'shrinkingConstraint': 1}, 'SIFT': {'fdBins': 8, 'fdSize': 8, 'initialSigma': 1.6, 'maxEpsilon': 25, 'maxOctaveSize': 1024, 'minInlierRatio': 0.05, 'minOctaveSize': 64, 'modelIndex': 1, 'rod': 0.92, 'steps': 3}}[source]¶ default RVSS parameters
-
DIR_OUTPUTS
= 'output'[source]¶ internal folder name for registration results - images and transformations
-
PATH_SCRIPT_REGISTRATION
= '/home/docs/checkouts/readthedocs.org/user_builds/birl/checkouts/v0.2.4/scripts/ImageJ/apply-RVSS-registration.bsh'[source]¶ path/name of image registration script
-
PATH_SCRIPT_WARP_LANDMARKS
= '/home/docs/checkouts/readthedocs.org/user_builds/birl/checkouts/v0.2.4/scripts/ImageJ/apply-RVSS-transform.bsh'[source]¶ path/name of image/landmarks warping script
-