diff --git a/.codecov.yml b/.codecov.yml index 465e261f..f8cba16b 100644 --- a/.codecov.yml +++ b/.codecov.yml @@ -42,4 +42,4 @@ comment: layout: header, diff require_changes: false behavior: default # update if exists else create new - # branches: * \ No newline at end of file + # branches: * diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 4330623d..2aead1dd 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -81,7 +81,7 @@ Now, run all tests using:: Use ``--doctest-modules`` to run doctests. For example, run all tests and all doctests using:: ``` - $ PYTHONPATH=. pytest --doctest-modules --with-xunit --with-coverage + $ PYTHONPATH=. pytest --doctest-modules --with-xunit --with-coverage ``` ## Test coverage @@ -104,4 +104,4 @@ detailing the test coverage:: ## Bugs -Please `report bugs on GitHub `_. \ No newline at end of file +Please `report bugs on GitHub `_. diff --git a/.github/ISSUE_TEMPLATE/Bug_report.md b/.github/ISSUE_TEMPLATE/Bug_report.md index 5ab51c41..4d516f15 100644 --- a/.github/ISSUE_TEMPLATE/Bug_report.md +++ b/.github/ISSUE_TEMPLATE/Bug_report.md @@ -12,7 +12,7 @@ assignees: '' ### Description - diff --git a/.github/ISSUE_TEMPLATE/Question.md b/.github/ISSUE_TEMPLATE/Question.md index d6df3b5d..47844e92 100644 --- a/.github/ISSUE_TEMPLATE/Question.md +++ b/.github/ISSUE_TEMPLATE/Question.md @@ -9,10 +9,10 @@ assignees: '' ## ❓ Questions and Help -### Before asking: +### Before asking: @@ -21,7 +21,7 @@ assignees: '' #### Code - + #### What have you tried? diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index b603aaf5..fa2b2103 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -23,8 +23,8 @@ Fixes # (issue). - Breaking change (fix or feature that would cause existing functionality to not work as expected) - This change requires a documentation update -## PR review -Anyone in the community is free to review the PR once the tests have passed. +## PR review +Anyone in the community is free to review the PR once the tests have passed. If we didn't discuss your PR in Github issues there's a high chance it will not be merged. ## Did you have fun? diff --git a/.github/workflows/ci_testing.yml b/.github/workflows/ci_testing.yml index bdc510e6..2a3d9d59 100644 --- a/.github/workflows/ci_testing.yml +++ b/.github/workflows/ci_testing.yml @@ -117,4 +117,4 @@ jobs: rm ./data-images/*_/*/*_HE.csv 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 - shell: bash \ No newline at end of file + shell: bash diff --git a/.github/workflows/code-format.yml b/.github/workflows/code-format.yml index 32623cfc..6c0959b1 100644 --- a/.github/workflows/code-format.yml +++ b/.github/workflows/code-format.yml @@ -52,6 +52,25 @@ jobs: - name: isort run: isort --check-only . + pre-commit: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + + - name: set PY + run: echo "PY=$(python -VV | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV + - uses: actions/cache@v2 + with: + path: ~/.cache/pre-commit + key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }} + + - uses: pre-commit/action@v2.0.2 + # this action also provides an additional behaviour when used in private repositories + # when configured with a github token, the action will push back fixes to the pull request branch + # with: + # token: ${{ secrets.GITHUB_TOKEN }} + #typing-check-mypy: # runs-on: ubuntu-20.04 # steps: diff --git a/.github/workflows/docker-builds.yml b/.github/workflows/docker-builds.yml index c5306ad5..589df288 100644 --- a/.github/workflows/docker-builds.yml +++ b/.github/workflows/docker-builds.yml @@ -40,4 +40,4 @@ jobs: file: bm_experiments/Dockerfile push: ${{ github.ref == 'refs/heads/master' }} tags: borda/birl:SOTA-py${{ matrix.python_version }} - timeout-minutes: 240 \ No newline at end of file + timeout-minutes: 240 diff --git a/.gitignore b/.gitignore index 5e69faac..a6714fa9 100644 --- a/.gitignore +++ b/.gitignore @@ -36,4 +36,4 @@ coverage.xml .hypothesis/ # Raw illustrations -figures/*.png \ No newline at end of file +figures/*.png diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000..7e34af5b --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,43 @@ +default_language_version: + python: python3.8 + +ci: + autofix_prs: true + autoupdate_commit_msg: '[pre-commit.ci] pre-commit suggestions' + # submodules: true + +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.0.1 + hooks: + - id: end-of-file-fixer + - id: trailing-whitespace + - id: check-yaml + - id: pretty-format-json + + #- repo: https://github.com/pre-commit/mirrors-autopep8 + # rev: v1.5.7 + # hooks: + # - id: autopep8 + # name: fixing PEP8 + + - repo: https://github.com/PyCQA/isort + rev: 5.8.0 + hooks: + - id: isort + name: imports + require_serial: false + + - repo: https://github.com/pre-commit/mirrors-yapf + rev: v0.31.0 + hooks: + - id: yapf + name: formatting + language: python + require_serial: false + + - repo: https://github.com/PyCQA/flake8 + rev: 3.9.2 + hooks: + - id: flake8 + name: PEP8 diff --git a/LICENSE b/LICENSE index 19f0b745..5e8642f7 100644 --- a/LICENSE +++ b/LICENSE @@ -24,4 +24,4 @@ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/MANIFEST.in b/MANIFEST.in index 424b0afd..92eab232 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -45,7 +45,7 @@ recursive-include scripts *.r *.ijm *.bsh *.py include *.txt # Exclude build configs -exclude *.yml +exclude *.yml *.yaml prune .git prune .github diff --git a/README.md b/README.md index 20217797..92f2add8 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ [![Code Health](https://landscape.io/github/Borda/BIRL/master/landscape.svg?style=flat)](https://landscape.io/github/Borda/BIRL/master) [![Run Status](https://api.shippable.com/projects/585bfa66e18a291000c15f24/badge?branch=master)](https://app.shippable.com/github/Borda/BIRL) [![Coverage Badge](https://api.shippable.com/projects/585bfa66e18a291000c15f24/coverageBadge?branch=master)](https://app.shippable.com/github/Borda/BIRL) -[![Image.sc +[![Image.sc forum](https://img.shields.io/badge/dynamic/json.svg?label=forum&url=https%3A%2F%2Fforum.image.sc%2Ftags%2Fanhir.json&query=%24.topic_list.tags.0.topic_count&colorB=brightgreen&suffix=%20topics&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAABPklEQVR42m3SyyqFURTA8Y2BER0TDyExZ+aSPIKUlPIITFzKeQWXwhBlQrmFgUzMMFLKZeguBu5y+//17dP3nc5vuPdee6299gohUYYaDGOyyACq4JmQVoFujOMR77hNfOAGM+hBOQqB9TjHD36xhAa04RCuuXeKOvwHVWIKL9jCK2bRiV284QgL8MwEjAneeo9VNOEaBhzALGtoRy02cIcWhE34jj5YxgW+E5Z4iTPkMYpPLCNY3hdOYEfNbKYdmNngZ1jyEzw7h7AIb3fRTQ95OAZ6yQpGYHMMtOTgouktYwxuXsHgWLLl+4x++Kx1FJrjLTagA77bTPvYgw1rRqY56e+w7GNYsqX6JfPwi7aR+Y5SA+BXtKIRfkfJAYgj14tpOF6+I46c4/cAM3UhM3JxyKsxiOIhH0IO6SH/A1Kb1WBeUjbkAAAAAElFTkSuQmCC)](https://forum.image.sc/tags/anhir) --> @@ -33,9 +33,9 @@ _This project/framework is the key component of **[Automatic Non-rigid Histologi The project contains a set of sample images with related landmark annotations and experimental evaluation of state-of-the-art image registration methods. The initial [dataset of stained histological tissues](http://cmp.felk.cvut.cz/~borovji3/?page=dataset) is composed by image pairs of related sections (mainly, consecutive cuts). -Each image in the pair is coloured with a different stain. -The registration of those images is a challenging task due to both artefacts and deformations acquired during sample preparation and appearance differences due to staining. -For evaluation, we have manually placed landmarks in each image pair. There are at least 40 uniformly spread over the tissue. +Each image in the pair is coloured with a different stain. +The registration of those images is a challenging task due to both artefacts and deformations acquired during sample preparation and appearance differences due to staining. +For evaluation, we have manually placed landmarks in each image pair. There are at least 40 uniformly spread over the tissue. 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). @@ -91,20 +91,20 @@ python setup.py install For installing some particular version/releases use following links _https://github.com/Borda/BIRL/archive/v0.2.3.zip_ where the numbers match desired version -(see package [releases](https://github.com/Borda/BIRL/releases)). +(see package [releases](https://github.com/Borda/BIRL/releases)). --- -## Before benchmarks (pre-processing) +## 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 -There is a script to generate synthetic data. -Just set an initial image and their corresponding landmarks. +There is a script to generate synthetic data. +Just set an initial image and their corresponding landmarks. The script will generate a set of geometrically deformed images mimicking different stains and compute the new related landmarks. ```bash @@ -117,8 +117,8 @@ python bm_dataset/create_real_synth_dataset.py \ ### Creating an image-pairs table -When the synthetic datasets have been created, the cover csv file which contains the registration pairs (Reference and Moving image (landmarks)) is generated. -Two modes are created: _"first2all"_ for registering the first image to all others and _"each2all"_ for registering each image to all other. +When the synthetic datasets have been created, the cover csv file which contains the registration pairs (Reference and Moving image (landmarks)) is generated. +Two modes are created: _"first2all"_ for registering the first image to all others and _"each2all"_ for registering each image to all other. _(note A-B is the same as B-A)_ ```bash @@ -144,7 +144,7 @@ We introduce an option how to randomly take only a subset (use `nb_selected`) of python bm_dataset/rescale_tissue_landmarks.py \ -a ./data-images -d ./output \ --nb_selected 0.5 --nb_total 200 -``` +``` Moreover we developed two additional script for converting large images, handling multiple tissue samples in single image and crop to wide background. * `bm_dataset/convert_tiff2png.py` converts TIFF or SVS image to PNG in a particular level @@ -161,7 +161,7 @@ Even though this framework is completely customizable we include several image r ### Install methods and run benchmarks -For each registration method, different experiments can be performed independently using different values of the parameters or image pairs sets. +For each registration method, different experiments can be performed independently using different values of the parameters or image pairs sets. Sample execution of the "empty" benchmark template: ```bash @@ -197,13 +197,13 @@ The general Image Registration benchmarks contain couple required and optional p ![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. +The registration consists of loading images, denoising, feature detection, transform estimation and image warping. ```bash python bm_experiments/bm_comp_perform.py -o ./results ``` This script generate simple report exported in JSON file on given output path. -### Prepared experimental docker image +### Prepared experimental docker image Used prepared docker image from [Docker Hub](https://hub.docker.com/r/borda/birl) @@ -334,14 +334,14 @@ The new image registration methods should be added to `bm_experiments` folder. ### Re-evaluate experiment -In case you need to re-compute evaluation or add visualisation to existing experiment you can use the following script. -The script require complete experiment folder with standard `registration-results.scv` (similar to registration pairs extended by experiment results). +In case you need to re-compute evaluation or add visualisation to existing experiment you can use the following script. +The script require complete experiment folder with standard `registration-results.scv` (similar to registration pairs extended by experiment results). ```bash python bm_experiments/evaluate_experiment.py \ -e ./results/BmUnwarpJ \ --visual -``` +``` --- @@ -363,10 +363,10 @@ For complete references see [bibtex](docs/references.bib). Create your own local environment, for more information see the [User Guide](https://pip.pypa.io/en/latest/user_guide.html), and install dependencies requirements.txt contains a list of packages and can be installed as ```bash -@duda:~$ cd BIRL +@duda:~$ cd BIRL @duda:~/BIRL$ virtualenv env -@duda:~/BIRL$ source env/bin/activate -(env)@duda:~/BIRL$ pip install -r requirements.txt +@duda:~/BIRL$ source env/bin/activate +(env)@duda:~/BIRL$ pip install -r requirements.txt (env)@duda:~/BIRL$ python ... ``` and in the end, terminating... @@ -376,7 +376,7 @@ and in the end, terminating... **Running docString tests** - documentation and samples of doc string on [pymotw](https://pymotw.com/2/doctest/) and [python/docs](https://docs.python.org/2/library/doctest.html) -**Listing dataset in command line** +**Listing dataset in command line** ```bash find . | sed -e "s/[^-][^\/]*\// |/g" -e "s/|\([^ ]\)/|-\1/" >> dataset.txt ``` diff --git a/_config.yml b/_config.yml index c943ccbd..c490dfb6 100644 --- a/_config.yml +++ b/_config.yml @@ -1,2 +1,2 @@ show_downloads: true -theme: jekyll-theme-cayman \ No newline at end of file +theme: jekyll-theme-cayman diff --git a/bm_ANHIR/automatic-evaluation.md b/bm_ANHIR/automatic-evaluation.md index 21e70778..7a437d88 100644 --- a/bm_ANHIR/automatic-evaluation.md +++ b/bm_ANHIR/automatic-evaluation.md @@ -47,7 +47,7 @@ Run one of following sample registration experiments: ~/Medical-temp/experiments_anhir/BmUnwarpJ/*/*.png ``` -Running the docker image with mapped folders +Running the docker image with mapped folders ```bash mkdir submission output ``` @@ -61,7 +61,7 @@ docker run --rm -it \ ``` -### Export +### Export Export the created image to be uploaded to the evaluation system. ```bash diff --git a/bm_ANHIR/emails/text_dataset.txt b/bm_ANHIR/emails/text_dataset.txt index 89ca5071..84f45911 100644 --- a/bm_ANHIR/emails/text_dataset.txt +++ b/bm_ANHIR/emails/text_dataset.txt @@ -8,4 +8,4 @@ Let us remind you that we will have a challenge workshop at the ISBI conference Do not hesitate to ask if you have any questions or comments. Good luck and we are looking forward to meeting you in Venice. -Jiri Borovec & Arrate Munoz-Barrutia & Jan Kybic & Ignacio Arganda \ No newline at end of file +Jiri Borovec & Arrate Munoz-Barrutia & Jan Kybic & Ignacio Arganda diff --git a/bm_ANHIR/emails/text_invitation.txt b/bm_ANHIR/emails/text_invitation.txt index 086a2b19..6ec21c47 100644 --- a/bm_ANHIR/emails/text_invitation.txt +++ b/bm_ANHIR/emails/text_invitation.txt @@ -7,4 +7,4 @@ For more detail visit our webpage: https://anhir.grand-challenge.org Looking forward to your possible participation, -Jiri Borovec & Arrate Munoz-Barrutia & Jan Kybic & Ignacio Arganda \ No newline at end of file +Jiri Borovec & Arrate Munoz-Barrutia & Jan Kybic & Ignacio Arganda diff --git a/bm_ANHIR/emails/text_pre-release.txt b/bm_ANHIR/emails/text_pre-release.txt index 43f49615..df7fe104 100644 --- a/bm_ANHIR/emails/text_pre-release.txt +++ b/bm_ANHIR/emails/text_pre-release.txt @@ -17,4 +17,4 @@ Do not hesitate to ask if you have any questions or comments. Good luck! We are looking forward to meeting you in Venice. -Jiri Borovec & Arrate Munoz-Barrutia & Jan Kybic & Ignacio Arganda-Carreras \ No newline at end of file +Jiri Borovec & Arrate Munoz-Barrutia & Jan Kybic & Ignacio Arganda-Carreras diff --git a/bm_CIMA/README.md b/bm_CIMA/README.md index 71ba478a..534ee303 100644 --- a/bm_CIMA/README.md +++ b/bm_CIMA/README.md @@ -29,4 +29,4 @@ Then you can parse just the new results with [evaluation script](../bm_ANHIR/eva ## References For complete references see [bibtex](../docs/references.bib). -1. Borovec, J. (2019). **BIRL: Benchmark on Image Registration methods with Landmark validation**. arXiv preprint [arXiv:1912.13452.](https://arxiv.org/abs/1912.13452) \ No newline at end of file +1. Borovec, J. (2019). **BIRL: Benchmark on Image Registration methods with Landmark validation**. arXiv preprint [arXiv:1912.13452.](https://arxiv.org/abs/1912.13452) diff --git a/bm_experiments/run-all-experiments.sh b/bm_experiments/run-all-experiments.sh index 446d1d61..9b5242c3 100644 --- a/bm_experiments/run-all-experiments.sh +++ b/bm_experiments/run-all-experiments.sh @@ -98,4 +98,4 @@ do $pproc \ --visual --unique --nb_workers $jobs -done \ No newline at end of file +done diff --git a/configs/ANTs_SyN.txt b/configs/ANTs_SyN.txt index fc156104..c98ad528 100644 --- a/configs/ANTs_SyN.txt +++ b/configs/ANTs_SyN.txt @@ -23,4 +23,4 @@ --use-histogram-matching 1 --collapse-output-transforms 1 --float ---verbose \ No newline at end of file +--verbose diff --git a/configs/ANTs_spline.txt b/configs/ANTs_spline.txt index 9aa1b9ce..2e64def7 100644 --- a/configs/ANTs_spline.txt +++ b/configs/ANTs_spline.txt @@ -24,4 +24,4 @@ --use-histogram-matching 1 --collapse-output-transforms 1 --float ---verbose \ No newline at end of file +--verbose diff --git a/configs/DROP.txt b/configs/DROP.txt index 8ccf3713..c13ce0e8 100644 --- a/configs/DROP.txt +++ b/configs/DROP.txt @@ -20,4 +20,4 @@ increg = 1 update = 0 sampling = 0 bins = 8 -margin = 0 \ No newline at end of file +margin = 0 diff --git a/configs/DROP2.txt b/configs/DROP2.txt index d2f683d5..a040a271 100644 --- a/configs/DROP2.txt +++ b/configs/DROP2.txt @@ -8,4 +8,4 @@ --nsim 1 --nlevels 16 16 16 8 8 8 --nlambda 0.5 ---npin \ No newline at end of file +--npin diff --git a/configs/ImageJ_RVSS_histol.yaml b/configs/ImageJ_RVSS_histol.yaml index 6b423924..6fe00a05 100644 --- a/configs/ImageJ_RVSS_histol.yaml +++ b/configs/ImageJ_RVSS_histol.yaml @@ -25,4 +25,4 @@ SIFT: # inlier ratio (SIFT parameter, ex. 0.05) minInlierRatio: 0.05 # expected transformation (SIFT parameter, 0:Translation, 1:Rigid, 2:Similarity, 3:Affine, 4:Perspective) - modelIndex: 1 \ No newline at end of file + modelIndex: 1 diff --git a/data-images/landmarks/artificial_moving-affine.pts b/data-images/landmarks/artificial_moving-affine.pts index d68ae0b6..7491b52f 100644 --- a/data-images/landmarks/artificial_moving-affine.pts +++ b/data-images/landmarks/artificial_moving-affine.pts @@ -11,4 +11,4 @@ point 399.0 308.0 245.0 314.0 609.0 247.0 -293.0 559.0 \ No newline at end of file +293.0 559.0 diff --git a/data-images/landmarks/artificial_moving-elastic.pts b/data-images/landmarks/artificial_moving-elastic.pts index 6f559791..c0fb5459 100644 --- a/data-images/landmarks/artificial_moving-elastic.pts +++ b/data-images/landmarks/artificial_moving-elastic.pts @@ -11,4 +11,4 @@ point 400.0 314.0 263.0 336.0 592.0 235.0 -320.0 560.0 \ No newline at end of file +320.0 560.0 diff --git a/data-images/landmarks/artificial_moving-rigid.pts b/data-images/landmarks/artificial_moving-rigid.pts index 3f61737e..7a8a2a5d 100644 --- a/data-images/landmarks/artificial_moving-rigid.pts +++ b/data-images/landmarks/artificial_moving-rigid.pts @@ -11,4 +11,4 @@ point 451 300 307 345 640 187 -417 574 \ No newline at end of file +417 574 diff --git a/data-images/landmarks/artificial_reference.pts b/data-images/landmarks/artificial_reference.pts index 1e518f5b..946d1298 100644 --- a/data-images/landmarks/artificial_reference.pts +++ b/data-images/landmarks/artificial_reference.pts @@ -11,4 +11,4 @@ point 360.0 280.0 216.0 326.0 549.0 168.0 -323.0 550.0 \ No newline at end of file +323.0 550.0 diff --git a/docs/Makefile b/docs/Makefile index 69fe55ec..ba501f6f 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -16,4 +16,4 @@ help: # Catch-all target: route all unknown targets to Sphinx using the new # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). %: Makefile - @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) \ No newline at end of file + @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) diff --git a/docs/requirements.txt b/docs/requirements.txt index 228dd1d7..8ad3e3d1 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -5,4 +5,4 @@ nbsphinx>=0.8.5 pandoc docutils<0.15 # higher version breaks py2 imgconverter -ipython \ No newline at end of file +ipython diff --git a/docs/source/ANHIR.rst b/docs/source/ANHIR.rst index c97f2163..2c4cff13 100644 --- a/docs/source/ANHIR.rst +++ b/docs/source/ANHIR.rst @@ -16,4 +16,4 @@ The `ANHIR challenge`__ aims at the automatic nonlinear image registration of 2D .. _ANHIR: https://anhir.grand-challenge.org/ -__ ANHIR_ \ No newline at end of file +__ ANHIR_ diff --git a/notebooks/requirements.txt b/notebooks/requirements.txt index 33a97ef7..8b619a9d 100644 --- a/notebooks/requirements.txt +++ b/notebooks/requirements.txt @@ -1 +1 @@ -ipython[all]>=4.2.0 \ No newline at end of file +ipython[all]>=4.2.0 diff --git a/require-py27.txt b/require-py27.txt index 24ea7408..a431dc0d 100644 --- a/require-py27.txt +++ b/require-py27.txt @@ -12,4 +12,4 @@ openslide-python<=1.1.1 nibabel<3.0 SimpleITK psutil -pathos \ No newline at end of file +pathos diff --git a/requirements.txt b/requirements.txt index 95957587..33de7f35 100644 --- a/requirements.txt +++ b/requirements.txt @@ -12,4 +12,4 @@ openslide-python>=1.0 nibabel>=2.1 SimpleITK psutil -pathos \ No newline at end of file +pathos diff --git a/scripts/ImageJ/apply-RVSS-registration.bsh b/scripts/ImageJ/apply-RVSS-registration.bsh index 37369687..c033b837 100644 --- a/scripts/ImageJ/apply-RVSS-registration.bsh +++ b/scripts/ImageJ/apply-RVSS-registration.bsh @@ -51,13 +51,13 @@ referenceName = bsh.args[ 3 ]; IJ.log( "reference file: " + referenceName ); if( referenceName.equals("null") ) referenceName = null; - + shrinkingConstraint = Integer.parseInt( bsh.args[ 4 ] ) == 1; // (0 or 1) // RVSS parameters p = new Register_Virtual_Stack_MT.Param(); -p.featuresModelIndex = Integer.parseInt( bsh.args[ 5 ] ); +p.featuresModelIndex = Integer.parseInt( bsh.args[ 5 ] ); p.registrationModelIndex = Integer.parseInt( bsh.args[ 6 ] ); // SIFT p.sift.initialSigma = Float.parseFloat( bsh.args[ 7 ] ); @@ -75,5 +75,5 @@ p.featuresModelIndex = Integer.parseInt( bsh.args[ 16 ] ); //if( bsh.args.length >= 23 ) // fixedTransfFile = new File( bsh.args[ 23 ] ); - + Register_Virtual_Stack_MT.exec(sourceDir, targetDir, transfDir, referenceName, p, shrinkingConstraint ); diff --git a/scripts/ImageJ/apply-RVSS-transform.bsh b/scripts/ImageJ/apply-RVSS-transform.bsh index 02d2821b..4a385a4d 100644 --- a/scripts/ImageJ/apply-RVSS-transform.bsh +++ b/scripts/ImageJ/apply-RVSS-transform.bsh @@ -56,7 +56,7 @@ try { pointList.add( point ); line = br.readLine(); } - + } finally { br.close(); } @@ -88,7 +88,7 @@ try { catch (IOException ex) { IJ.log( ex.printStackTrace()); } finally { - + } // Apply transform to image @@ -100,7 +100,7 @@ bb = mesh.getBoundingBox(); //IJ.log( "bb.x = " + bb.x + ", bb.y = " + bb.y + ", bb.width = " + bb.width + ", bb.height = " + bb.height ); movingImage.getProcessor().setValue(0); -ip = mapping.createMappedImageInterpolated( movingImage.getProcessor() ); +ip = mapping.createMappedImageInterpolated( movingImage.getProcessor() ); // crop corresponding area based on fixed image output = new ImagePlus( "output", ip ); diff --git a/scripts/ImageJ/apply-SIFT-bUnwarpJ-registration.bsh b/scripts/ImageJ/apply-SIFT-bUnwarpJ-registration.bsh index 96889244..4a79bf08 100644 --- a/scripts/ImageJ/apply-SIFT-bUnwarpJ-registration.bsh +++ b/scripts/ImageJ/apply-SIFT-bUnwarpJ-registration.bsh @@ -37,7 +37,7 @@ if( bsh.args.length < 23 ) IJ.log( " 'modelIndex' expected transformation (SIFT parameter, 0:Translation, 1:Rigid, 2:Similarity, 3:Affine, 4:Perspective)" ); // bUnwarpJ parameters - + IJ.log( " 'mode' 0-2 (0-Accurate, 1-Fast, 2-Mono)" ); IJ.log( " 'subsampleFactor' 0-7 (0 = 2^0, 7 = 2^7)" ); IJ.log( " 'minScale' 0-3 (0-Very Coarse, 1-Coarse, 2-Fine, 3-Very Fine)" ); @@ -111,9 +111,9 @@ sift.exec( fixedImage, movingImage, minInlierRatio, modelIndex ); // compute registration without GUI -t = bUnwarpJ_.computeTransformationBatch( fixedImage, movingImage, maskIpTgt, maskIpSrc, mode, - subsampleFactor, minScale, maxScale, - divWeight, curlWeight, landmarkWeight, +t = bUnwarpJ_.computeTransformationBatch( fixedImage, movingImage, maskIpTgt, maskIpSrc, mode, + subsampleFactor, minScale, maxScale, + divWeight, curlWeight, landmarkWeight, imageWeight, consistencyWeight, stopThreshold ); // save transforms diff --git a/scripts/ImageJ/apply-bUnwarpJ-registration.bsh b/scripts/ImageJ/apply-bUnwarpJ-registration.bsh index adf37f68..4fcc7d62 100644 --- a/scripts/ImageJ/apply-bUnwarpJ-registration.bsh +++ b/scripts/ImageJ/apply-bUnwarpJ-registration.bsh @@ -57,9 +57,9 @@ maskIpTgt = null; maskIpSrc = null; // compute registration without GUI -t = bUnwarpJ_.computeTransformationBatch( fixedImage, movingImage, maskIpTgt, maskIpSrc, mode, - subsampleFactor, minScale, maxScale, - divWeight, curlWeight, landmarkWeight, +t = bUnwarpJ_.computeTransformationBatch( fixedImage, movingImage, maskIpTgt, maskIpSrc, mode, + subsampleFactor, minScale, maxScale, + divWeight, curlWeight, landmarkWeight, imageWeight, consistencyWeight, stopThreshold ); // save transforms diff --git a/scripts/ImageJ/histogram-matching.bsh b/scripts/ImageJ/histogram-matching.bsh index 70c37309..53927d3e 100644 --- a/scripts/ImageJ/histogram-matching.bsh +++ b/scripts/ImageJ/histogram-matching.bsh @@ -55,4 +55,4 @@ for( n=1; n<=imageToTransform.getImageStackSize(); n++) imageToTransform.setStack( is ); -IJ.save( imageToTransform, outputImage.getAbsolutePath() ); \ No newline at end of file +IJ.save( imageToTransform, outputImage.getAbsolutePath() ); diff --git a/scripts/ImageJ/makeImageMosaic.ijm b/scripts/ImageJ/makeImageMosaic.ijm index de1641d1..a9411f1f 100644 --- a/scripts/ImageJ/makeImageMosaic.ijm +++ b/scripts/ImageJ/makeImageMosaic.ijm @@ -3,8 +3,8 @@ * @author: Jiri Borovec * @date: 13/02/2013 * @mail: jiri.borovec@fel.cvut.cz - * - * @brief: This macro does mosaic from all open images. + * + * @brief: This macro does mosaic from all open images. * The grid size is given by param "mosaicSize". * It keeps the final image ans the others will be closed. */ @@ -49,8 +49,8 @@ for(y=0; y