Re: [ImageJ-devel] Save/write image with SCIFIO/BF in python script

2015-01-26 Thread Hadrien Mary
The weird thing is if I manually save the cropped image with BF exporter. It works, OME XML string is correct and the cropped image can be easly re-opened (and I don't know why but BF exporter image size is huge (40MB) for and original image of 1.9MB). -- Hadrien Mary Ph.D student in Biology Tour

Re: [ImageJ-devel] Save/write image with SCIFIO/BF in python script

2015-01-26 Thread Hadrien Mary
It appears that I have the same behaviour using 'ij.op().crop()'. So in short, my script works well for croping but saving the cropped image on disk totally failed. In appearence it works but if you try to open the image, axes (other than X and Y) are merged and it seems that only the first image

Re: [ImageJ-devel] Save/write image with SCIFIO/BF in python script

2015-01-25 Thread Hadrien Mary
I am now using 'ij.op().crop()' which works well. I also test fix-cell branch with my previous code (using SCIFIOConfig and ImageRegion) which fix the save issue (both with ImgSaver and DatasetService). However cropped image histogram is very different from the original. This issue appears only w

Re: [ImageJ-devel] Save/write image with SCIFIO/BF in python script

2015-01-25 Thread Mark Hiner
Hi Hadrien, >I tried to use another method to save cropped images using DatasetService: I couldn't reproduce this failure.. it works for me using the DatasetService. Do you have any local changes? Did you update your Fiji to the latest version? If you're still having problems, you could also copy

Re: [ImageJ-devel] Save/write image with SCIFIO/BF in python script

2015-01-24 Thread Hadrien Mary
Quick update: I tried to use another method to save cropped images using DatasetService: --- # Create dataset ds = data.create(imp) # Save cropped image data.save(ds, crop_fname) - And the error is exactly the same as before. -- Hadrien Mary Ph.

Re: [ImageJ-devel] Save/write image with SCIFIO/BF in python script

2015-01-19 Thread Hadrien Mary
Hi again, The script works well for small images (OME Tiff or normal Tiff) with the recent Fiji update. However when I run it on large movies (13GB), I have the following error. -- -- Classpath of ClassLoader -- /home/hadim/local/Fiji.app/pl

Re: [ImageJ-devel] Save/write image with SCIFIO/BF in python script

2015-01-14 Thread Hadrien Mary
I confirm it works ! Thanks again -- Hadrien Mary Ph.D student in Biology Tournier-Gachet Team CNRS - LBCMCP - UMR 5088 Université de Toulouse - Bât. 4R3B1 118, route de Narbonne - 31062 Toulouse On Wed, Jan 14, 2015 at 3:32 PM, Mark Hiner wrote: > Hi Hadrien, > >>Exception in thread "DrawAn

Re: [ImageJ-devel] Save/write image with SCIFIO/BF in python script

2015-01-14 Thread Mark Hiner
Hi Hadrien, >Exception in thread "DrawAndDrop" java.lang.NoSuchMethodError: >io.scif.ImageMetadata.setAxisLength(Lnet/imglib2/meta/AxisType;J)V Ah sorry - my fault again for responding too quickly. ImageJ.git doesn't have a dependency on scifio-ome-xml; it's a dependency in Fiji itself[1]. So whe

Re: [ImageJ-devel] Save/write image with SCIFIO/BF in python script

2015-01-14 Thread Hadrien Mary
Ok it makes sense now ! So I did what you told me about cloning imagej repo, building and install it with maven inside my local Fiji.app/. I don't know if it's a bug or a missing dependency but I am now unable to open OME Tiff files (other kind of file works well) wether it is by drag and drop or

Re: [ImageJ-devel] Save/write image with SCIFIO/BF in python script

2015-01-14 Thread Mark Hiner
Hi Hadrien, >Sorry if it's off topic but I tried to run my script and I got a python error Oh no! This is totally my fault. I had to update your script for the new dependencies I mentioned and forgot to paste the new version in my response yesterday: >from net.imglib2.meta import Axes This impo

Re: [ImageJ-devel] Save/write image with SCIFIO/BF in python script

2015-01-13 Thread Hadrien Mary
Thank you Mark ! Sorry if it's off topic but I tried to run my script and I got a python error probably related to type difference between python and java. It's not the first time I saw this kind of message and I'd like to know how to resolve it. Note that for python script I mainly use javadoc as

Re: [ImageJ-devel] Save/write image with SCIFIO/BF in python script

2015-01-13 Thread Mark Hiner
Hi Hadrien, Unsurprisingly, cropping and writing OME-TIFFs was quite broken. It's working for me now, as of the latest SCIFIO[1] and SCIFIO-OME-XML[2]. Note that these libraries have updated dependencies compared to what's currently on Fiji, so you can't just drop these .jars into your Fiji ins

Re: [ImageJ-devel] Save/write image with SCIFIO/BF in python script

2015-01-10 Thread Hadrien Mary
Ok. Let me know when you want me to test your changes. I also tested fix-writing branch and I didn't notice any changes. -- Hadrien Mary Ph.D student in Biology Tournier-Gachet Team CNRS - LBCMCP - UMR 5088 Université de Toulouse - Bât. 4R3B1 118, route de Narbonne - 31062 Toulouse On Fri, Jan

Re: [ImageJ-devel] Save/write image with SCIFIO/BF in python script

2015-01-09 Thread Mark Hiner
Hi Hadrien, I've identified at least two bugs that could be affecting you here. First of all, there was a bug in the OME-TIFF format writing out multi-dimensional images. That's fixed on a branch but not uploaded to Fiji yet [1]. Second, it seems like cropping is restricting pixel reads to the c

Re: [ImageJ-devel] Save/write image with SCIFIO/BF in python script

2015-01-09 Thread Hadrien Mary
I also confirm the same behaviour when replacing original file by OME sample data : http://www.openmicroscopy.org/Schemas/Samples/2013-06/bioformats-artificial/multi-channel-4D-series.ome.tif.zip. -- Hadrien Mary Ph.D student in Biology Tournier-Gachet Team CNRS - LBCMCP - UMR 5088 Université d

Re: [ImageJ-devel] Save/write image with SCIFIO/BF in python script

2015-01-09 Thread Hadrien Mary
After some investigations I think there is a bug with ImgSaver. In the following script, X, Y crop is fine but axes informations (T and Z) are lost and all frames appears on the same axes. Now if I replace "target = "/home/hadim/cropped.tif" by "target = "/home/hadim/cropped.ome.tif" on line 9. X,

Re: [ImageJ-devel] Save/write image with SCIFIO/BF in python script

2015-01-08 Thread Hadrien Mary
Thanks for the tip (reminder to me: always look for example in tests!). Unfortunately crop does not work... I will try to do more tests tomorrow or wait for you or someone else to have a look. Updated code: from ij import IJ from ij import ImagePlus from io.scif import SCIFIO from io.scif.confi

Re: [ImageJ-devel] Save/write image with SCIFIO/BF in python script

2015-01-08 Thread Curtis Rueden
Hi Hadrien, > I would like to be able to crop a region in X and Y while > keeping any other dimensions which could exist (C, Z, T). Here's some Java: int minX = 128, maxX = 255, minY = 128, minY = 255; AxisType[] axes = { Axes.X, Axes.Y }; String[] ranges = { minX + "-" + maxX, minY

Re: [ImageJ-devel] Save/write image with SCIFIO/BF in python script

2015-01-08 Thread Hadrien Mary
After some investigations, I'm pretty sure I don't instanciate ImageRegion correctly. Doc and source code didn't help me... I would like to be able to crop a region in X and Y while keeping any other dimensions which could exist (C, Z, T). -- Hadrien Mary On Thu, Jan 8, 2015 at 10:22 PM, Hadrie

Re: [ImageJ-devel] Save/write image with SCIFIO/BF in python script

2015-01-08 Thread Hadrien Mary
Thank you Curtis for the answer. I tried to apply what you told me and the code now works without error. However the saved cropped image is not cropped (same size as original) and pixel values are modified). Script: from io.scif.config import SCIFIOConfig from io.scif.img import ImageRegion from

Re: [ImageJ-devel] Save/write image with SCIFIO/BF in python script

2015-01-08 Thread Curtis Rueden
Hi Hadrien, > I tried to use SCIFIO to write cropped image on disk but it doesn not > work. The error you see is because SCIFIO operates on ImgLib2 data structures, not ImagePlus objects. > Is there is any “easy” alternative to BF setCropRegion function in > SCIFIO ? Yes: you create a SCIFIOCon

Re: [ImageJ-devel] Save/write image with SCIFIO/BF in python script

2015-01-08 Thread Hadrien Mary
I currently use setCropRegion option from BF.openImagePlus but I take any other option to crop image according to a roi instance. I didn't find how to do that in python. -- Hadrien Mary On Thu, Jan 8, 2015 at 9:18 PM, Hadrien Mary wrote: > Hi, > > I am writing a python macro which iterate over