Reading 1 pixel out of N in BigTIFF

Hi all,

We have rather large BigTiff files and I was looking for a way to read-in a subsampled version of the image, by loading only one pixel out of 10 or out of 2.

I am looking at the RAW import and have already asked Bio-Formats for some assistance, but would appreciate the input of the community here if someone has tackled or knows how to tackle something like this.

Best

Oli

1 Like

Feeling alone but I decided to reply to my own thread.

While this is not directly ImageJ-linked here’s what I did to make it work in my case.

I created a small C# program that takes a Tiled BigTIFF file and downsamples it on the fly.

It makes use of the wonderful LibTiff library, implemented in C# by BitMiracle

This was built using Visual Studio Community 2017

I have made it available on GitHub

Coming from the macro language world I am always baffled at the speed of compiled languages.

A quick benchmark

18GB BigTiff image (84’800 x 68’800 px ) downsampled 16 times takes about 7 second to finish. (5’300 x 4’300 px)

Limitations

I built this needing a fast way to downsample very large files acquired as Tiled BigTiff files from one of our Olympus Microscopes, and performs as expected for me, compiled for Windows 10.

As of right now the images are uncompressed, which makes accessing each pixel very easy and fast.

If anyone is interested in the version that I have compiled (the executable), I can send it over (or someone can recommend a good practice for this kinf od thing), and you’ll need to download LibTiff.Net from the link above.

3 Likes