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

self.wsi out of scope from patchgen? #17

Closed
nazim1021 opened this issue Nov 7, 2020 · 3 comments
Closed

self.wsi out of scope from patchgen? #17

nazim1021 opened this issue Nov 7, 2020 · 3 comments

Comments

@nazim1021
Copy link

Hello, I wanted to appreciate how well the problem and the solution has been formulated in the paper. Specifically generalization to multi-class MIL, its something most of us find it hard to crack. This paper will surely have lot of impact.
On that note, i m trying to run the patch extraction on one of mrxs slide. However, when i run below command

python create_patches.py --source DATA_DIRECTORY --save_dir RESULTS_DIRECTORY --patch_size 256 --seg --patch --stitch

It starts processing one slide, its able to extract patches but then i after get below error saying, the wsi file not found

patches extracted: 706
Bounding Box: 166152 126537 2497 26947
Contour Area: 36043328.0
Traceback (most recent call last):
File "create_patches.py", line 296, in
process_list = process_list, auto_skip=args.no_auto_skip)
File "create_patches.py", line 185, in seg_and_patch
file_path, patch_time_elapsed = patching(WSI_object = WSI_object, **current_patch_params)
File "create_patches.py", line 37, in patching
file_path = WSI_object.createPatches_bag_hdf5(**kwargs, save_coord=True)
File "/CLAM/wsi_core/WholeSlideImage.py", line 233, in createPatches_bag_hdf5
for patch in patch_gen:
File "
/CLAM/wsi_core/WholeSlideImage.py", line 291, in _getPatchGenerator
patch_PIL = self.wsi.read_region((x,y), patch_level, (patch_size, patch_size)).convert('RGB')
File "/usr/bin/python3.6/site-packages/openslide/init.py", line 229, in read_region
level, size[0], size[1])
File "/usr/bin/python3.6/site-packages/openslide/lowlevel.py", line 214, in read_region
_read_region(slide, buf, x, y, level, w, h)
File "/usr/bin/python3.6/site-packages/openslide/lowlevel.py", line 151, in _check_error
raise OpenSlideError(err)
openslide.lowlevel.OpenSlideError: Empty input file

Due to some reason, the self.wsi goes out of scope, any idea, what could be the problem?

@fedshyvana
Copy link
Collaborator

Hi, I have not actually encountered this problem before or seen it being reported so far. However, I have also not worked with a lot of .mrxs files.
Off the top of my head, it could be because of the "padding" option used (basically if the size of the patches does not divide into the dimensions of the WSI perfectly, the edges are padded). For now I would suggest editing one of the preset csv files (under presets/) you hope to use by setting the "use_padding" value from True to False, and then try to run the command with --preset flag, specifying the edited preset_file? If that does not solve the problem, I am happy to look into the issue if you share with me the slide that produces the error (although it might take me a couple of days to get to it).

@nazim1021
Copy link
Author

ah i see. Thanks for prompt response. I ll try out the presets option, otherwise i can share the mrxs slide later

@nazim1021
Copy link
Author

Hi tried, with presets False option and using bwh_biosy.csv, seems to be working now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants