Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ NEW: DFBR for Registering Images #510

Merged
merged 207 commits into from
Dec 9, 2022
Merged
Show file tree
Hide file tree
Changes from 203 commits
Commits
Show all changes
207 commits
Select commit Hold shift + click to select a range
b2f27cf
Feature extraction for DFBR.
ruqayya Jul 30, 2022
e632aec
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 30, 2022
eda6887
Feature extraction for DFBR.
ruqayya Jul 30, 2022
a201065
Update tiatoolbox/tools/registration/wsi_registration.py
ruqayya Jul 31, 2022
8bd53de
Update tiatoolbox/tools/registration/wsi_registration.py
ruqayya Jul 31, 2022
994496f
Update tiatoolbox/tools/registration/wsi_registration.py
ruqayya Jul 31, 2022
e23f95c
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 31, 2022
a2f836d
Feature extraction for DFBR.
ruqayya Aug 1, 2022
0acfab5
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 1, 2022
5cab0df
assert statement is added to check if the output is as expected
ruqayya Aug 1, 2022
edc7e7f
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 1, 2022
2b179d6
DOC: Fix indents
shaneahmed Aug 1, 2022
e89c666
- urls are added to remote_samples.yaml
ruqayya Aug 8, 2022
007de2b
- tests added to conftest and removed from test_wsi_registration.py
ruqayya Aug 8, 2022
e3c72bd
- removed fixture tests from conftest and placed them to test_wsi_reg…
ruqayya Aug 8, 2022
3cf85bd
MERGE: Merge develop into dev-feature_extraction_DFBR
shaneahmed Aug 8, 2022
8c3ec92
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 8, 2022
15cb665
DEV: Move fixtures to conftest.py
shaneahmed Aug 8, 2022
7ccdeee
DEV: Move fixtures to conftest.py
shaneahmed Aug 8, 2022
41a21f9
Update tiatoolbox/tools/registration/wsi_registration.py
ruqayya Aug 10, 2022
b9f9243
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 10, 2022
9e49ba9
BUG: Fix feature fixture error
ruqayya Aug 10, 2022
b8866fb
Merge remote-tracking branch 'origin/dev-feature_extraction_DFBR' int…
ruqayya Aug 10, 2022
b718c77
DEV: Replaced png images with jpeg images for test.
ruqayya Aug 12, 2022
20c8906
DEV: Feature matching functions added.
ruqayya Aug 12, 2022
af64dc3
DEV: Assert statement removed.
ruqayya Aug 12, 2022
f144649
DEV: Convert functions to static function.
ruqayya Aug 12, 2022
501ec08
Merge branch 'develop' into dev-feature_matching_DFBR
shaneahmed Aug 15, 2022
8254837
DEV: Compute transformation matrix.
ruqayya Aug 16, 2022
eb943e2
DOC: Add return values.
ruqayya Aug 17, 2022
48a6002
DOC: Add docstring for estimate_affine_transform.
ruqayya Aug 17, 2022
8172296
Merge remote-tracking branch 'origin/dev-feature_matching_DFBR' into …
ruqayya Aug 17, 2022
25626bb
DEV: Remove unused variable and del statement.
ruqayya Aug 17, 2022
2aa77e5
DEV: Rename indx to ind.
ruqayya Aug 17, 2022
a9d2d33
DEV: Remove match_histograms function.
ruqayya Aug 17, 2022
e2b7a81
Merge branch 'develop' into dev-feature_matching_DFBR
shaneahmed Aug 19, 2022
3e2022f
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 19, 2022
16d8845
DOC: Fix Merge conflicts.
shaneahmed Aug 19, 2022
ae9ef94
DOC: Fix Merge conflicts.
shaneahmed Aug 19, 2022
19cf0a8
TST: Fix merge conflicts.
shaneahmed Aug 19, 2022
17b33f0
Merge remote-tracking branch 'origin/develop' into dev-feature_matchi…
shaneahmed Aug 22, 2022
78bd2dd
Add typehints, update docstrings
ruqayya Aug 23, 2022
3d05508
Merge branch 'develop' into dev-feature_matching_DFBR
shaneahmed Aug 26, 2022
51d6c02
Merge branch 'develop' into dev-feature_matching_DFBR
shaneahmed Aug 30, 2022
c258ec8
Dev: Extract features from VGG16 using forward hooks.
ruqayya Sep 6, 2022
3c0a680
Merge remote-tracking branch 'origin/dev-feature_matching_DFBR' into …
ruqayya Sep 6, 2022
4bc391b
DEV: Remove redundancy
ruqayya Sep 6, 2022
76553e5
DEV: Remove unused arguments.
ruqayya Sep 6, 2022
65f6554
DOC: Add docstrings.
ruqayya Sep 6, 2022
2791b07
Merge branch 'develop' into dev-feature_matching_DFBR
ruqayya Sep 6, 2022
4324dac
Merge branch 'develop' into dev-feature_matching_DFBR
shaneahmed Sep 6, 2022
03a6255
Merge branch 'develop' into dev-feature_matching_DFBR
shaneahmed Sep 6, 2022
c269f94
Merge branch 'develop' into dev-feature_matching_DFBR
shaneahmed Sep 9, 2022
dcc85b7
DOC: Update docstrings.
ruqayya Sep 9, 2022
85a3977
Merge remote-tracking branch 'origin/dev-feature_matching_DFBR' into …
ruqayya Sep 9, 2022
1696b7a
DOC: Update docstrings.
ruqayya Sep 9, 2022
21573bd
DEV: Replace math with numpy for sqrt.
ruqayya Sep 9, 2022
f701395
DOC: Add reference to original paper.
ruqayya Sep 9, 2022
6eeaea5
DOC: Remove space.
ruqayya Sep 9, 2022
95a4006
DEV: Add register method.
ruqayya Sep 9, 2022
316bbe8
DEV: Replace OrderedDict with dict.
ruqayya Sep 10, 2022
c43b104
BUG: Use Tuple for typehint
shaneahmed Sep 10, 2022
38eab5c
DEV: Remove matching points outside the tissue boundary.
ruqayya Sep 10, 2022
a453380
DEV: Estimate transformation in a blockwise manner using DFBR.
ruqayya Sep 11, 2022
33a5dc4
Replace range with enumerate in for loop.
ruqayya Sep 11, 2022
11a1be4
Fix indentation.
ruqayya Sep 11, 2022
24afd30
Replace Tuple with tuple.
ruqayya Sep 11, 2022
24c0164
DOC: Fix indentation.
ruqayya Sep 11, 2022
41e0c4c
Merge branch 'develop' into dev-DFBRegistration
shaneahmed Sep 12, 2022
809705e
Merge remote-tracking branch 'origin/develop' into dev-DFBRegistration
shaneahmed Sep 14, 2022
3d411ac
Merge branch 'develop' into dev-DFBRegistration
shaneahmed Sep 16, 2022
109d544
Fix bug.
ruqayya Sep 20, 2022
1003f9b
Merge remote-tracking branch 'origin/dev-DFBRegistration' into dev-DF…
ruqayya Sep 20, 2022
3949890
Update tests/test_wsi_registration.py
ruqayya Sep 28, 2022
87ae7d1
Add assert test and Renaming
ruqayya Sep 28, 2022
7be8b4c
Merge remote-tracking branch 'origin/dev-DFBRegistration' into dev-DF…
ruqayya Sep 28, 2022
0606722
Remove tests from extract_features and add them to register
ruqayya Oct 3, 2022
5bd8a59
Add pre-alignment inside register function
ruqayya Oct 4, 2022
a878a41
Merge branch 'develop' into dev-DFBRegistration
shaneahmed Oct 4, 2022
0787ba4
- Simplify code
ruqayya Oct 5, 2022
73b522e
Merge remote-tracking branch 'origin/dev-DFBRegistration' into dev-DF…
ruqayya Oct 5, 2022
3225a58
- Rewrite find_points_inside_boundary function with PatchExtractor.fi…
ruqayya Oct 6, 2022
e9f33b4
- Split test functions into separate unit tests.
ruqayya Oct 6, 2022
b38cb51
- Notebook for WSI registration.
ruqayya Oct 6, 2022
ed21a1b
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 6, 2022
106e5e6
- Rename the notebook.
ruqayya Oct 6, 2022
5d04611
- Improve coverage
ruqayya Oct 7, 2022
8c4ee7e
- Add comments for Affine transform
ruqayya Oct 7, 2022
a040932
Merge branch 'develop' into dev-DFBRegistration
ruqayya Oct 7, 2022
20856d6
- Add comments for Affine transform
ruqayya Oct 7, 2022
695a97a
Merge remote-tracking branch 'origin/dev-DFBRegistration' into dev-DF…
ruqayya Oct 7, 2022
4e96cf0
- Replace reverse_translation with inverse_translation
ruqayya Oct 7, 2022
3b9562d
Merge branch 'dev-DFBRegistration' into DFBR_notebook
ruqayya Oct 7, 2022
80a5f75
- Output results
ruqayya Oct 7, 2022
8aa1f74
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 7, 2022
7deec6e
- Clear unnecessary outputs.
ruqayya Oct 7, 2022
db5b16c
Merge remote-tracking branch 'origin/DFBR_notebook' into DFBR_notebook
ruqayya Oct 7, 2022
86ea8df
- Set ON_GPU = True
ruqayya Oct 7, 2022
289aa80
- Remove empty cell.
ruqayya Oct 7, 2022
b301e72
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 7, 2022
cd8b24f
REF: Refactor code for readability
shaneahmed Oct 10, 2022
51a5aa1
Merge branch 'develop' into dev-DFBRegistration
shaneahmed Oct 10, 2022
0e7a2d7
Merge branch 'develop' into DFBR_notebook
shaneahmed Oct 10, 2022
31a9516
- Add test for test_filtering_matching_points
ruqayya Oct 11, 2022
a9bec58
Merge remote-tracking branch 'origin/dev-DFBRegistration' into dev-DF…
ruqayya Oct 11, 2022
343d7a6
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 11, 2022
8672c46
Merge remote-tracking branch 'origin/dev-DFBRegistration' into DFBR_n…
ruqayya Oct 11, 2022
61383ed
- Merge parent branch
ruqayya Oct 11, 2022
7eeea1a
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 11, 2022
2fea451
[skip ci] DOC: Remove cells from documentation
shaneahmed Oct 11, 2022
1498699
- Add tag to remove cells
ruqayya Oct 12, 2022
2dceeaa
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 12, 2022
2341c04
Merge branch 'develop' into DFBR_notebook
ruqayya Oct 13, 2022
4a4306f
- Add heading for reading images
ruqayya Oct 13, 2022
1e28067
Merge remote-tracking branch 'origin/DFBR_notebook' into DFBR_notebook
ruqayya Oct 13, 2022
07a1b85
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 13, 2022
a44d7f4
Merge remote-tracking branch 'origin/develop' into DFBR_notebook
shaneahmed Oct 13, 2022
11642a5
- Update installation section
ruqayya Oct 13, 2022
076fc8e
Merge remote-tracking branch 'origin/DFBR_notebook' into DFBR_notebook
ruqayya Oct 13, 2022
a1967e4
[skip ci] Remove outputs
ruqayya Oct 13, 2022
3787a9d
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 13, 2022
0c4b4b6
[skip ci] Update reference
ruqayya Oct 16, 2022
d59ea1b
Merge remote-tracking branch 'origin/DFBR_notebook' into DFBR_notebook
ruqayya Oct 16, 2022
e1afc23
[skip ci] Update reference
ruqayya Oct 16, 2022
e784ace
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 16, 2022
0fdde53
[skip ci] Add details of wsi alignment in readme file
ruqayya Oct 18, 2022
50dfc93
Merge remote-tracking branch 'origin/DFBR_notebook' into DFBR_notebook
ruqayya Oct 18, 2022
2fa22a9
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 18, 2022
c8fb906
- Address Davids' comments
ruqayya Oct 20, 2022
509eb2f
MERGE: Merge develop into DFBR_notebook_revised
shaneahmed Oct 21, 2022
233adc9
REF: Rename 10-wsi-registration.ipynb
shaneahmed Oct 21, 2022
1401b1c
- DEV: Add transformer.
ruqayya Oct 28, 2022
3217223
- DEV: Fix pre-commit issues.
ruqayya Oct 28, 2022
c0da934
- DEV: Fix pre-commit issues.
ruqayya Oct 28, 2022
3031c9a
[skip ci] Extract tiles and then apply B-spline.
ruqayya Oct 28, 2022
359d510
DEV: Add translation registration using phase correlation.
ruqayya Oct 29, 2022
9e3ca2f
- Show Jupyter output.
ruqayya Oct 29, 2022
8d7c809
- Add details.
ruqayya Oct 30, 2022
7532be4
Merge remote-tracking branch 'origin/develop' into DFBR_notenook_revised
shaneahmed Nov 1, 2022
6be20c1
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Nov 1, 2022
3e77f32
REV: Revert previous change
shaneahmed Nov 1, 2022
3009a4a
Merge remote-tracking branch 'origin/DFBR_notenook_revised' into DFBR…
shaneahmed Nov 1, 2022
1c78297
Merge remote-tracking branch 'origin/master' into DFBR_notenook_revised
ruqayya Nov 2, 2022
4ef6c96
[skip ci] DEV: Update pip install
shaneahmed Nov 4, 2022
672859d
Merge remote-tracking branch 'origin/DFBR_notenook_revised' into DFBR…
ruqayya Nov 4, 2022
f2a9bec
[skip ci] Update Jupyter outputs.
ruqayya Nov 4, 2022
ec47b79
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Nov 4, 2022
b539006
Update tiatoolbox/tools/registration/wsi_registration.py
ruqayya Nov 4, 2022
2a46d8f
Update tiatoolbox/tools/registration/wsi_registration.py
ruqayya Nov 4, 2022
4d8d8fb
Update tiatoolbox/tools/registration/wsi_registration.py
ruqayya Nov 4, 2022
37420bd
Update tiatoolbox/tools/registration/wsi_registration.py
ruqayya Nov 4, 2022
35900e1
Update tiatoolbox/tools/registration/wsi_registration.py
ruqayya Nov 4, 2022
9ef30dd
Update tiatoolbox/tools/registration/wsi_registration.py
ruqayya Nov 4, 2022
a800f9c
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Nov 4, 2022
ac18871
Replace level with units+resolution.
ruqayya Nov 4, 2022
48a1721
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Nov 4, 2022
96fa9fe
Fix test expected values.
ruqayya Nov 4, 2022
9cce340
Merge remote-tracking branch 'origin/DFBR_notenook_revised' into DFBR…
ruqayya Nov 4, 2022
2762ce2
Update read_rect of AffineWSITransformer.
ruqayya Nov 4, 2022
f34605c
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Nov 4, 2022
07f2615
Add Examples in comment section.
ruqayya Nov 4, 2022
5f73e66
Merge remote-tracking branch 'origin/DFBR_notenook_revised' into DFBR…
ruqayya Nov 4, 2022
3d753a1
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Nov 4, 2022
7e89ef7
Fix Examples error.
ruqayya Nov 5, 2022
e010678
Merge remote-tracking branch 'origin/DFBR_notenook_revised' into DFBR…
ruqayya Nov 5, 2022
1234aea
Update github and colab link.
ruqayya Nov 5, 2022
db35657
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Nov 5, 2022
88d35bb
Add test for AffineWSITransformer.
ruqayya Nov 6, 2022
b86d8d6
Merge remote-tracking branch 'origin/DFBR_notenook_revised' into DFBR…
ruqayya Nov 6, 2022
d3ec832
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Nov 6, 2022
dbc5ad8
Add example for AffineWSITransformer.
ruqayya Nov 6, 2022
19d2fba
Merge remote-tracking branch 'origin/DFBR_notenook_revised' into DFBR…
ruqayya Nov 6, 2022
363939e
Merge branch 'develop' into DFBR_notenook_revised
ruqayya Nov 6, 2022
c386b4c
Update README.md for registration notebook.
ruqayya Nov 6, 2022
e91498a
Merge remote-tracking branch 'origin/DFBR_notenook_revised' into DFBR…
ruqayya Nov 6, 2022
ccc1bd8
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Nov 6, 2022
5aad89f
Update tiatoolbox/tools/registration/wsi_registration.py
ruqayya Nov 14, 2022
ba2d0a7
Update tiatoolbox/tools/registration/wsi_registration.py
ruqayya Nov 14, 2022
aee147b
Update tiatoolbox/tools/registration/wsi_registration.py
ruqayya Nov 14, 2022
e03db78
Update tiatoolbox/tools/registration/wsi_registration.py
ruqayya Nov 14, 2022
3da4099
Update comments.
ruqayya Nov 14, 2022
a27d716
Merge remote-tracking branch 'origin/DFBR_notenook_revised' into DFBR…
ruqayya Nov 14, 2022
e5ad862
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Nov 14, 2022
bbaee4d
Delete notebook and update README.md
ruqayya Nov 22, 2022
6fe3432
Merge branch 'dev-DFBR' of https://github.com/TissueImageAnalytics/ti…
ruqayya Nov 22, 2022
cd3b666
Update tiatoolbox/tools/registration/wsi_registration.py
ruqayya Nov 22, 2022
ad6bee8
Update tiatoolbox/tools/registration/wsi_registration.py
ruqayya Nov 22, 2022
1d876a7
Update tiatoolbox/tools/registration/wsi_registration.py
ruqayya Nov 22, 2022
5569eb7
Update tiatoolbox/tools/registration/wsi_registration.py
ruqayya Nov 22, 2022
c4d3261
Update tiatoolbox/tools/registration/wsi_registration.py
ruqayya Nov 22, 2022
b977946
Update tiatoolbox/tools/registration/wsi_registration.py
ruqayya Nov 22, 2022
4367bce
Update tiatoolbox/tools/registration/wsi_registration.py
ruqayya Nov 22, 2022
cfc26f7
Update tiatoolbox/tools/registration/wsi_registration.py
ruqayya Nov 22, 2022
6ad50b5
Update tiatoolbox/tools/registration/wsi_registration.py
ruqayya Nov 22, 2022
c26f108
Update tiatoolbox/tools/registration/wsi_registration.py
ruqayya Nov 22, 2022
ccbd8f1
Merge branch 'develop' into dev-DFBR
shaneahmed Nov 25, 2022
0ecd233
Merge branch 'develop' into dev-DFBR
shaneahmed Nov 25, 2022
7a573bb
Rename wsi_reader as reader.
ruqayya Nov 27, 2022
347a6b7
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Nov 27, 2022
90bd7fb
Doc: Modified Returns section for consistency.
ruqayya Nov 29, 2022
faa2050
Merge remote-tracking branch 'origin/dev-DFBR' into dev-DFBR
ruqayya Nov 29, 2022
8c7f67f
DOC: Update documentation for get_tissue_regions
shaneahmed Nov 30, 2022
0d6d2f1
REV: Restore files from develop
shaneahmed Nov 30, 2022
6771d29
DOC: Fix indent for documentation
shaneahmed Nov 30, 2022
57ee43b
DOC: Fix indent for documentation
shaneahmed Nov 30, 2022
98a1642
Merge branch 'develop' into dev-DFBR
shaneahmed Dec 6, 2022
d1aa24c
:bug: DEV: Fix tests for transformation
shaneahmed Dec 9, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 21 additions & 2 deletions tests/test_wsi_registration.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import pytest

from tiatoolbox.tools.registration.wsi_registration import (
AffineWSITransformer,
DFBRegister,
apply_bspline_transform,
estimate_bspline_transform,
Expand All @@ -13,6 +14,7 @@
)
from tiatoolbox.utils.metrics import dice
from tiatoolbox.utils.misc import imread
from tiatoolbox.wsicore.wsireader import WSIReader


def test_extract_features(dfbr_features):
Expand Down Expand Up @@ -338,7 +340,7 @@ def test_register_output_with_initializer(
pre_transform = np.array([[-1, 0, 337.8], [0, -1, 767.7], [0, 0, 1]])

expected = np.array(
[[-0.99683, -0.00333, 338.69983], [-0.03201, -0.98420, 770.22941], [0, 0, 1]]
[[-0.98454, -0.00708, 397.95628], [-0.01024, -0.99752, 684.81131], [0, 0, 1]]
)

output = df.register(
Expand All @@ -363,7 +365,7 @@ def test_register_output_without_initializer(

df = DFBRegister()
expected = np.array(
[[-0.99683, -0.00189, 336.79039], [0.00691, -0.99810, 765.98081], [0, 0, 1]]
[[-0.99863, 0.00189, 389.79039], [0.00691, -0.99810, 874.98081], [0, 0, 1]]
)

output = df.register(
Expand Down Expand Up @@ -462,3 +464,20 @@ def test_bspline_transform(fixed_image, moving_image, fixed_mask, moving_mask):
registered_msk = apply_bspline_transform(fixed_msk, moving_msk, transform)
mask_overlap = dice(fixed_msk, registered_msk)
assert mask_overlap > 0.75


def test_affine_wsi_transformer(sample_ome_tiff):
location = (1000, 600) # at base level 0
resolution = 0
size = (100, 100)

wsi_reader = WSIReader.open(input_img=sample_ome_tiff)
expected = wsi_reader.read_rect(
location, size, resolution=resolution, units="level"
)

transform_level0 = np.eye(3)
tfm = AffineWSITransformer(wsi_reader, transform_level0)
output = tfm.read_rect(location, size, resolution=resolution, units="level")

assert np.sum(expected - output) == 0
Loading