diff --git a/.travis.yml b/.travis.yml index 5860ff62..fb57417a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -91,10 +91,10 @@ script: # sample run - mkdir results && touch configs/sample_config.yaml - python bm_experiments/bm_comp_perform.py -o ./results -n 1 - - python birl/bm_template.py -t ./data_images/pairs-imgs-lnds_mix.csv -o ./results --visual --unique -cfg configs/sample_config.yaml - - rm ./data_images/*_/*/*_HE.csv # remove target landmarks from histol. tissue - - python birl/bm_template.py -n anhir -t ./data_images/pairs-imgs-lnds_histol.csv -d ./data_images -o ./results --preprocessing matching-rgb gray -cfg configs/sample_config.yaml - - python bm_experiments/evaluate_experiment.py -d ./data_images -e ./results/BmTemplate_anhir --visual + - python birl/bm_template.py -t ./data-images/pairs-imgs-lnds_mix.csv -o ./results --visual --unique -cfg configs/sample_config.yaml + - rm ./data-images/*_/*/*_HE.csv # remove target landmarks from histol. tissue + - python birl/bm_template.py -n anhir -t ./data-images/pairs-imgs-lnds_histol.csv -d ./data-images -o ./results --preprocessing matching-rgb gray -cfg configs/sample_config.yaml + - python bm_experiments/evaluate_experiment.py -d ./data-images -e ./results/BmTemplate_anhir --visual after_success: - coverage report diff --git a/MANIFEST.in b/MANIFEST.in index 018e3bb6..bcfb1ed6 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -11,7 +11,7 @@ include *.md include LICENSE # Include the visualisations -recursive-include figures *.jpg +recursive-include assets *.jpg # Include the util scripts and experiments recursive-include bm_dataset *.py @@ -27,7 +27,7 @@ recursive-exclude notebooks *.ipynb *.txt exclude notebooks # Include the data files -recursive-include data_images * +recursive-include data-images * # Include the method config files recursive-include configs * diff --git a/README.md b/README.md index 80fc7152..19ca9016 100644 --- a/README.md +++ b/README.md @@ -32,9 +32,9 @@ For evaluation, we have manually placed landmarks in each image pair. There are We do not put any landmarks in the background. For more information about annotation creation and landmarks handling, we refer to the special repository - [Dataset: histology landmarks](http://borda.github.com/dataset-histology-landmarks). -![images-landmarks](docs/source/_figures/images-landmarks.jpg) +![images-landmarks](assets/images-landmarks.jpg) -The dataset is defined by a CSV file containing paths to target and sensed image and their related landmarks _(see `./data_images/pairs-imgs-lnds_mix.csv`)_. With the change of the cover table, the benchmarks can be used for any other image dataset. +The dataset is defined by a CSV file containing paths to target and sensed image and their related landmarks _(see `./data-images/pairs-imgs-lnds_mix.csv`)_. With the change of the cover table, the benchmarks can be used for any other image dataset. ## Features @@ -61,7 +61,7 @@ The project contains the following folders: * `bm_dataset` - package handling dataset creation and servicing * `bm_experiments` - package with particular benchmark experiments * `configs` - configs for registration methods -* `data_images` - folder with input sample data +* `data-images` - folder with input sample data * `images` - sample image pairs (reference and sensed one) * `landmarks` - related landmarks to images in previous folder * `lesions_` - samples of histology tissue with annotation @@ -90,8 +90,8 @@ where the numbers match desired version ## Before benchmarks (pre-processing) -In the `data_images` folder we provide some sample images with landmarks for registration. -These sample registration pairs are saved in `data_images/pairs-imgs-lnds_mix.csv`. +In the `data-images` folder we provide some sample images with landmarks for registration. +These sample registration pairs are saved in `data-images/pairs-imgs-lnds_mix.csv`. You can create your own costume cover table for a given dataset (folder with images and landmarks) by hand or use script `bm_dataset/create_registration_pairs.py` assuming the same folder structure `///` as for the [CIMA dataset](http://cmp.felk.cvut.cz/~borovji3/?page=dataset). ### Prepare synthetic data @@ -102,8 +102,8 @@ The script will generate a set of geometrically deformed images mimicking differ ```bash python bm_dataset/create_real_synth_dataset.py \ - -i ./data_images/images/Rat_Kidney_HE.jpg \ - -l ./data_images/landmarks/Rat_Kidney_HE.csv \ + -i ./data-images/images/Rat_Kidney_HE.jpg \ + -l ./data-images/landmarks/Rat_Kidney_HE.csv \ -o ./output/synth_dataset \ -nb 5 --nb_workers 3 --visual ``` @@ -116,9 +116,9 @@ _(note A-B is the same as B-A)_ ```bash python bm_dataset/generate_regist_pairs.py \ - -i ./data_images/synth_dataset/*.jpg \ - -l ./data_images/synth_dataset/*.csv \ - -csv ./data_images/cover_synth-dataset.csv \ + -i ./data-images/synth_dataset/*.jpg \ + -l ./data-images/synth_dataset/*.csv \ + -csv ./data-images/cover_synth-dataset.csv \ --mode each2all ``` @@ -127,7 +127,7 @@ python bm_dataset/generate_regist_pairs.py \ We offer a script for scaling images in to particular scales for example ```bash python bm_dataset/rescale_tissue_images.py \ - -i "./data_images/rat-kidney_/scale-5pc/*.jpg" \ + -i "./data-images/rat-kidney_/scale-5pc/*.jpg" \ -scales 10 -ext .png --nb_workers 2 ``` @@ -135,7 +135,7 @@ We introduce an option how to randomly take only a subset (use `nb_selected`) of ```bash python bm_dataset/rescale_tissue_landmarks.py \ - -a ./data_images -d ./output \ + -a ./data-images -d ./output \ --nb_selected 0.5 --nb_total 200 ``` @@ -150,7 +150,7 @@ Moreover we developed two additional script for converting large images, handlin Even though this framework is completely customizable we include several image registration methods commonly used in medical imaging. -![visualise-regist-results](docs/source/_figures/registration_visual_landmarks.jpg) +![visualise-regist-results](assets/registration_visual_landmarks.jpg) ### Install methods and run benchmarks @@ -159,7 +159,7 @@ For each registration method, different experiments can be performed independent Sample execution of the "empty" benchmark template: ```bash python birl/bm_template.py \ - -t ./data_images/pairs-imgs-lnds_mix.csv \ + -t ./data-images/pairs-imgs-lnds_mix.csv \ -o ./results \ -cfg sample_config.yaml \ --preprocessing matching-rgb gray \ @@ -168,8 +168,8 @@ python birl/bm_template.py \ or with relative paths: ```bash python birl/bm_template.py \ - -t ./data_images/pairs-imgs-lnds_histol.csv \ - -d ./data_images \ + -t ./data-images/pairs-imgs-lnds_histol.csv \ + -d ./data-images \ -o ./results \ -cfg sample_config.yaml \ --preprocessing gray matching-rgb @@ -187,7 +187,7 @@ The general Image Registration benchmarks contain couple required and optional p * `--unique` each experiment has creation stamp included in its name (prevent overwriting experiments with the same method) * `--visual` generate a simple visualisation of particular image registrations -![preprocessing-hist-matching](docs/source/_figures/Rat-Kidney_histogram-matching.jpg) +![preprocessing-hist-matching](assets/Rat-Kidney_histogram-matching.jpg) Measure your computer performance using average execution time on several simple image registrations. The registration consists of loading images, denoising, feature detection, transform estimation and image warping. @@ -204,8 +204,8 @@ For each benchmark experiment, the explanation about how to install and use a pa * **[bUnwarpJ](http://imagej.net/BUnwarpJ)** is the [ImageJ](https://imagej.nih.gov/ij/) plugin for elastic registration (optional usage of histogram matching and integration with [Feature Extraction](http://imagej.net/Feature_Extraction)). ```bash python bm_experiments/bm_bUnwarpJ.py \ - -t ./data_images/pairs-imgs-lnds_histol.csv \ - -d ./data_images \ + -t ./data-images/pairs-imgs-lnds_histol.csv \ + -d ./data-images \ -o ./results \ -Fiji ~/Applications/Fiji.app/ImageJ-linux64 \ -cfg ./configs/ImageJ_bUnwarpJ_histol.yaml \ @@ -215,8 +215,8 @@ For each benchmark experiment, the explanation about how to install and use a pa * **[Register Virtual Stack Slices (RVSS)](https://imagej.net/Register_Virtual_Stack_Slices)** is the [ImageJ](https://imagej.nih.gov/ij/) plugin for affine/elastic registration of a sequence of images. ```bash python bm_experiments/bm_RVSS.py \ - -t ./data_images/pairs-imgs-lnds_histol.csv \ - -d ./data_images \ + -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 \ @@ -225,8 +225,8 @@ For each benchmark experiment, the explanation about how to install and use a pa * **[elastix](http://elastix.isi.uu.nl/)** is image registration toolkit based on [ITK](http://www.itk.org/) and it consists of a collection of algorithms that are commonly used to solve (medical) image registration problems. For more details see [documentation](http://elastix.isi.uu.nl/download/elastix_manual_v4.8.pdf). ```bash python bm_experiments/bm_elastix.py \ - -t ./data_images/pairs-imgs-lnds_histol.csv \ - -d ./data_images \ + -t ./data-images/pairs-imgs-lnds_histol.csv \ + -d ./data-images \ -o ./results \ -elastix ~/Applications/elastix/bin \ -cfg ./configs/elastix_affine.txt \ @@ -235,8 +235,8 @@ For each benchmark experiment, the explanation about how to install and use a pa * **[rNiftyReg](https://github.com/jonclayden/RNiftyReg)** is an R-native interface to the [NiftyReg image registration library](http://sourceforge.net/projects/niftyreg/) which contains programs to perform rigid, affine and non-linear registration of Nifty or analyse images. _NiftyReg supports max image size 2048._ ```bash python bm_experiments/bm_rNiftyReg.py \ - -t ./data_images/pairs-imgs-lnds_histol.csv \ - -d ./data_images \ + -t ./data-images/pairs-imgs-lnds_histol.csv \ + -d ./data-images \ -o ./results \ -R Rscript \ -script ./scripts/Rscript/RNiftyReg_linear.r \ @@ -245,8 +245,8 @@ For each benchmark experiment, the explanation about how to install and use a pa * **[Advanced Normalization Tools](http://stnava.github.io/ANTs/) (ANTs)** is a medical imaging framework containing state-of-the-art medical image registration and segmentation methods. ```bash python bm_experiments/bm_ANTs.py \ - -t ./data_images/pairs-imgs-lnds_anhir.csv \ - -d ./data_images \ + -t ./data-images/pairs-imgs-lnds_anhir.csv \ + -d ./data-images \ -o ./results \ -ANTs ~/Applications/antsbin/bin \ -cfg ./configs/ANTs_SyN.txt @@ -254,8 +254,8 @@ For each benchmark experiment, the explanation about how to install and use a pa For illustration see ANTsPy [registration tutorial](https://github.com/ANTsX/ANTsPy/blob/master/tutorials/10minTutorial.ipynb). ```bash python bm_experiments/bm_ANTsPy.py \ - -t ./data_images/pairs-imgs-lnds_histol.csv \ - -d ./data_images \ + -t ./data-images/pairs-imgs-lnds_histol.csv \ + -d ./data-images \ -o ./results \ -py python3 \ -script ./scripts/Python/run_ANTsPy.py \ @@ -264,8 +264,8 @@ For each benchmark experiment, the explanation about how to install and use a pa * **[DROP](https://github.com/biomedia-mira/drop2)** is image registration and motion estimation based on Markov Random Fields. ```bash python bm_experiments/bm_DROP2.py \ - -t ./data_images/pairs-imgs-lnds_histol.csv \ - -d ./data_images \ + -t ./data-images/pairs-imgs-lnds_histol.csv \ + -d ./data-images \ -o ./results \ -DROP ~/Applications/DROP2/dropreg \ -cfg ./configs/DROP2.txt \ diff --git a/appveyor.yml b/appveyor.yml index be8f849b..8df4a472 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -79,7 +79,7 @@ test_script: - tox -v --sitepackages --parallel auto - mkdir results && touch configs/sample_config.yaml - python bm_experiments/bm_comp_perform.py -o ./results -n 1 - - python birl/bm_template.py -n anhir -t ./data_images/pairs-imgs-lnds_mix.csv -o ./results --preprocessing matching-rgb gray --unique --visual -cfg configs/sample_config.yaml + - python birl/bm_template.py -n anhir -t ./data-images/pairs-imgs-lnds_mix.csv -o ./results --preprocessing matching-rgb gray --unique --visual -cfg configs/sample_config.yaml on_success: - coverage report diff --git a/docs/source/_figures/Rat-Kidney_histogram-matching.jpg b/assets/Rat-Kidney_histogram-matching.jpg similarity index 100% rename from docs/source/_figures/Rat-Kidney_histogram-matching.jpg rename to assets/Rat-Kidney_histogram-matching.jpg diff --git a/docs/source/_figures/images-landmarks.jpg b/assets/images-landmarks.jpg similarity index 100% rename from docs/source/_figures/images-landmarks.jpg rename to assets/images-landmarks.jpg diff --git a/docs/source/_figures/registration_visual_landmarks.jpg b/assets/registration_visual_landmarks.jpg similarity index 100% rename from docs/source/_figures/registration_visual_landmarks.jpg rename to assets/registration_visual_landmarks.jpg diff --git a/birl/benchmark.py b/birl/benchmark.py index 04050a8b..36890c83 100644 --- a/birl/benchmark.py +++ b/birl/benchmark.py @@ -8,7 +8,7 @@ mkdir ./results python benchmarks/bm_registration.py \ - -t data_images/pairs-imgs-lnds_histol.csv -d ./data_images \ + -t data-images/pairs-imgs-lnds_histol.csv -d ./data-images \ -o ./results --unique Copyright (C) 2016-2019 Jiri Borovec @@ -77,7 +77,7 @@ class ImRegBenchmark(Experiment): >>> # Running in single thread: >>> from birl.utilities.data_io import create_folder, update_path >>> path_out = create_folder('temp_results') - >>> path_csv = os.path.join(update_path('data_images'), 'pairs-imgs-lnds_mix.csv') + >>> path_csv = os.path.join(update_path('data-images'), 'pairs-imgs-lnds_mix.csv') >>> params = {'path_table': path_csv, ... 'path_out': path_out, ... 'nb_workers': 1, @@ -92,7 +92,7 @@ class ImRegBenchmark(Experiment): >>> # Running in multiple parallel threads: >>> from birl.utilities.data_io import create_folder, update_path >>> path_out = create_folder('temp_results') - >>> path_csv = os.path.join(update_path('data_images'), 'pairs-imgs-lnds_mix.csv') + >>> path_csv = os.path.join(update_path('data-images'), 'pairs-imgs-lnds_mix.csv') >>> params = {'path_table': path_csv, ... 'path_out': path_out, ... 'nb_workers': 2, @@ -938,7 +938,7 @@ def filter_paired_landmarks(item, path_dataset, path_reference, col_source, col_ :param str col_target: column name of landmarks to be compared :return tuple(float,ndarray,ndarray): match ratio, filtered ref and move landmarks - >>> p_data = update_path('data_images') + >>> p_data = update_path('data-images') >>> p_csv = os.path.join(p_data, 'pairs-imgs-lnds_histol.csv') >>> df = pd.read_csv(p_csv) >>> ratio, lnds_ref, lnds_move = filter_paired_landmarks(dict(df.iloc[0]), p_data, p_data, diff --git a/birl/bm_template.py b/birl/bm_template.py index e4b436ba..96e996c4 100644 --- a/birl/bm_template.py +++ b/birl/bm_template.py @@ -11,8 +11,8 @@ mkdir ./results touch sample-config.yaml python birl/bm_template.py \ - -t ./data_images/pairs-imgs-lnds_histol.csv \ - -d ./data_images \ + -t ./data-images/pairs-imgs-lnds_histol.csv \ + -d ./data-images \ -o ./results \ --visual --unique \ -cfg ./sample-config.yaml @@ -57,7 +57,7 @@ class BmTemplate(ImRegBenchmark): >>> # Running in single thread: >>> from birl.utilities.data_io import create_folder, update_path >>> path_out = create_folder('temp_results') - >>> path_csv = os.path.join(update_path('data_images'), 'pairs-imgs-lnds_mix.csv') + >>> path_csv = os.path.join(update_path('data-images'), 'pairs-imgs-lnds_mix.csv') >>> open('sample_config.yaml', 'w').close() >>> BmTemplate.main({ ... 'path_table': path_csv, @@ -75,7 +75,7 @@ class BmTemplate(ImRegBenchmark): >>> # Running in multiple parallel threads: >>> from birl.utilities.data_io import create_folder, update_path >>> path_out = create_folder('temp_results') - >>> path_csv = os.path.join(update_path('data_images'), 'pairs-imgs-lnds_mix.csv') + >>> path_csv = os.path.join(update_path('data-images'), 'pairs-imgs-lnds_mix.csv') >>> params = {'path_table': path_csv, ... 'path_out': path_out, ... 'nb_workers': 2, diff --git a/birl/utilities/data_io.py b/birl/utilities/data_io.py index 0e2e6412..5c676a3c 100644 --- a/birl/utilities/data_io.py +++ b/birl/utilities/data_io.py @@ -365,7 +365,7 @@ def convert_image_to_nifti(path_image, path_out_dir=None): :param str path_out_dir: path to output folder :return str: resulted image - >>> path_img = os.path.join(update_path('data_images'), 'images', + >>> path_img = os.path.join(update_path('data-images'), 'images', ... 'artificial_moving-affine.jpg') >>> path_img2 = convert_image_to_nifti(path_img, '.') >>> path_img2 # doctest: +ELLIPSIS @@ -513,7 +513,7 @@ def convert_image_from_mhd(path_image, path_out_dir=None, img_ext='.png', scalin resulting image will be larger by this factor :return str: path to exported image - >>> path_img = os.path.join(update_path('data_images'), 'images', + >>> path_img = os.path.join(update_path('data-images'), 'images', ... 'artificial_reference.jpg') >>> path_img = convert_image_to_mhd(path_img, scaling=1.5) >>> convert_image_from_mhd(path_img, scaling=1.5) # doctest: +ELLIPSIS @@ -549,7 +549,7 @@ def convert_image_to_mhd(path_image, path_out_dir=None, to_gray=True, overwrite= resulting image will be smaller by this factor :return str: path to exported image - >>> path_img = os.path.join(update_path('data_images'), 'images', + >>> path_img = os.path.join(update_path('data-images'), 'images', ... 'artificial_moving-affine.jpg') >>> convert_image_to_mhd(path_img, scaling=2) # doctest: +ELLIPSIS '...artificial_moving-affine.mhd' diff --git a/birl/utilities/dataset.py b/birl/utilities/dataset.py index aae780b7..c70de1c1 100644 --- a/birl/utilities/dataset.py +++ b/birl/utilities/dataset.py @@ -591,7 +591,7 @@ def list_sub_folders(path_folder, name='*'): :return list(str): folders >>> from birl.utilities.data_io import update_path - >>> paths = list_sub_folders(update_path('data_images')) + >>> paths = list_sub_folders(update_path('data-images')) >>> list(map(os.path.basename, paths)) # doctest: +ELLIPSIS ['images', 'landmarks', 'lesions_', 'rat-kidney_'...] """ @@ -792,7 +792,7 @@ def image_histogram_matching(source, reference, use_color='hsv', norm_img_size=4 :return ndarray: transformed image >>> from birl.utilities.data_io import update_path, load_image - >>> path_imgs = os.path.join(update_path('data_images'), 'rat-kidney_', 'scale-5pc') + >>> path_imgs = os.path.join(update_path('data-images'), 'rat-kidney_', 'scale-5pc') >>> img1 = load_image(os.path.join(path_imgs, 'Rat-Kidney_HE.jpg')) >>> img2 = load_image(os.path.join(path_imgs, 'Rat-Kidney_PanCytokeratin.jpg')) >>> image_histogram_matching(img1, img2).shape == img1.shape diff --git a/bm_ANHIR/evaluate_submission.py b/bm_ANHIR/evaluate_submission.py index 5b3d3164..0bb4bb40 100644 --- a/bm_ANHIR/evaluate_submission.py +++ b/bm_ANHIR/evaluate_submission.py @@ -22,9 +22,9 @@ python evaluate_submission.py \ -e ./results/BmUnwarpJ \ - -t ./data_images/pairs-imgs-lnds_histol.csv \ - -d ./data_images \ - -r ./data_images \ + -t ./data-images/pairs-imgs-lnds_histol.csv \ + -d ./data-images \ + -r ./data-images \ -p ./bm_experiments/computer-performances_cmpgrid-71.json \ -o ./output \ --min_landmarks 0.20 diff --git a/bm_dataset/create_real_synth_dataset.py b/bm_dataset/create_real_synth_dataset.py index da12525b..f5c0eca6 100644 --- a/bm_dataset/create_real_synth_dataset.py +++ b/bm_dataset/create_real_synth_dataset.py @@ -6,8 +6,8 @@ Sample run:: python create_real_synth_dataset.py \ - -i ../data_images/images/Rat-Kidney_HE.jpg \ - -l ../data_images/landmarks/Rat-Kidney_HE.csv \ + -i ../data-images/images/Rat-Kidney_HE.jpg \ + -l ../data-images/landmarks/Rat-Kidney_HE.csv \ -o ../output/synth_dataset --visual Copyright (C) 2016-2019 Jiri Borovec diff --git a/bm_dataset/rescale_tissue_landmarks.py b/bm_dataset/rescale_tissue_landmarks.py index f3694c0c..6b099b3f 100644 --- a/bm_dataset/rescale_tissue_landmarks.py +++ b/bm_dataset/rescale_tissue_landmarks.py @@ -9,7 +9,7 @@ Sample usage:: - python rescale_tissue_landmarks.py -a data_images -d results + python rescale_tissue_landmarks.py -a data-images -d results python bm_dataset/rescale_tissue_landmarks.py \ -a /datagrid/Medical/dataset_ANHIR/landmarks_all \ diff --git a/bm_experiments/bm_ANTs.py b/bm_experiments/bm_ANTs.py index 82d5fe12..6289bfed 100644 --- a/bm_experiments/bm_ANTs.py +++ b/bm_experiments/bm_ANTs.py @@ -61,8 +61,8 @@ Run the basic ANT registration with original parameters:: python bm_experiments/bm_ANTs.py \ - -t ./data_images/pairs-imgs-lnds_anhir.csv \ - -d ./data_images \ + -t ./data-images/pairs-imgs-lnds_anhir.csv \ + -d ./data-images \ -o ./results \ --path_ANTs ~/Applications/antsbin/bin \ --path_config ./configs/ANTs_SyN.txt @@ -99,7 +99,7 @@ class BmANTs(ImRegBenchmark): >>> 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') + >>> path_csv = os.path.join(update_path('data-images'), 'pairs-imgs-lnds_mix.csv') >>> params = {'path_table': path_csv, ... 'path_out': path_out, ... 'nb_workers': 2, diff --git a/bm_experiments/bm_ANTsPy.py b/bm_experiments/bm_ANTsPy.py index efe82fce..020eaf2d 100644 --- a/bm_experiments/bm_ANTsPy.py +++ b/bm_experiments/bm_ANTsPy.py @@ -19,8 +19,8 @@ Run the basic ANTs registration with original parameters:: python bm_experiments/bm_ANTsPy.py \ - -t ./data_images/pairs-imgs-lnds_histol.csv \ - -d ./data_images \ + -t ./data-images/pairs-imgs-lnds_histol.csv \ + -d ./data-images \ -o ./results \ -py python3 \ -script ./scripts/Python/run_ANTsPy.py @@ -53,7 +53,7 @@ class BmANTsPy(ImRegBenchmark): >>> 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') + >>> path_csv = os.path.join(update_path('data-images'), 'pairs-imgs-lnds_mix.csv') >>> params = {'path_table': path_csv, ... 'path_out': path_out, ... 'nb_workers': 2, diff --git a/bm_experiments/bm_DROP.py b/bm_experiments/bm_DROP.py index 8b9c5523..864d4c0a 100644 --- a/bm_experiments/bm_DROP.py +++ b/bm_experiments/bm_DROP.py @@ -32,8 +32,8 @@ mkdir ./results python bm_experiments/bm_DROP.py \ - -t ./data_images/pairs-imgs-lnds_histol.csv \ - -d ./data_images \ + -t ./data-images/pairs-imgs-lnds_histol.csv \ + -d ./data-images \ -o ./results \ -DROP ~/Applications/DROP/dropreg2d \ --path_config ./configs/DROP.txt \ @@ -87,7 +87,7 @@ class BmDROP(ImRegBenchmark): ------- >>> from birl.utilities.data_io import create_folder, update_path >>> path_out = create_folder('temp_results') - >>> path_csv = os.path.join(update_path('data_images'), 'pairs-imgs-lnds_mix.csv') + >>> path_csv = os.path.join(update_path('data-images'), 'pairs-imgs-lnds_mix.csv') >>> params = {'path_table': path_csv, ... 'path_out': path_out, ... 'nb_workers': 2, diff --git a/bm_experiments/bm_DROP2.py b/bm_experiments/bm_DROP2.py index e2e05ac1..6b9ea934 100644 --- a/bm_experiments/bm_DROP2.py +++ b/bm_experiments/bm_DROP2.py @@ -35,8 +35,8 @@ mkdir ./results python bm_experiments/bm_DROP2.py \ - -t ./data_images/pairs-imgs-lnds_histol.csv \ - -d ./data_images \ + -t ./data-images/pairs-imgs-lnds_histol.csv \ + -d ./data-images \ -o ./results \ -DROP ~/Applications/DROP2/dropreg \ --path_config ./configs/DROP2.txt \ @@ -71,7 +71,7 @@ class BmDROP2(BmDROP): ------- >>> from birl.utilities.data_io import create_folder, update_path >>> path_out = create_folder('temp_results') - >>> path_csv = os.path.join(update_path('data_images'), 'pairs-imgs-lnds_mix.csv') + >>> path_csv = os.path.join(update_path('data-images'), 'pairs-imgs-lnds_mix.csv') >>> params = {'path_table': path_csv, ... 'path_out': path_out, ... 'nb_workers': 2, diff --git a/bm_experiments/bm_RVSS.py b/bm_experiments/bm_RVSS.py index 72247108..ce2bfe29 100644 --- a/bm_experiments/bm_RVSS.py +++ b/bm_experiments/bm_RVSS.py @@ -26,8 +26,8 @@ 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 \ + -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 \ @@ -62,7 +62,7 @@ class BmRVSS(ImRegBenchmark): >>> 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') + >>> 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', diff --git a/bm_experiments/bm_bUnwarpJ.py b/bm_experiments/bm_bUnwarpJ.py index b86cdbd6..70d9e6f3 100644 --- a/bm_experiments/bm_bUnwarpJ.py +++ b/bm_experiments/bm_bUnwarpJ.py @@ -26,8 +26,8 @@ Run the basic bUnwarpJ registration with original parameters:: python bm_experiments/bm_bUnwarpJ.py \ - -t ./data_images/pairs-imgs-lnds_histol.csv \ - -d ./data_images \ + -t ./data-images/pairs-imgs-lnds_histol.csv \ + -d ./data-images \ -o ./results \ -Fiji ~/Applications/Fiji.app/ImageJ-linux64 \ -cfg ./configs/ImageJ_bUnwarpJ_histol.yaml \ @@ -37,8 +37,8 @@ see: http://imagej.net/BUnwarpJ#SIFT_and_MOPS_plugin_support :: python bm_experiments/bm_bUnwarpJ.py \ - -t ./data_images/pairs-imgs-lnds_histol.csv \ - -d ./data_images \ + -t ./data-images/pairs-imgs-lnds_histol.csv \ + -d ./data-images \ -o ./results \ -Fiji ~/Applications/Fiji.app/ImageJ-linux64 \ -cfg ./configs/ImageJ_bUnwarpJ-SIFT_histol.yaml \ @@ -72,7 +72,7 @@ class BmUnwarpJ(ImRegBenchmark): >>> 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') + >>> 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', diff --git a/bm_experiments/bm_elastix.py b/bm_experiments/bm_elastix.py index 72eb4e15..c4178e19 100644 --- a/bm_experiments/bm_elastix.py +++ b/bm_experiments/bm_elastix.py @@ -21,8 +21,8 @@ 1. Perform sample image registration:: ~/Applications/elastix/bin/elastix \ - -f ./data_images/images/artificial_reference.jpg \ - -m ./data_images/images/artificial_moving-affine.jpg \ + -f ./data-images/images/artificial_reference.jpg \ + -m ./data-images/images/artificial_moving-affine.jpg \ -out ./results/elastix \ -p ./configs/elastix_affine.txt @@ -34,16 +34,16 @@ ~/Applications/elastix/bin/transformix \ -tp ./results/elastix/TransformParameters.0.txt \ -out ./results/elastix \ - -in ./data_images/images/artificial_moving-affine.jpg \ - -def ./data_images/landmarks/artificial_reference.pts + -in ./data-images/images/artificial_moving-affine.jpg \ + -def ./data-images/landmarks/artificial_reference.pts Usage ----- Run the basic ANTs registration with original parameters:: python bm_experiments/bm_elastix.py \ - -t ./data_images/pairs-imgs-lnds_histol.csv \ - -d ./data_images \ + -t ./data-images/pairs-imgs-lnds_histol.csv \ + -d ./data-images \ -o ./results \ -elastix ~/Applications/elastix/bin \ -cfg ./configs/elastix_affine.txt @@ -91,7 +91,7 @@ class BmElastix(ImRegBenchmark): >>> 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') + >>> path_csv = os.path.join(update_path('data-images'), 'pairs-imgs-lnds_mix.csv') >>> params = {'path_out': path_out, ... 'path_table': path_csv, ... 'nb_workers': 1, diff --git a/bm_experiments/bm_rNiftyReg.py b/bm_experiments/bm_rNiftyReg.py index 93e309dc..d74f90c8 100644 --- a/bm_experiments/bm_rNiftyReg.py +++ b/bm_experiments/bm_rNiftyReg.py @@ -21,16 +21,16 @@ Run the basic R script:: Rscript scripts/Rscript/RNiftyReg_linear.r \ - data_images/rat-kidney_/scale-5pc/Rat-Kidney_HE.jpg \ - data_images/rat-kidney_/scale-5pc/Rat-Kidney_PanCytokeratin.jpg \ - data_images/rat-kidney_/scale-5pc/Rat-Kidney_HE.csv \ + data-images/rat-kidney_/scale-5pc/Rat-Kidney_HE.jpg \ + data-images/rat-kidney_/scale-5pc/Rat-Kidney_PanCytokeratin.jpg \ + data-images/rat-kidney_/scale-5pc/Rat-Kidney_HE.csv \ output/ Run the RNiftyReg benchmark:: python bm_experiments/bm_rNiftyReg.py \ - -t ./data_images/pairs-imgs-lnds_histol.csv \ - -d ./data_images \ + -t ./data-images/pairs-imgs-lnds_histol.csv \ + -d ./data-images \ -o ./results \ -R Rscript \ -script ./scripts/Rscript/RNiftyReg_linear.r @@ -62,7 +62,7 @@ class BmRNiftyReg(ImRegBenchmark): >>> 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('scripts'), 'Rscript', n) - >>> path_csv = os.path.join(update_path('data_images'), 'pairs-imgs-lnds_mix.csv') + >>> path_csv = os.path.join(update_path('data-images'), 'pairs-imgs-lnds_mix.csv') >>> params = {'path_out': path_out, ... 'path_table': path_csv, ... 'nb_workers': 2, diff --git a/bm_experiments/evaluate_experiment.py b/bm_experiments/evaluate_experiment.py index f88ffea1..3400646a 100644 --- a/bm_experiments/evaluate_experiment.py +++ b/bm_experiments/evaluate_experiment.py @@ -13,7 +13,7 @@ python evaluate_experiment.py \ -e ./results/BmUnwarpJ \ - -d ./data_images \ + -d ./data-images \ --visual Copyright (C) 2016-2019 Jiri Borovec diff --git a/circle.yml b/circle.yml index c42e6316..786a8dc3 100644 --- a/circle.yml +++ b/circle.yml @@ -49,11 +49,11 @@ references: name: Dataset command: | mkdir output - python bm_dataset/rescale_tissue_images.py -i "./data_images/rat-kidney_/scale-5pc/*.jpg" --scales 5 -ext .png --nb_workers 2 - python bm_dataset/rescale_tissue_landmarks.py -a ./data_images -d ./output --nb_selected 0.5 --nb_total 200 - python bm_dataset/generate_regist_pairs.py -i "./data_images/images/artificial_*.jpg" -l "./data_images/landmarks/artificial_*.csv" -csv ./data_images/cover_artificial.csv --mode each2all - # python bm_experiments/create_real_synth_dataset.py -i ./data_images/images/Rat_Kidney_HE.jpg -l ./data_images/landmarks/Rat_Kidney_HE.csv -o ./data_images/synth_dataset -nb 3 --nb_workers 1 - # python bm_experiments/generate_regist_pairs.py -i "./data_images/synth_dataset/*.jpg" -l "./data_images/synth_dataset/*.csv" -csv ./data_images/cover_synth-dataset.csv --mode each2all + python bm_dataset/rescale_tissue_images.py -i "./data-images/rat-kidney_/scale-5pc/*.jpg" --scales 5 -ext .png --nb_workers 2 + python bm_dataset/rescale_tissue_landmarks.py -a ./data-images -d ./output --nb_selected 0.5 --nb_total 200 + python bm_dataset/generate_regist_pairs.py -i "./data-images/images/artificial_*.jpg" -l "./data-images/landmarks/artificial_*.csv" -csv ./data-images/cover_artificial.csv --mode each2all + # python bm_experiments/create_real_synth_dataset.py -i ./data-images/images/Rat_Kidney_HE.jpg -l ./data-images/landmarks/Rat_Kidney_HE.csv -o ./data-images/synth_dataset -nb 3 --nb_workers 1 + # python bm_experiments/generate_regist_pairs.py -i "./data-images/synth_dataset/*.jpg" -l "./data-images/synth_dataset/*.csv" -csv ./data-images/cover_synth-dataset.csv --mode each2all run_experiment: &run_experiment run: @@ -61,10 +61,10 @@ references: command: | mkdir applications && mkdir results && touch configs/sample_config.yaml # python bm_experiments/bm_comp_perform.py -o ./results -n 1 # reach time-out while running in 36 threads - python birl/bm_template.py -t ./data_images/pairs-imgs-lnds_mix.csv -o ./results --visual --unique -cfg configs/sample_config.yaml - rm ./data_images/*_/*/*_HE.csv # remove target landmarks from histol. tissue - python birl/bm_template.py -n anhir -t ./data_images/pairs-imgs-lnds_histol.csv -d ./data_images -o ./results --preprocessing matching-rgb gray -cfg configs/sample_config.yaml - python bm_experiments/evaluate_experiment.py -d ./data_images -e ./results/BmTemplate_anhir --visual + python birl/bm_template.py -t ./data-images/pairs-imgs-lnds_mix.csv -o ./results --visual --unique -cfg configs/sample_config.yaml + rm ./data-images/*_/*/*_HE.csv # remove target landmarks from histol. tissue + python birl/bm_template.py -n anhir -t ./data-images/pairs-imgs-lnds_histol.csv -d ./data-images -o ./results --preprocessing matching-rgb gray -cfg configs/sample_config.yaml + python bm_experiments/evaluate_experiment.py -d ./data-images -e ./results/BmTemplate_anhir --visual tree ./results/BmTemplate run_bUnwarpJ: &run_bUnwarpJ @@ -75,8 +75,8 @@ references: unzip -q applications/fiji-linux64.zip -d applications/ rm applications/fiji-linux64.zip rm -rf results && mkdir results - python bm_experiments/bm_bUnwarpJ.py -n mix -t ./data_images/pairs-imgs-lnds_mix.csv -o ./results -Fiji ./applications/Fiji.app/ImageJ-linux64 -cfg ./configs/ImageJ_bUnwarpJ_histol.yaml --preprocessing matching-rgb --visual - python bm_experiments/bm_bUnwarpJ.py -n anhir -t ./data_images/pairs-imgs-lnds_histol.csv -d ./data_images -o ./results -Fiji ./applications/Fiji.app/ImageJ-linux64 -cfg ./configs/ImageJ_bUnwarpJ-SIFT_histol.yaml --unique + python bm_experiments/bm_bUnwarpJ.py -n mix -t ./data-images/pairs-imgs-lnds_mix.csv -o ./results -Fiji ./applications/Fiji.app/ImageJ-linux64 -cfg ./configs/ImageJ_bUnwarpJ_histol.yaml --preprocessing matching-rgb --visual + python bm_experiments/bm_bUnwarpJ.py -n anhir -t ./data-images/pairs-imgs-lnds_histol.csv -d ./data-images -o ./results -Fiji ./applications/Fiji.app/ImageJ-linux64 -cfg ./configs/ImageJ_bUnwarpJ-SIFT_histol.yaml --unique tree -L 3 ./results rm -rf ./applications/Fiji.app @@ -88,7 +88,7 @@ references: unzip -q applications/fiji-linux64.zip -d applications/ rm applications/fiji-linux64.zip rm -rf results && mkdir results - python bm_experiments/bm_RVSS.py -t ./data_images/pairs-imgs-lnds_mix.csv -o ./results -Fiji ./applications/Fiji.app/ImageJ-linux64 -cfg ./configs/ImageJ_RVSS_histol.yaml --visual + python bm_experiments/bm_RVSS.py -t ./data-images/pairs-imgs-lnds_mix.csv -o ./results -Fiji ./applications/Fiji.app/ImageJ-linux64 -cfg ./configs/ImageJ_RVSS_histol.yaml --visual tree -L 3 ./results rm -rf ./applications/Fiji.app @@ -158,6 +158,11 @@ jobs: - *install_pips # DOCUMENTATION - *make_docs + # PREVIEW + - store_artifacts: + # allows us to preview the generated html pages + path: docs/build/html/ + destination: html workflows: version: 2 diff --git a/data_images/images/artificial_moving-affine.jpg b/data-images/images/artificial_moving-affine.jpg similarity index 100% rename from data_images/images/artificial_moving-affine.jpg rename to data-images/images/artificial_moving-affine.jpg diff --git a/data_images/images/artificial_moving-elastic.jpg b/data-images/images/artificial_moving-elastic.jpg similarity index 100% rename from data_images/images/artificial_moving-elastic.jpg rename to data-images/images/artificial_moving-elastic.jpg diff --git a/data_images/images/artificial_moving-rigid.jpg b/data-images/images/artificial_moving-rigid.jpg similarity index 100% rename from data_images/images/artificial_moving-rigid.jpg rename to data-images/images/artificial_moving-rigid.jpg diff --git a/data_images/images/artificial_reference.jpg b/data-images/images/artificial_reference.jpg similarity index 100% rename from data_images/images/artificial_reference.jpg rename to data-images/images/artificial_reference.jpg diff --git a/data_images/landmarks/artificial_moving-affine.csv b/data-images/landmarks/artificial_moving-affine.csv similarity index 100% rename from data_images/landmarks/artificial_moving-affine.csv rename to data-images/landmarks/artificial_moving-affine.csv diff --git a/data_images/landmarks/artificial_moving-affine.pts b/data-images/landmarks/artificial_moving-affine.pts similarity index 100% rename from data_images/landmarks/artificial_moving-affine.pts rename to data-images/landmarks/artificial_moving-affine.pts diff --git a/data_images/landmarks/artificial_moving-elastic.csv b/data-images/landmarks/artificial_moving-elastic.csv similarity index 100% rename from data_images/landmarks/artificial_moving-elastic.csv rename to data-images/landmarks/artificial_moving-elastic.csv diff --git a/data_images/landmarks/artificial_moving-elastic.pts b/data-images/landmarks/artificial_moving-elastic.pts similarity index 100% rename from data_images/landmarks/artificial_moving-elastic.pts rename to data-images/landmarks/artificial_moving-elastic.pts diff --git a/data_images/landmarks/artificial_moving-rigid.csv b/data-images/landmarks/artificial_moving-rigid.csv similarity index 100% rename from data_images/landmarks/artificial_moving-rigid.csv rename to data-images/landmarks/artificial_moving-rigid.csv diff --git a/data_images/landmarks/artificial_moving-rigid.pts b/data-images/landmarks/artificial_moving-rigid.pts similarity index 100% rename from data_images/landmarks/artificial_moving-rigid.pts rename to data-images/landmarks/artificial_moving-rigid.pts diff --git a/data_images/landmarks/artificial_reference.csv b/data-images/landmarks/artificial_reference.csv similarity index 100% rename from data_images/landmarks/artificial_reference.csv rename to data-images/landmarks/artificial_reference.csv diff --git a/data_images/landmarks/artificial_reference.pts b/data-images/landmarks/artificial_reference.pts similarity index 100% rename from data_images/landmarks/artificial_reference.pts rename to data-images/landmarks/artificial_reference.pts diff --git a/data_images/lesions_/scale-5pc/Izd2-29-041-w35_HE.csv b/data-images/lesions_/scale-5pc/Izd2-29-041-w35_HE.csv similarity index 100% rename from data_images/lesions_/scale-5pc/Izd2-29-041-w35_HE.csv rename to data-images/lesions_/scale-5pc/Izd2-29-041-w35_HE.csv diff --git a/data_images/lesions_/scale-5pc/Izd2-29-041-w35_HE.jpg b/data-images/lesions_/scale-5pc/Izd2-29-041-w35_HE.jpg similarity index 100% rename from data_images/lesions_/scale-5pc/Izd2-29-041-w35_HE.jpg rename to data-images/lesions_/scale-5pc/Izd2-29-041-w35_HE.jpg diff --git a/data_images/lesions_/scale-5pc/Izd2-29-041-w35_HE.pts b/data-images/lesions_/scale-5pc/Izd2-29-041-w35_HE.pts similarity index 100% rename from data_images/lesions_/scale-5pc/Izd2-29-041-w35_HE.pts rename to data-images/lesions_/scale-5pc/Izd2-29-041-w35_HE.pts diff --git a/data_images/lesions_/scale-5pc/Izd2-29-041-w35_proSPC.csv b/data-images/lesions_/scale-5pc/Izd2-29-041-w35_proSPC.csv similarity index 100% rename from data_images/lesions_/scale-5pc/Izd2-29-041-w35_proSPC.csv rename to data-images/lesions_/scale-5pc/Izd2-29-041-w35_proSPC.csv diff --git a/data_images/lesions_/scale-5pc/Izd2-29-041-w35_proSPC.jpg b/data-images/lesions_/scale-5pc/Izd2-29-041-w35_proSPC.jpg similarity index 100% rename from data_images/lesions_/scale-5pc/Izd2-29-041-w35_proSPC.jpg rename to data-images/lesions_/scale-5pc/Izd2-29-041-w35_proSPC.jpg diff --git a/data_images/lesions_/scale-5pc/Izd2-29-041-w35_proSPC.pts b/data-images/lesions_/scale-5pc/Izd2-29-041-w35_proSPC.pts similarity index 100% rename from data_images/lesions_/scale-5pc/Izd2-29-041-w35_proSPC.pts rename to data-images/lesions_/scale-5pc/Izd2-29-041-w35_proSPC.pts diff --git a/data_images/pairs-imgs-lnds_histol.csv b/data-images/pairs-imgs-lnds_histol.csv similarity index 100% rename from data_images/pairs-imgs-lnds_histol.csv rename to data-images/pairs-imgs-lnds_histol.csv diff --git a/data-images/pairs-imgs-lnds_mix.csv b/data-images/pairs-imgs-lnds_mix.csv new file mode 100644 index 00000000..b2c4b6f0 --- /dev/null +++ b/data-images/pairs-imgs-lnds_mix.csv @@ -0,0 +1,6 @@ +Target image,Source image,Target landmarks,Source landmarks +data-images/images/artificial_reference.jpg,data-images/images/artificial_moving-rigid.jpg,data-images/landmarks/artificial_reference.csv,data-images/landmarks/artificial_moving-rigid.csv +data-images/images/artificial_reference.jpg,data-images/images/artificial_moving-affine.jpg,data-images/landmarks/artificial_reference.csv,data-images/landmarks/artificial_moving-affine.csv +data-images/images/artificial_reference.jpg,data-images/images/artificial_moving-elastic.jpg,data-images/landmarks/artificial_reference.csv,data-images/landmarks/artificial_moving-elastic.csv +data-images/rat-kidney_/scale-5pc/Rat-Kidney_HE.jpg,data-images/rat-kidney_/scale-5pc/Rat-Kidney_PanCytokeratin.jpg,data-images/rat-kidney_/scale-5pc/Rat-Kidney_HE.csv,data-images/rat-kidney_/scale-5pc/Rat-Kidney_PanCytokeratin.csv +data-images/lesions_/scale-5pc/Izd2-29-041-w35_HE.jpg,data-images/lesions_/scale-5pc/Izd2-29-041-w35_proSPC.jpg,data-images/lesions_/scale-5pc/Izd2-29-041-w35_HE.csv,data-images/lesions_/scale-5pc/Izd2-29-041-w35_proSPC.csv diff --git a/data_images/rat-kidney_/scale-5pc/Rat-Kidney_HE.csv b/data-images/rat-kidney_/scale-5pc/Rat-Kidney_HE.csv similarity index 100% rename from data_images/rat-kidney_/scale-5pc/Rat-Kidney_HE.csv rename to data-images/rat-kidney_/scale-5pc/Rat-Kidney_HE.csv diff --git a/data_images/rat-kidney_/scale-5pc/Rat-Kidney_HE.jpg b/data-images/rat-kidney_/scale-5pc/Rat-Kidney_HE.jpg similarity index 100% rename from data_images/rat-kidney_/scale-5pc/Rat-Kidney_HE.jpg rename to data-images/rat-kidney_/scale-5pc/Rat-Kidney_HE.jpg diff --git a/data_images/rat-kidney_/scale-5pc/Rat-Kidney_HE.pts b/data-images/rat-kidney_/scale-5pc/Rat-Kidney_HE.pts similarity index 100% rename from data_images/rat-kidney_/scale-5pc/Rat-Kidney_HE.pts rename to data-images/rat-kidney_/scale-5pc/Rat-Kidney_HE.pts diff --git a/data_images/rat-kidney_/scale-5pc/Rat-Kidney_PanCytokeratin.csv b/data-images/rat-kidney_/scale-5pc/Rat-Kidney_PanCytokeratin.csv similarity index 100% rename from data_images/rat-kidney_/scale-5pc/Rat-Kidney_PanCytokeratin.csv rename to data-images/rat-kidney_/scale-5pc/Rat-Kidney_PanCytokeratin.csv diff --git a/data_images/rat-kidney_/scale-5pc/Rat-Kidney_PanCytokeratin.jpg b/data-images/rat-kidney_/scale-5pc/Rat-Kidney_PanCytokeratin.jpg similarity index 100% rename from data_images/rat-kidney_/scale-5pc/Rat-Kidney_PanCytokeratin.jpg rename to data-images/rat-kidney_/scale-5pc/Rat-Kidney_PanCytokeratin.jpg diff --git a/data_images/rat-kidney_/scale-5pc/Rat-Kidney_PanCytokeratin.pts b/data-images/rat-kidney_/scale-5pc/Rat-Kidney_PanCytokeratin.pts similarity index 100% rename from data_images/rat-kidney_/scale-5pc/Rat-Kidney_PanCytokeratin.pts rename to data-images/rat-kidney_/scale-5pc/Rat-Kidney_PanCytokeratin.pts diff --git a/data_images/pairs-imgs-lnds_mix.csv b/data_images/pairs-imgs-lnds_mix.csv deleted file mode 100644 index e4b373a7..00000000 --- a/data_images/pairs-imgs-lnds_mix.csv +++ /dev/null @@ -1,6 +0,0 @@ -Target image,Source image,Target landmarks,Source landmarks -data_images/images/artificial_reference.jpg,data_images/images/artificial_moving-rigid.jpg,data_images/landmarks/artificial_reference.csv,data_images/landmarks/artificial_moving-rigid.csv -data_images/images/artificial_reference.jpg,data_images/images/artificial_moving-affine.jpg,data_images/landmarks/artificial_reference.csv,data_images/landmarks/artificial_moving-affine.csv -data_images/images/artificial_reference.jpg,data_images/images/artificial_moving-elastic.jpg,data_images/landmarks/artificial_reference.csv,data_images/landmarks/artificial_moving-elastic.csv -data_images/rat-kidney_/scale-5pc/Rat-Kidney_HE.jpg,data_images/rat-kidney_/scale-5pc/Rat-Kidney_PanCytokeratin.jpg,data_images/rat-kidney_/scale-5pc/Rat-Kidney_HE.csv,data_images/rat-kidney_/scale-5pc/Rat-Kidney_PanCytokeratin.csv -data_images/lesions_/scale-5pc/Izd2-29-041-w35_HE.jpg,data_images/lesions_/scale-5pc/Izd2-29-041-w35_proSPC.jpg,data_images/lesions_/scale-5pc/Izd2-29-041-w35_HE.csv,data_images/lesions_/scale-5pc/Izd2-29-041-w35_proSPC.csv diff --git a/docs/source/conf.py b/docs/source/conf.py index d8f12c82..ba9572c7 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -63,9 +63,9 @@ # TODO: temp fix removing SVG badges and GIF, because PDF cannot show them readme = re.sub(r'(\[!\[.*\))', '', readme) readme = re.sub(r'(!\[.*.gif\))', '', readme) -# for dir_name in (os.path.basename(p) for p in glob.glob(os.path.join(PATH_ROOT, '*')) -# if os.path.isdir(p)): -# readme = readme.replace('](%s/' % dir_name, '](%s/%s/' % (PATH_ROOT, dir_name)) +for dir_name in (os.path.basename(p) for p in glob.glob(os.path.join(PATH_ROOT, '*')) + if os.path.isdir(p)): + readme = readme.replace('](%s/' % dir_name, '](%s/%s/' % (PATH_ROOT, dir_name)) with open('readme.md', 'w') as fp: fp.write(readme) # -- General configuration --------------------------------------------------- @@ -124,7 +124,7 @@ # directories to ignore when looking for source files. # This pattern also affects html_static_path and html_extra_path. exclude_patterns = [ - 'data_images', + 'data-images', '*tests.*', '*.test_*', 'modules.rst', ] @@ -152,7 +152,7 @@ # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ['_figures'] # , 'notebooks' +html_static_path = [] # , 'notebooks' # Custom sidebar templates, must be a dictionary that maps document names # to template names. diff --git a/scripts/Python/run_ANTsPy.py b/scripts/Python/run_ANTsPy.py index d5c23aa0..6e3a8bca 100644 --- a/scripts/Python/run_ANTsPy.py +++ b/scripts/Python/run_ANTsPy.py @@ -5,9 +5,9 @@ For performance and parameters discussion see https://github.com/ANTsX/ANTsPy/issues/85 >> python ./scripts/Python/run_ANTsPy.py \ - ./data_images/rat-kidney_/scale-5pc/Rat-Kidney_HE.jpg \ - ./data_images/rat-kidney_/scale-5pc/Rat-Kidney_PanCytokeratin.jpg \ - ./data_images/rat-kidney_/scale-5pc/Rat-Kidney_PanCytokeratin.csv \ + ./data-images/rat-kidney_/scale-5pc/Rat-Kidney_HE.jpg \ + ./data-images/rat-kidney_/scale-5pc/Rat-Kidney_PanCytokeratin.jpg \ + ./data-images/rat-kidney_/scale-5pc/Rat-Kidney_PanCytokeratin.csv \ ./results Copyright (C) 2019 Jiri Borovec diff --git a/scripts/Python/run_SimpleElastix.py b/scripts/Python/run_SimpleElastix.py index 2e1dcbeb..3b70279e 100644 --- a/scripts/Python/run_SimpleElastix.py +++ b/scripts/Python/run_SimpleElastix.py @@ -23,9 +23,9 @@ Sample call of this script:: python scripts/Python/run_SimpleElastix.py \ - ./data_images/images/artificial_reference.jpg \ - ./data_images/images/artificial_moving-affine.jpg \ - ./data_images/landmarks/artificial_reference.pts \ + ./data-images/images/artificial_reference.jpg \ + ./data-images/images/artificial_moving-affine.jpg \ + ./data-images/landmarks/artificial_reference.pts \ ./results/elastix .. seealso:: https://simpleelastix.readthedocs.io/PointBasedRegistration.html?highlight=warp#transforming-point-sets diff --git a/scripts/Python/run_SimpleITK.py b/scripts/Python/run_SimpleITK.py index f0c2ae30..f8f8b6ac 100644 --- a/scripts/Python/run_SimpleITK.py +++ b/scripts/Python/run_SimpleITK.py @@ -4,9 +4,9 @@ Sample call of this script:: python scripts/Python/run_SimpleITK.py \ - ./data_images/images/artificial_reference.jpg \ - ./data_images/images/artificial_moving-affine.jpg \ - ./data_images/landmarks/artificial_moving-affine.pts \ + ./data-images/images/artificial_reference.jpg \ + ./data-images/images/artificial_moving-affine.jpg \ + ./data-images/landmarks/artificial_moving-affine.pts \ ./results/elastix .. seealso:: https://simpleitk.readthedocs.io/en/master/Examples/index.html diff --git a/scripts/Rscript/RNiftyReg_elastic.r b/scripts/Rscript/RNiftyReg_elastic.r index bbd57b32..4befd5d7 100644 --- a/scripts/Rscript/RNiftyReg_elastic.r +++ b/scripts/Rscript/RNiftyReg_elastic.r @@ -1,8 +1,8 @@ # SEE: https://github.com/jonclayden/RNiftyReg # CMD>> Rscript scripts/Rscript/regist_niftyReg-elastic.r \ -# data_images/rat-kidney_/scale-5pc/Rat_Kidney_HE.jpg \ -# data_images/rat-kidney_/scale-5pc/Rat_Kidney_PanCytokeratin.jpg \ -# data_images/rat-kidney_/scale-5pc/Rat_Kidney_HE.csv \ +# data-images/rat-kidney_/scale-5pc/Rat_Kidney_HE.jpg \ +# data-images/rat-kidney_/scale-5pc/Rat_Kidney_PanCytokeratin.jpg \ +# data-images/rat-kidney_/scale-5pc/Rat_Kidney_HE.csv \ # output/ ## Install packages if needed, then load them diff --git a/scripts/Rscript/RNiftyReg_linear.r b/scripts/Rscript/RNiftyReg_linear.r index 6239335e..b96ceb63 100644 --- a/scripts/Rscript/RNiftyReg_linear.r +++ b/scripts/Rscript/RNiftyReg_linear.r @@ -1,8 +1,8 @@ # SEE: https://github.com/jonclayden/RNiftyReg # CMD>> Rscript scripts/Rscript/regist_niftyReg-linear.r \ -# data_images/rat-kidney_/scale-5pc/Rat_Kidney_HE.jpg \ -# data_images/rat-kidney_/scale-5pc/Rat_Kidney_PanCytokeratin.jpg \ -# data_images/rat-kidney_/scale-5pc/Rat_Kidney_HE.csv \ +# data-images/rat-kidney_/scale-5pc/Rat_Kidney_HE.jpg \ +# data-images/rat-kidney_/scale-5pc/Rat_Kidney_PanCytokeratin.jpg \ +# data-images/rat-kidney_/scale-5pc/Rat_Kidney_HE.csv \ # output/ ## Install packages if needed, then load them diff --git a/setup.cfg b/setup.cfg index a3e84ca1..c883fb1d 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,5 +1,34 @@ [metadata] -license_file = LICENSE +description-file = README.md +license-file = LICENSE +requirements-file = requirements.txt -[bdist_wheel] -universal=1 +#[unittest] +#plugins = nose2.plugins.doctests + +[flake8] +# http://flake8.pycqa.org/en/latest/user/configuration.html +ignore = E402,E731 +max-line-length = 100 +exclude = .tox,*.egg,build,temp +select = E,W,F +doctests = True +verbose = 2 +# max-complexity = 10 + +[tool:pytest] +log_cli = 1 +log_cli_level = CRITICAL +#log_cli_format = %(message)s +log_file = pytest.log +log_file_level = DEBUG +#log_file_format = %(asctime)s [%(levelname)8s] %(message)s (%(filename)s:%(lineno)s) +#log_file_date_format=%Y-%m-%d %H:%M:%S +filterwarnings = ignore::FutureWarning + +[pydocstyle] +convention = pep257 +# D104, D107: Ignore missing docstrings in __init__ files and methods. +# D202: Ignore a blank line after docstring (collision with Python Black in decorators) +add-ignore = D104,D107,D202 +max-line-length = 120 diff --git a/tests/test_benchmark.py b/tests/test_benchmark.py index ef93ff26..bd9efb96 100644 --- a/tests/test_benchmark.py +++ b/tests/test_benchmark.py @@ -28,7 +28,7 @@ from birl.bm_template import BmTemplate PATH_ROOT = os.path.dirname(update_path('birl')) -PATH_DATA = update_path('data_images') +PATH_DATA = update_path('data-images') PATH_CSV_COVER_MIX = os.path.join(PATH_DATA, 'pairs-imgs-lnds_mix.csv') PATH_CSV_COVER_ANHIR = os.path.join(PATH_DATA, 'pairs-imgs-lnds_histol.csv') # logging.basicConfig(level=logging.INFO) diff --git a/tests/test_data-utils.py b/tests/test_data-utils.py index 9f7a5c3b..515ec273 100644 --- a/tests/test_data-utils.py +++ b/tests/test_data-utils.py @@ -16,7 +16,7 @@ from birl.utilities.dataset import image_histogram_matching, CONVERT_RGB PATH_ROOT = os.path.dirname(update_path('birl')) -PATH_DATA = update_path('data_images') +PATH_DATA = update_path('data-images') PATH_IMAGE_REF = os.path.join(PATH_DATA, 'rat-kidney_', 'scale-5pc', 'Rat-Kidney_HE.jpg') PATH_IMAGE_SRC = os.path.join(PATH_DATA, 'rat-kidney_', 'scale-5pc', 'Rat-Kidney_PanCytokeratin.jpg')