Concatenate multi-channel nd2 files with bfconvert
Posted: Wed Nov 16, 2016 10:44 pm
Hi,
I have trouble concatenating nd2 files with BF command-line tool, bfconvert (version 5.2.2). The two files I want to concatenate are time-lapse stacks with two channels.
Let's say I have:
file01.nd2 (T=10, C=2, Z=1)
file02.nd2 (T=20, C=2, Z=1)
I tried the following.
(1) Straightforward stitching:
bfconvert -bigtiff -stitch file01.nd2 file_cat.tiff
However, I obtain a stack with T=10, C=2, Z=2, instead of T=30, C=2, Z=1.
(2) Splitting both files into single-frame 2-channel tiffs with:
bfconvert -bigtiff -padded file01.nd2 file_T%t.tiff
Applying the same to file02.nd2 and shifting time index by 10 (number of frames in the 1st file), I have a series of tiffs:
file_T{00..29}
However, stitching yields a very strange concatenation with T=30, Z=2, where T=1..15 contains one channel and T=16-30 the other one.
(3) Finally I split both files into individual tiffs:
bfconvert -bigtiff -padded file01.nd2 file_C%c_T1%t.tiff
bfconvert -bigtiff -padded file02.nd2 file_C%c_T2%t.tiff
Then I use ImageMagick's convert to concatenate time series into a single TIFF separately for every channel. The trouble is that I cannot bring these two stacks into a single one because apparently libtiff, and thus IM, doesn't handle multi-channel images. BF's bfconvert doesn't help here either.
Is there any command-line tool/way to handle this?
I have trouble concatenating nd2 files with BF command-line tool, bfconvert (version 5.2.2). The two files I want to concatenate are time-lapse stacks with two channels.
Let's say I have:
file01.nd2 (T=10, C=2, Z=1)
file02.nd2 (T=20, C=2, Z=1)
I tried the following.
(1) Straightforward stitching:
bfconvert -bigtiff -stitch file01.nd2 file_cat.tiff
However, I obtain a stack with T=10, C=2, Z=2, instead of T=30, C=2, Z=1.
(2) Splitting both files into single-frame 2-channel tiffs with:
bfconvert -bigtiff -padded file01.nd2 file_T%t.tiff
Applying the same to file02.nd2 and shifting time index by 10 (number of frames in the 1st file), I have a series of tiffs:
file_T{00..29}
However, stitching yields a very strange concatenation with T=30, Z=2, where T=1..15 contains one channel and T=16-30 the other one.
(3) Finally I split both files into individual tiffs:
bfconvert -bigtiff -padded file01.nd2 file_C%c_T1%t.tiff
bfconvert -bigtiff -padded file02.nd2 file_C%c_T2%t.tiff
Then I use ImageMagick's convert to concatenate time series into a single TIFF separately for every channel. The trouble is that I cannot bring these two stacks into a single one because apparently libtiff, and thus IM, doesn't handle multi-channel images. BF's bfconvert doesn't help here either.
Is there any command-line tool/way to handle this?