OSError: Unable to determine file type or type not supported for bip image
See original GitHub issueI have fluorescent microscopy data saved as BIP file and I would like to load it to python. I was following the documentation with:
from spectral import *
img = open_image('path_to_file/Frgrnd.bip')
but I’m getting an error:
~/anaconda3/lib/python3.8/site-packages/spectral/spectral.py in open_image(file)
117 pass
118
--> 119 raise IOError('Unable to determine file type or type not supported.')
120
121
OSError: Unable to determine file type or type not supported.
Where is the problem and how can I fix it? I’m using: spectral 0.22.1 last updated: Fri Jan 29 2021
CPython 3.8.5 IPython 7.18.1 watermark 2.0.2
Thank you.
Issue Analytics
- State:
- Created 3 years ago
- Comments:15 (8 by maintainers)
Top Results From Across the Web
Cannot determine type of file - python - Stack Overflow
When i tried to open an image that i downloaded from the net, I keep getting this error and I have no idea...
Read more >Re: Error message when uploading images - 343761
Hello , Without seeing the actual file saved on your computer, it's possible the encoding of the file type is incorrect. You will...
Read more >Image file formats - Pillow (PIL Fork) 9.3.0 documentation
BLP is the Blizzard Mipmap Format, a texture format used in World of Warcraft. Pillow supports reading JPEG Compressed or raw BLP1 images,...
Read more >Troubleshooting guide for using BI Publisher with Oracle ...
Check the template size. Large file sizes (eg due to images within the document) require more memory allocation. If in doubt, remove images...
Read more >OSError: Can't read data - unexpectedly large 'bytes ... - GitHub
This happens when reading different h5ad datasets (e.g. is not specific to one dataset). At all times there seems to be enough free...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
“.bip” isn’t a recognized image file extension so try to open it explicitly like this:
If the file extension is “.bip”, you should stick with BIP, though in the case of a single band, it doesn’t even matter which interleave you choose. An offset of 2463 seems highly unlikely (I would expect it to be a multiple of 4). For now, I would stick with either 0 or 29132 as the offset.
The image you displayed doesn’t look inherently wrong but it appears to be only be showing two colors so maybe the image is just saturated. You should take a look at the histogram of the data to see if there is a large range in the data and possibly some extreme outliers. If you use the
spectral.imshow
function, you can try clipping the histogram using the “stretch” kwarg to see if that makes a difference. You want to set the stretch limits to where most of the “good” data resides. For example, to apply a linear stretch between the 0.1 and 0.9 percentiles of the data, you could useDepending on how many of the pixels lie in the tails of the distribution, you may need to adjust the stretch limits accordingly.