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

loading high resolution images #32

Open
beata-malachowska opened this issue Dec 2, 2024 · 3 comments
Open

loading high resolution images #32

beata-malachowska opened this issue Dec 2, 2024 · 3 comments

Comments

@beata-malachowska
Copy link

Hi,
thank you for creating this tool, it's great! I managed to run the pipeline, for some samples I have very big original photo, and OpenCV gives me error while trying to run b2c.scaled_he_image. I tried increasing the allowed memory by: cv2.MAX_IMAGE_PIXELS = None, but it doesn't help. Decreasing the size of the image is also not possible as it gets mismatch with original Spaceranger output. Is there a way to load the image with different tool like Pillow in order to properly run scaled_he_image? Or should I rerun spaceranger with downgraded image?

@ktpolanski
Copy link
Contributor

Bin2cell increases the cv2 load limit as part of its code. Last time this happened (#18, at the bottom), I'm pretty sure the user was loading cv2 before loading b2c and that resulted in the config not applying properly. That issue has a different thing going on as well, where a different user was trying to load a non-RGB image and that was sending cv2 into some strange realms where the config wasn't working.

Try loading b2c before loading cv2 (in a restarted session of course). If that fails, identify (from ImageMagick, available from conda) the image. If nothing turns out to be amiss yet you keep having problems, come back with the cv2 error and the identify output. Worst case scenario we can modify the function to just load with PIL.

@beata-malachowska
Copy link
Author

Thank you so much for fast response. It worked!

@ktpolanski
Copy link
Contributor

It what, loading b2c before cv2?

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