[ome-devel] BF exporter create big ome.tif file
Melissa Linkert
melissa at glencoesoftware.com
Tue Jan 27 18:21:29 GMT 2015
Hi Hadrien,
> Is that an excepted behaviour ? If it does not, should I open a ticket for it ?
The Bio-Formats exporter behavior is expected.
> Is this behaviour to add colormap to each plane a feature or a bug of
> SCIFIO ? If it is a bug should I report it to SCIFIO or you guys take
> care of it ?
I don't know if that is the expected behavior during import; as that's
not part of Bio-Formats, you would need to contact the SCIFIO developers
to find out if it should be fixed.
Regards,
-Melissa
On Tue, Jan 27, 2015 at 06:56:16PM +0100, Hadrien Mary wrote:
> Thank you Melissa. Unfortunately the trick with "Stack to Hyperstack"
> and "Hyperstack to Stack" is failing sometime (I don't know why)...
> Anyway I wrote a small python script which just load the file and save
> it while preserving the OME XML string and it seems to work pretty
> well. I paste it at the end of this mail.
>
> Is this behaviour to add colormap to each plane a feature or a bug of
> SCIFIO ? If it is a bug should I report it to SCIFIO or you guys take
> care of it ?
>
> -------------------------
> %load_ext autoreload
> %autoreload 2
>
> import os
> import gc
>
> # Just load tifffile.py from somewhere
> from sktracker.io import TiffFile, imsave
>
> data_path = "/home/hadim/Documents/phd/data/test"
>
> for root, dirs, files in os.walk(data_path):
> for f in files:
> if f.endswith('ome.tif'):
> fname = os.path.join(root, f)
> print(fname)
> tf = TiffFile(fname)
> p = tf.pages[0]
>
> new_path = os.path.join(os.path.dirname(fname), "fixed",
> os.path.basename(fname))
> if not os.path.isdir(os.path.join(os.path.dirname(fname), "fixed")):
> os.makedirs(os.path.join(os.path.dirname(fname), "fixed"))
>
> imsave(new_path, tf.asarray(),
> description=p.tags['image_description'].value)
> del p
> del tf
> gc.collect()
> -------------------------------
More information about the ome-devel
mailing list