question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Failing to pull Girder Tile Source - CCIPD lab project

See original GitHub issue

Here is sample code which is not working:

import girder_large_image
import girder_client
import large_image
import json
gc = girder_client.GirderClient(apiUrl='http://localhost:8080/api/v2')
gc.authenticate(username='admin', password='password')
item = gc.getItem('6204344429b98b9caa33c7ec')
print(item)
ts = girder_large_image.girder_tilesource.GirderTileSource(item)
ts_metadata = ts.getMetadata()
print(json.dumps(ts_metadata, indent=2))
is_wsi = ts_metadata['magnification'] is not None
print("WSI ", is_wsi)
print(ts.getSingleTile())

We used this svs file: https://styx.neurology.emory.edu/girder/#item/60df5a4c68f4fe34fc7e92d2

Here is the printout and error message:

{‘_id’: ‘6204344429b98b9caa33c7ec’, ‘_modelType’: ‘item’, ‘baseParentId’: ‘61dd35a75ef164ec2f932d35’, ‘baseParentType’: ‘collection’, ‘created’: ‘2022-02-09T21:38:12.879000+00:00’, ‘creatorId’: ‘61dd3564bd467a0ab2a0244c’, ‘description’: ‘’, ‘folderId’: ‘6204340929b98b9caa33c7ea’, ‘largeImage’: {‘fileId’: ‘6204344429b98b9caa33c7ed’, ‘sourceName’: ‘openslide’}, ‘meta’: {}, ‘name’: ‘girder-test.svs’, ‘size’: 134394101, ‘updated’: ‘2022-02-09T21:38:12.879000+00:00’}

Using python for large_image caching

None

{ “levels”: null, “sizeX”: null, “sizeY”: null, “tileWidth”: null, “tileHeight”: null, “magnification”: null, “mm_x”: null, “mm_y”: null }

WSI False

Traceback (most recent call last):
  File "/Users/varunverma/Desktop/playground/test.py", line 23, in <module>
    print(ts.getSingleTile())
  File "/usr/local/lib/python3.9/site-packages/large_image/tilesource/base.py", line 2241, in getSingleTile
    return next(self.tileIterator(*args, kwargs), None)
  File "/usr/local/lib/python3.9/site-packages/large_image/tilesource/base.py", line 2202, in tileIterator
    iterInfo = self._tileIteratorInfo(format=iterFormat, resample=resample,
  File "/usr/local/lib/python3.9/site-packages/large_image/tilesource/base.py", line 467, in _tileIteratorInfo
    magLevel = self.getLevelForMagnification(magArgs)
  File "/usr/local/lib/python3.9/site-packages/large_image/tilesource/base.py", line 2010, in getLevelForMagnification
    mag = self.getMagnificationForLevel()
  File "/usr/local/lib/python3.9/site-packages/large_image/tilesource/base.py", line 1982, in getMagnificationForLevel
    if mag.get('level') == self.levels - 1:

TypeError: unsupported operand type(s) for -: 'NoneType' and 'int'

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:13 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
mantheycommented, Feb 10, 2022

Are you installing any sources in your python environment? That is, did you either do pip install large_image[sources] or specify an explicit source? I’m guessing that this might occur if no sources are installed.

1reaction
mantheycommented, Feb 10, 2022

If your algorithm specifies the image (e.g., https://github.com/DigitalSlideArchive/HistomicsTK/blob/master/histomicstk/cli/NucleiDetection/NucleiDetection.xml#L14-L20), the girder_worker module ensures that the image is local to the running job and passes a path that will access it as a command line argument (as args.inputImageFile if you are using CLIArgumentParser().parse_args()). Inside the algorithm, you would then use large_image.open(args.inputImageFile).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Center for Computational Imaging and Personalized Diagnostics
Mission. The Center of Computational Imaging and Personalized Diagnostics (CCIPD) at Case Western Reserve University is involved in various different aspects of ...
Read more >
Untitled - Snap!
... familiar,failed,canadian,efficient,valuable,limit,comfort,procedure,noted,facts,fruit,mom,bigger,ancient,citizens,pull,adults,agencies,agreed,commitment ...
Read more >
14th European Congress on Digital Pathology - PMC - NCBI
The focus of current research in his lab is on developing novel computational pathology algorithms with applications to computer-assisted ...
Read more >
Ezp - River Thames Conditions - Environment Agency - GOV.UK
Senses fail still searching album cover, Tantilla capistrata, Pink kits fifa 16? ... Cite the same source multiple times, Webafrica email server, ...
Read more >
NPE Status Report 11-6-20 - GDOT
refurbishment projects, compensates cross section loss of corroded ... comprised of W-beam and Thrie beam shaped rail elements and uses a C ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found