Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes overview
Bigtiff Problem
In order to save tiff image that is bigger than 4GBs, you need to save them as bigtiff.
tifffile
library automatically saves it as a bigtiff for you, but ONLY if the compression is turned off.###Potential solutions
Option 1
Always save as bigtiff
Pros:
Cons:
Almost 30MB bigger file for bigtiff:
Option 2
Check whether image is bigger than 4GB, and only then save as bigtiff.
Pros:
Cons:
tifffile
Option 3
Try to save as bigfile only on failure.
Pros:
Cons:
struct.error
is not very specificSummary
I'm finding Option 3 by far the most reasonable, since it will affect only files that currently fails.
Time cost for the solution is acceptable and we've never came across any other
struct.error
s since we're working with compressed ome.tiff files.