Extract n number of channels with bfconvert


I have a nd2 with n Series, 6 channels, 23Zs.

I could like to create tiff files with the first 3 channels and another with the last 3 channels.
bfconvert however only extracts one at a time.

would I have to do
bfconvert -channel 0 file.nd2 file_c0.tiff
bfconvert -channel 1 file.nd2 file_c1.tiff
bfconvert -channel 2 file.nd2 file_c2.tiff

and then bfconvert -stitch file_c<0-2>.tiff output_012.tiff? Wouldn’t this just stitch in XY?

Any solutions?

Depending on the dimension order you might be able to use the range function:

bfconvert -range 0 68 file.nd2 file_1.tiff
bfconvert -range 69 137 file.nd2 file_1.tiff

The other alternative would be to split each channel and then create a pattern file for the stitching:
bfconvert file.nd2 file_C%c0.tiff
and then create file_1.pattern which would contain file_C<0-2>.tiff and a second pattern for the second grouping.

1 Like

Thank you.

The 2nd option seems simpler!