Page 1 of 1

Resize/resample large image?

PostPosted: Thu Sep 15, 2016 12:30 pm
by darwinjob
Hi
Can I scale down a large image using bio-formats library? Without loading the whole image into the memory ?

Re: Resize/resample large image?

PostPosted: Mon Sep 19, 2016 8:49 am
by szleo
Hi,

Bio-Formats does not currently have a rescaling feature, although you can use the API to write a program that reads all image planes as byte arrays, rescales them and writes them back in the OME-TIFF format.

Another option would be to use the bfconvert tool to save image planes as TIFF files, rescale them with an external tool (such as ImageMagick) and stitch them back to an OME-TIFF. Suppose you have a Z stack with multiple channels:

Code: Select all
mkdir planes planes_small
./bfconvert IMG.ext planes/plane_Z%z_C%c.tiff
ls -1 planes | while read f; do
  convert ${f} -resize 128x128 planes/${f} planes_small/${f};
done
./bfconvert -stitch planes_small/plane_Z0_C0.tiff IMG.ome.tif

Re: Resize/resample large image?

PostPosted: Mon Sep 19, 2016 2:19 pm
by darwinjob
I see, thanks!