<div dir="ltr">Hi Aryeh,<div><br></div><div><div>> I originally tried:</div><div>></div><div>> Ext.setSeries(i);</div><div>> Ext.openImagePlus(path);</div><div>></div><div>> in my loop, but even though</div>
<div>></div><div>> Ext.getSeries(seriesNum);</div><div>> print(seriesNum);</div><div>></div><div>> reported the correct series, the open command open up the same series five times.</div><div><br></div><div style>
Thanks, that is a bug. I filed a ticket for it:</div><div style><br></div><div style> <a href="https://trac.openmicroscopy.org.uk/ome/ticket/11145">https://trac.openmicroscopy.org.uk/ome/ticket/11145</a></div><div style>
<br></div><div style>Regards,</div><div style>Curtis</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Jun 17, 2013 at 2:53 PM, Aryeh Weiss <span dir="ltr"><<a href="mailto:aryeh@cc.huji.ac.il" target="_blank">aryeh@cc.huji.ac.il</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div class="im">On 6/17/13 10:48 PM, Curtis Rueden wrote:<br>
</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
Hi Aryeh,<br>
<br><div class="im">
> I have a solution that does the job, and is not difficult.<br>
<br>
I am glad you got something that works for you!<br>
<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
Is there a way to tell Ext.openImagePlus(path) which series to load.<br>
</blockquote>
<br>
For the record: you call Ext.setSeries(seriesNo) before calling the<br>
other functions, to assign which series is active. You can do this in a<br>
loop over the value returned from Ext.getSeriesCount(<u></u>seriesCount) if you<br>
need to operate on all available series.<br>
<br>
</div></blockquote>
<br>
Hi Curtis,<br>
<br>
Again, thank you for your help -- I would not have found the solution without it.<br>
<br>
I originally tried:<br>
<br>
Ext.setSeries(i);<br>
Ext.openImagePlus(path);<br>
<br>
in my loop, but even though<br>
Ext.getSeries(seriesNum);<br>
print(seriesNum);<br>
<br>
reported the correct series, the open command open up the same series five times.<br>
<br>
Beset regards,<br>
--aryeh<br>
<br>
<br>
<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div class="im">
Regards,<br>
Curtis<br>
<br>
<br>
<br>
On Mon, Jun 17, 2013 at 2:43 PM, Aryeh Weiss <<a href="mailto:aryeh@cc.huji.ac.il" target="_blank">aryeh@cc.huji.ac.il</a><br></div><div class="im">
<mailto:<a href="mailto:aryeh@cc.huji.ac.il" target="_blank">aryeh@cc.huji.ac.il</a>>> wrote:<br>
<br>
I have a solution that does the job, and is not difficult.<br>
<br>
Thanks to Curtis for pointing me to the extensions and to the<br>
example code that allowed me to use them.<br>
<br>
Here it is:<br>
<br>
Ext.setId(path);<br>
Ext.getCurrentFile(file);<br></div>
Ext.getSeriesCount(__<u></u>seriesCount); // this gets the number of fields<div><div class="h5"><br>
print(seriesCount);<br>
<br>
seriesId = newArray(seriesCount);<br>
seriesTitle = newArray(seriesCount);<br>
<br>
// now we open them one by one and get the imageID and set the title<br>
// to something unique<br>
<br>
for (i=0; i<seriesCount; i++) {<br>
Ext.setSeries(i);<br>
// Ext.openImagePlus(path);<br>
// I did not know how to tell Ext.openImagePlus which series to use,<br>
// so I did it with the recorded command and some string games...<br>
run("Bio-Formats Importer", "open=&path color_mode=Default<br>
view=Hyperstack stack_order=XYCZT series_"+d2s(i+1,0));<br>
seriesId[i] = getImageID();<br>
// inputPrefix is defined earlier in my macro<br>
rename(inputPrefix+"_series"+ d2s(i+1,0));<br>
seriesTitle[i] = getTitle();<br>
Ext.getSeries(seriesNum);<br>
print(seriesNum);<br>
<br>
}<br>
<br>
<br>
Best regards,<br>
--aryeh<br>
<br>
<br>
On 6/17/13 9:35 PM, Curtis Rueden wrote:<br>
<br>
Hi Aryeh,<br>
<br>
> Does Ext.getSeries(seriesNum) return what I want?<br>
<br>
Unfortunately not. As I said, the macro extensions do *not*<br>
currently<br>
include a "getSeriesUsedFiles" method. What I meant is that such<br>
a thing<br>
could easily be added by the core developers. But the extensions<br>
do not<br>
include it at the moment.<br>
<br>
> Also, are there some examples which use the extensions, from<br>
which I<br>
> can learn how they work?<br>
<br>
Sure, here is one such example:<br></div></div>
<a href="https://github.com/__openmicroscopy/bioformats/__blob/v4.4.8/components/loci-__plugins/utils/macros/__planeTimings.txt" target="_blank">https://github.com/__<u></u>openmicroscopy/bioformats/__<u></u>blob/v4.4.8/components/loci-__<u></u>plugins/utils/macros/__<u></u>planeTimings.txt</a><div class="im">
<br>
<<a href="https://github.com/openmicroscopy/bioformats/blob/v4.4.8/components/loci-plugins/utils/macros/planeTimings.txt" target="_blank">https://github.com/<u></u>openmicroscopy/bioformats/<u></u>blob/v4.4.8/components/loci-<u></u>plugins/utils/macros/<u></u>planeTimings.txt</a>><br>
<br>
Regards,<br>
Curtis<br>
<br>
<br>
On Mon, Jun 17, 2013 at 1:29 PM, Aryeh Weiss<br>
<<a href="mailto:aryeh@cc.huji.ac.il" target="_blank">aryeh@cc.huji.ac.il</a> <mailto:<a href="mailto:aryeh@cc.huji.ac.il" target="_blank">aryeh@cc.huji.ac.il</a>><br></div><div class="im">
<mailto:<a href="mailto:aryeh@cc.huji.ac.il" target="_blank">aryeh@cc.huji.ac.il</a> <mailto:<a href="mailto:aryeh@cc.huji.ac.il" target="_blank">aryeh@cc.huji.ac.il</a>>>> wrote:<br>
<br></div><div><div class="h5">
Hi Curtis,<br>
<br>
Thank you for your quick reply.<br>
<br>
<br>
On 6/17/13 8:41 PM, Curtis Rueden wrote:<br>
<br>
Hi Aryeh,<br>
<br>
> 1. Is there a way to open all of the series at<br>
once, in a macro,<br>
> without knowing ahead of time how many series are<br>
in the file?<br>
<br>
Sure, there is an "Open all series" checkbox in the<br>
initial Importer<br>
dialog, which does exactly that.<br>
<br>
<br>
Thanks -- I missed this, and it does the job.<br>
<br>
<br>
> 2. Is there a way after they are opened of knowing<br>
which<br>
file belongs<br>
> to which series?<br>
<br>
Yes, there is a method of IFormatReader called<br>
getSeriesUsedFiles(boolean) which tells you. But you<br>
would need<br>
to write<br>
Java code to call it -- there is no facility to call it<br>
from a macro<br>
(though it would be easy to add to the Ext functions).<br>
<br>
<br>
I found the following two functions in the extensions:<br></div></div>
Ext.getSeriesCount(____<u></u>seriesCount)<div><div class="h5"><br>
<br>
Ext.getSeries(seriesNum)<br>
<br>
I thought that they might do what I want, but even after<br>
including<br>
run("Bio-Formats Macro Extensions");<br>
I cannot get them to work.<br>
<br>
This is because I have not figured out how to use the<br>
extensions (<br>
for example, if they are -== Usable after initializing a<br>
file ==-<br>
what does it mean to initialize a file?).<br>
<br>
Does Ext.getSeries(seriesNum) return what I want?<br>
Also, are there some examples which use the extensions,<br>
from which I<br>
can learn how they work?<br>
<br>
Best regards,<br>
--aryeh<br>
<br>
<br>
<br>
On Mon, Jun 17, 2013 at 9:59 AM, Aryeh Weiss<br>
<<a href="mailto:aryeh@cc.huji.ac.il" target="_blank">aryeh@cc.huji.ac.il</a> <mailto:<a href="mailto:aryeh@cc.huji.ac.il" target="_blank">aryeh@cc.huji.ac.il</a>><br>
<mailto:<a href="mailto:aryeh@cc.huji.ac.il" target="_blank">aryeh@cc.huji.ac.il</a> <mailto:<a href="mailto:aryeh@cc.huji.ac.il" target="_blank">aryeh@cc.huji.ac.il</a>>><br>
<mailto:<a href="mailto:aryeh@cc.huji.ac.il" target="_blank">aryeh@cc.huji.ac.il</a><br>
<mailto:<a href="mailto:aryeh@cc.huji.ac.il" target="_blank">aryeh@cc.huji.ac.il</a>> <mailto:<a href="mailto:aryeh@cc.huji.ac.il" target="_blank">aryeh@cc.huji.ac.il</a><br>
<mailto:<a href="mailto:aryeh@cc.huji.ac.il" target="_blank">aryeh@cc.huji.ac.il</a>>>><u></u>> wrote:<br>
<br>
When I open a multifield image with the bioformats<br>
importer, all of<br>
the fields come up with the same name. There<br>
appears to be<br>
no way to<br>
know which is which from the metadata.<br>
<br>
When opening with bioformats in a macro, the arguments<br>
series_1,<br>
series_2 etc specify which series to open.<br>
However, I may<br>
not know<br>
ahead of time how many fields are in my multifield<br>
file.<br>
<br>
If I open with metadata only, I can parse the<br>
metadata text<br>
to find<br>
out how many series (fields) I have (but it would<br>
be nice<br>
if the<br>
importer did that for me).<br>
<br>
My questions are:<br>
<br>
1. Is there a way to open all of the series at<br>
once, in a<br>
macro,<br>
without knowing ahead of time how many series are<br>
in the file?<br>
<br>
2. Is there a way after they are opened of knowing<br>
which file<br>
belongs to which series?<br>
<br>
Thanks in advance.<br>
--aryeh<br>
--<br>
Aryeh Weiss<br>
Faculty of Engineering<br>
Bar Ilan University<br>
Ramat Gan 52900 Israel<br>
<br>
Ph: 972-3-5317638<br>
FAX: 972-3-7384051<br>
<br>
<br>
<br>
<br>
<br>
<br>
</div></div></blockquote><div class=""><div class="h5">
<br>
<br>
-- <br>
Aryeh Weiss<br>
Faculty of Engineering<br>
Bar Ilan University<br>
Ramat Gan 52900 Israel<br>
<br>
Ph: 972-3-5317638<br>
FAX: 972-3-7384051<br>
<br>
</div></div></blockquote></div><br></div></div></div>