Skip to content

Commit

Permalink
Merge pull request #3 from daangeijs/stream_tiles
Browse files Browse the repository at this point in the history
Fix folder nesting
  • Loading branch information
daangeijs authored Sep 15, 2023
2 parents 2ec61f8 + b8b0ac5 commit 536bf79
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 9 deletions.
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,13 @@ To run the Whole Slide Image Viewer, follow these steps:
This will spin up the Django application. You can then navigate to the provided local URL in your web browser to access the image viewer interface.

## Screenshots
![List example](examples/list.png)
![Viewer example](examples/slide_view.png)
### List folder contents
![List mode](examples/list_catalog.png)
### Catalog of folder contents
![Tile mode](examples/tile_catalog.png)
### Viewer with navigation
![Viewer example](examples/viewer.png)



## Contributing:
Expand Down
Binary file added examples/list_catalog.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/tile_catalog.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/viewer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 10 additions & 7 deletions viewer/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,19 +113,22 @@ def __init__(self, basedir, relpath=''):
relpath = Path(relpath)
self.name = relpath.name
self.children = []
for child in sorted((Path(basedir) / relpath).iterdir()):
for child in sorted((Path(basedir) / relpath).glob('*A15.tif')):
cur_relpath = relpath / child.name
if child.is_dir():
cur_dir = _Directory(basedir, cur_relpath)
if cur_dir.children:
self.children.append(cur_dir)
elif OpenSlide.detect_format(child):
#Todo: Disable folder nesting for now

# if child.is_dir():
# cur_dir = _Directory(basedir, cur_relpath)
# if cur_dir.children:
# self.children.append(cur_dir)

if OpenSlide.detect_format(child):
self.children.append(_SlideFile(cur_relpath))


class _SlideFile:
def __init__(self, relpath):
self.name = os.path.basename(relpath)
self.name = relpath.name
self.url_path = relpath

import pyvips
Expand Down

0 comments on commit 536bf79

Please sign in to comment.