We're Hiring!

Resize/resample large image?

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.

Resize/resample large image?

Postby darwinjob » Thu Sep 15, 2016 12:30 pm

Hi
Can I scale down a large image using bio-formats library? Without loading the whole image into the memory ?
darwinjob
 
Posts: 18
Joined: Mon Sep 16, 2013 11:58 am

Re: Resize/resample large image?

Postby szleo » Mon Sep 19, 2016 8:49 am

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
User avatar
szleo
 
Posts: 2
Joined: Wed Sep 02, 2015 10:42 am

Re: Resize/resample large image?

Postby darwinjob » Mon Sep 19, 2016 2:19 pm

I see, thanks!
darwinjob
 
Posts: 18
Joined: Mon Sep 16, 2013 11:58 am


Return to User Discussion [Legacy]

Who is online

Users browsing this forum: No registered users and 1 guest