We're Hiring!

.nd2 -> .tif conversion issues

Historical discussions about the Bio-Formats library. Please look for and ask new questions at https://forum.image.sc/tags/bio-formats
Please note:
Historical discussions about the Bio-Formats library. Please look for and ask new questions at https://forum.image.sc/tags/bio-formats

If you are having trouble with image files, there is information about reporting bugs in the Bio-Formats documentation. Please send us the data and let us know what version of Bio-Formats you are using. For issues with your code, please provide a link to a public repository, ideally GitHub.

.nd2 -> .tif conversion issues

Postby user » Wed Dec 14, 2016 10:51 am

I have various .nd2 files that I am trying to convert to .tiff or .ome.tiff using the bfconvert command line utility. Whereas all the files open without any problem using the bioformats import module of Fiji, the command line tool fails to convert them, for various reasons.

One file for instance (uploaded), having three channels and 22 z-planes per channel, fails conversion (bfconvert -channel 0 in.nd2 out.tif) with the following error: "Exception in thread "main" java.lang.IllegalArgumentException: Invalid image index: 24/22"
The bfconvert routine seems to misread the input file and tries to load more than 22 z-planes per channel.

For other files having a single channel and either multiple z-planes or multiple time points (but not both), the conversion completes without raising an error but the resulting TIFF stacks are clearly corrupted: while the first image in the series appears normal, the subsequent images appear as a 4-piece moving jigsaw. Each image in the converted stack comprises variably sized parts of four other planes which change in relative size and position, moving in a NW to SE direction, when scanning through the stack. There are also white and black horizontal lines appearing between the upper and lower two sub-images which move in a north to south direction. If the recommendations on how to avoid the problem described in the preceding paragraph do not also ameliorate this problem, then I will also post an example .nd2 file illustrating this specific behavior.

I again wish to emphasize that the files display normally when opened using the bioformats import module of Fiji, so the problem resides neither with the input .nd2 files nor the bioformats package per se, but rather with the command line utility bfconvert (or possibly my invocation thereof).


Edit: The second problem is resolved, at least in one instance, by writing to an .ome.tiff file rather than a .tiff file. Given that the output is 1D (either z or t), an ordinary tiff should work as well, so I am surprised that conversion succeeds only when OME-TIFF is selected as the output format.
user
 
Posts: 16
Joined: Wed Dec 14, 2016 5:17 am

Re: .nd2 -> .tif conversion issues

Postby dgault » Thu Dec 15, 2016 3:23 pm

Hi,

Thank you raising this issue and providing a sample file via QA.

I was able to test and reproduce the exception as you described, it does look like a bug in the conversion process. I have opened a bug tracking ticket https://trac.openmicroscopy.org/ome/ticket/13316#ticket for this issue and will need to investigate further to find out the root cause of the problem.

David
User avatar
dgault
Team Member
 
Posts: 208
Joined: Fri Aug 14, 2015 2:56 pm

Re: .nd2 -> .tif conversion issues

Postby user » Thu Dec 15, 2016 8:26 pm

Great, thanks for trying to resolve it.
user
 
Posts: 16
Joined: Wed Dec 14, 2016 5:17 am


Return to User Discussion [Legacy]

Who is online

Users browsing this forum: No registered users and 0 guests