-
Notifications
You must be signed in to change notification settings - Fork 82
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
Issue in patch extraction from images with more than 3 channels #610
Comments
We do not currently have support in place for multi-channel images as we have been focused on RGB bright-field imaging. However, we would love to add support for this and getting patch extraction working for multi-channel images would be a good start. I think the trickiest part would be to define how patches get written out to disk. Do you have a preferred format for this? Would a multi-channel TIFF or npy file be suitable for your needs? |
Maybe this should be left up to the user? as long as the patch_extractor returns a np array e.g. H,W,num_chans it should be good? |
|
Description
I was using (patchextractor=patchextraction.SlidingWindowPatchExtractor) to extract patches on images with 6 channels. Then when iterating over the patches using :
for patch in patchextractor:
#(some code ...)
the following erroroccur:
Traceback (most recent call last):
for patch in patchextractor:
File "//site-packages/tiatoolbox/tools/patchextraction.py", line 167, in next
return self[n]
File "//site-packages/tiatoolbox/tools/patchextraction.py", line 179, in getitem
return self.wsi.read_rect(
File "//site-packages/tiatoolbox/wsicore/wsireader.py", line 2846, in read_rect
return self._read_rect_at_resolution(
File "//site-packages/tiatoolbox/wsicore/wsireader.py", line 970, in _read_rect_at_resolution
return self.read_bounds(
File "///site-packages/tiatoolbox/wsicore/wsireader.py", line 3057, in read_bounds
return utils.transforms.background_composite(image=im_region)
File "///site-packages/tiatoolbox/utils/transforms.py", line 41, in background_composite
image = Image.fromarray(image)
File "/****/site-packages/PIL/Image.py", line 3083, in fromarray
raise TypeError(msg) from e
TypeError: Cannot handle this data type: (1, 1, 6), |u1
The text was updated successfully, but these errors were encountered: