-
Notifications
You must be signed in to change notification settings - Fork 83
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
WIP: Add FsspecJsonWSIReader class. #897
base: develop
Are you sure you want to change the base?
Conversation
3805565
to
cbd657f
Compare
bfa8b4b
to
1bc2356
Compare
for more information, see https://pre-commit.ci
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #897 +/- ##
===========================================
- Coverage 99.90% 99.34% -0.57%
===========================================
Files 70 71 +1
Lines 8735 8852 +117
Branches 1149 1163 +14
===========================================
+ Hits 8727 8794 +67
- Misses 3 50 +47
- Partials 5 8 +3 ☔ View full report in Codecov by Sentry. |
tiatoolbox/wsicore/wsireader.py
Outdated
Args: | ||
path (Path): Path to the file to check. | ||
# TODO extend logic and verify that json file is a fsspec tiff file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a link to tiff-fsspec generator file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The method is migrated to:
FsspecJsonWSIReader.is_valid_zarr_fsspec(file_path: str) -> bool:
I've extended the docs and added a link to tiff-to-fsspec generator file.
tiatoolbox/wsicore/wsireader.py
Outdated
@@ -4225,6 +4246,528 @@ class docstrings for more information. | |||
return im_region | |||
|
|||
|
|||
class ZarrTIFFWSIReader(WSIReader): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please change to appropriate name e.g., fsspecWSIReader.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed to FsspecJsonWSIReader.
tiatoolbox/wsicore/wsireader.py
Outdated
@@ -4225,6 +4246,528 @@ class docstrings for more information. | |||
return im_region | |||
|
|||
|
|||
class ZarrTIFFWSIReader(WSIReader): | |||
"""Define Zarr Tiff WSI Reader.""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add some documentation / introduction about the fsspec / json files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added documentation and the link to tiff_to_fsspec.py.
for more information, see https://pre-commit.ci
tiatoolbox/utils/tiff_fsspec.py
Outdated
@@ -0,0 +1,147 @@ | |||
"""Module for processing SVS metadata and generating fsspec JSON file.""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be useful to add some description about why we need fsspec JSON file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've included a more detailed description and cleaned up the script.
I've working to bring the PR to the state when it's "Ready for review". It will require some more effort.
The FsspecJsonWSIReader reads fsspec json file which represents SVS wsi.
The methods: read_rect, read_bounds, _canonical_shape are copied from TIFFWSIReader, and it needs to be improved by introducing delegates or some other way.
The method infor reads SVS metadata which is stored in the root group metadata like:
To test, execute from the root dir:
Change the svs variable inside of
tileserver.py
to:svs = "../../samples/fsspec/73c69d24-6f9e-44e2-bfe5-a608d4cf5c27_fsspec.json"
python tileserver.py
Open
http://127.0.0.1:5000/
and verify how it works.