[ome-users] Passing a file pattern to the high-level Bio-Formats API

Sebastien Besson (Staff) s.besson at dundee.ac.uk
Mon Dec 11 16:20:26 GMT 2017


Hi Curtis and everyone,

for anyone following this conversation, the changes described below have being turned
into an open Pull Request against Bio-Formats [1] where the conversation will likely
happen. Thanks for opening this Curtis, we can probably discuss it in person in Dresden
in the next few days.

As as side comment, a workaround with the current version of Bio-Formats might be to
store the file pattern string into a pattern file [2] and point at this pattern file in the IJ import
process.

Best,
Sebastien

[1] https://github.com/openmicroscopy/bioformats/pull/3019
[2] http://docs.openmicroscopy.org/bio-formats/5.7.2/formats/pattern-file.html

On 10 Dec 2017, at 15:21, Curtis Rueden <ctrueden at wisc.edu<mailto:ctrueden at wisc.edu>> wrote:

Hi everyone,

We are hacking away in Dresden. A question from Christian Tischer arose: how can we use the loci.plugins.BF<http://loci.plugins.bf/> class to pass a file pattern directly?

Debugging into the code, at the initializeStack step, the id _is_ treated as an immutable file pattern, which is great [1]. But there is options flag for something like FilePattern.setUsingPatternIds(true), so just passing options.setId(pattern) bombs when initializing the file during an earlier phase of the ImportProcess.

It is possible to record a macro that approximates passing a custom file pattern. This ends up being something like:

IJ.run("Bio-Formats", "open=/Users/curtis/data/mri-stack/slice0005_mri-stack.tif autoscale color_mode=Default group_files rois_import=[ROI manager] view=Hyperstack stack_order=XYCZT axis_1_number_of_images=27 axis_1_axis_first_image=1 axis_1_axis_increment=1 contains=[] name=/Users/curtis/data/mri-stack/slice00<11-17>_mri-stack.tif");

However, then you cannot receive the resultant ImagePlus as an output; rather, it gets automatically shown.

What do you think is the best way forward to be able to pass file patterns directly to the high-level API here? Does the API need a tweak? Or did we miss something?

Thanks,
Curtis

[1] https://github.com/openmicroscopy/bioformats/blob/v5.7.2/components/bio-formats-plugins/src/loci/plugins/in/ImportProcess.java#L511-L515

--
Curtis Rueden
LOCI software architect - https://loci.wisc.edu/software
ImageJ2 lead, Fiji maintainer - https://imagej.net/User:Rueden
Did you know ImageJ has a forum? http://forum.imagej.net/

_______________________________________________
ome-users mailing list
ome-users at lists.openmicroscopy.org.uk<mailto:ome-users at lists.openmicroscopy.org.uk>
http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-users


The University of Dundee is a registered Scottish Charity, No: SC015096
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openmicroscopy.org.uk/pipermail/ome-users/attachments/20171211/25dfe2e0/attachment.html>


More information about the ome-users mailing list