问题
I've got two tiff stacks with time-lapse data corresponding to different channels acquired in a microscopy experiment. I'd like to merge them into a single stack with two channels. Both stacks are 16-bit greyscale.
When I use:
convert stack1.tiff stack2.tiff stack_merged.tiff
I get a single but concatenated file with two stacks one after another.
Links to file 1 and file 2.
回答1:
I think you need something like this:
#!/bin/bash
# Get index of last frame in TIFF image
last=$(convert stack1.tif -print "%[fx:n-1]" null:)
# Combine all frames
for i in `seq 0 $last`; do
convert stack1.tif[$i] stack2.tif[$i] -combine miff:-
done | convert miff:- -compress lzw result.tif
来源:https://stackoverflow.com/questions/40636814/combine-two-single-channel-tiff-stacks-to-a-single-multi-channel-stack