Comments (5)
I actually know the total number of frames. In this case, is it possible to write chunks of frames at once to the same series (not frame by frame)?
If you don't need the tifffile metadata, try:
with TiffWriter('video.tif') as tif:
for chunk_of_frames in video:
tif.save(chunk_of_frames, contiguous=True, metadata=None)
Otherwise provide a generator of frames (not tested):
def frames():
for chunk_of_frames in video:
for frame in chunk_of_frames:
yield frame
imwrite('video.tif', frames(), shape=video.shape, dtype=video.dtype)
from tifffile.
If the number of frames is unknown before, the only way to achieve that is to write frame by frame to an open TiffWriter instance in contiguous mode:
with TiffWriter('video.tif') as tif:
for frame in video:
tif.save(frame, contiguous=True)
from tifffile.
@cgohlke thanks for the quick reply!
I actually know the total number of frames. In this case, is it possible to write chunks of frames at once to the same series (not frame by frame)?
from tifffile.
Thanks! I'll try these solutions and let you know :)
from tifffile.
The first solution did the trick :)
Thanks!
from tifffile.
Related Issues (20)
- `imwrite` Produces Unexpected Output for uint16 Numpy Arrays with Shape (height, width) HOT 4
- Saving a 4D array where one of the dimensions is 3 or 4 moves that axis as last HOT 6
- Memory usage when writing tif with `tifffile.TiffWriter.write` HOT 2
- Modify image data, keeping everything else (metadata) intact HOT 1
- `ndarray.newbyteorder` is no longer available in NumPy 2.0 HOT 2
- Backwards compatibility issue with tile writing HOT 1
- question: is this package dependent on Libtiff? HOT 1
- saving a imagej hyperstack with a single channel removes the channel number form the tiff metadata HOT 2
- Running tests or linters on Github actions HOT 1
- Create svs file with image pyramid, label and macro in tifffile? HOT 3
- imread specify channels HOT 2
- Writing ome.tiff HOT 1
- API for deleting tiff tags HOT 1
- How to compress 10GB tiff? HOT 1
- Remove Specific Level HOT 1
- KeyError on write_fsspec of ZarrTiffStore HOT 2
- Limitations of Python 2.7 version HOT 1
- accessing Sentinel-1 SLC tiff measurement through S3 procotol HOT 2
- NumPy 2.0 support HOT 2
- IndexError: index 1 is out of bounds for axis 0 with size 1 HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tifffile.