When I open a multifield image with the bioformats importer, all of the
fields come up with the same name. There appears to be no way to know which is which from the metadata. When opening with bioformats in a macro, the arguments series_1, series_2 etc specify which series to open. However, I may not know ahead of time how many fields are in my multifield file. If I open with metadata only, I can parse the metadata text to find out how many series (fields) I have (but it would be nice if the importer did that for me). My questions are: 1. Is there a way to open all of the series at once, in a macro, without knowing ahead of time how many series are in the file? 2. Is there a way after they are opened of knowing which file belongs to which series? Thanks in advance. --aryeh -- Aryeh Weiss Faculty of Engineering Bar Ilan University Ramat Gan 52900 Israel Ph: 972-3-5317638 FAX: 972-3-7384051 -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
Hi Aryeh,
> 1. Is there a way to open all of the series at once, in a macro, > without knowing ahead of time how many series are in the file? Sure, there is an "Open all series" checkbox in the initial Importer dialog, which does exactly that. > 2. Is there a way after they are opened of knowing which file belongs > to which series? Yes, there is a method of IFormatReader called getSeriesUsedFiles(boolean) which tells you. But you would need to write Java code to call it -- there is no facility to call it from a macro (though it would be easy to add to the Ext functions). Regards, Curtis On Mon, Jun 17, 2013 at 9:59 AM, Aryeh Weiss <[hidden email]> wrote: > When I open a multifield image with the bioformats importer, all of the > fields come up with the same name. There appears to be no way to know which > is which from the metadata. > > When opening with bioformats in a macro, the arguments series_1, series_2 > etc specify which series to open. However, I may not know ahead of time how > many fields are in my multifield file. > > If I open with metadata only, I can parse the metadata text to find out > how many series (fields) I have (but it would be nice if the importer did > that for me). > > My questions are: > > 1. Is there a way to open all of the series at once, in a macro, without > knowing ahead of time how many series are in the file? > > 2. Is there a way after they are opened of knowing which file belongs to > which series? > > Thanks in advance. > --aryeh > -- > Aryeh Weiss > Faculty of Engineering > Bar Ilan University > Ramat Gan 52900 Israel > > Ph: 972-3-5317638 > FAX: 972-3-7384051 > > -- > ImageJ mailing list: http://imagej.nih.gov/ij/list.**html<http://imagej.nih.gov/ij/list.html> > -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
Hi Curtis,
Thank you for your quick reply. On 6/17/13 8:41 PM, Curtis Rueden wrote: > Hi Aryeh, > > > 1. Is there a way to open all of the series at once, in a macro, > > without knowing ahead of time how many series are in the file? > > Sure, there is an "Open all series" checkbox in the initial Importer > dialog, which does exactly that. > Thanks -- I missed this, and it does the job. > > 2. Is there a way after they are opened of knowing which file belongs > > to which series? > > Yes, there is a method of IFormatReader called > getSeriesUsedFiles(boolean) which tells you. But you would need to write > Java code to call it -- there is no facility to call it from a macro > (though it would be easy to add to the Ext functions). > I found the following two functions in the extensions: Ext.getSeriesCount(seriesCount) Ext.getSeries(seriesNum) I thought that they might do what I want, but even after including run("Bio-Formats Macro Extensions"); I cannot get them to work. This is because I have not figured out how to use the extensions ( for example, if they are -== Usable after initializing a file ==- what does it mean to initialize a file?). Does Ext.getSeries(seriesNum) return what I want? Also, are there some examples which use the extensions, from which I can learn how they work? Best regards, --aryeh > > > On Mon, Jun 17, 2013 at 9:59 AM, Aryeh Weiss <[hidden email] > <mailto:[hidden email]>> wrote: > > When I open a multifield image with the bioformats importer, all of > the fields come up with the same name. There appears to be no way to > know which is which from the metadata. > > When opening with bioformats in a macro, the arguments series_1, > series_2 etc specify which series to open. However, I may not know > ahead of time how many fields are in my multifield file. > > If I open with metadata only, I can parse the metadata text to find > out how many series (fields) I have (but it would be nice if the > importer did that for me). > > My questions are: > > 1. Is there a way to open all of the series at once, in a macro, > without knowing ahead of time how many series are in the file? > > 2. Is there a way after they are opened of knowing which file > belongs to which series? > > Thanks in advance. > --aryeh > -- > Aryeh Weiss > Faculty of Engineering > Bar Ilan University > Ramat Gan 52900 Israel > > Ph: 972-3-5317638 > FAX: 972-3-7384051 > > -- > ImageJ mailing list: http://imagej.nih.gov/ij/list.__html > <http://imagej.nih.gov/ij/list.html> > > -- Aryeh Weiss Faculty of Engineering Bar Ilan University Ramat Gan 52900 Israel Ph: 972-3-5317638 FAX: 972-3-7384051 -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
Hi Aryeh,
> Does Ext.getSeries(seriesNum) return what I want? Unfortunately not. As I said, the macro extensions do *not* currently include a "getSeriesUsedFiles" method. What I meant is that such a thing could easily be added by the core developers. But the extensions do not include it at the moment. > Also, are there some examples which use the extensions, from which I > can learn how they work? Sure, here is one such example: https://github.com/openmicroscopy/bioformats/blob/v4.4.8/components/loci-plugins/utils/macros/planeTimings.txt Regards, Curtis On Mon, Jun 17, 2013 at 1:29 PM, Aryeh Weiss <[hidden email]> wrote: > Hi Curtis, > > Thank you for your quick reply. > > > On 6/17/13 8:41 PM, Curtis Rueden wrote: > >> Hi Aryeh, >> >> > 1. Is there a way to open all of the series at once, in a macro, >> > without knowing ahead of time how many series are in the file? >> >> Sure, there is an "Open all series" checkbox in the initial Importer >> dialog, which does exactly that. >> >> > Thanks -- I missed this, and it does the job. > > > > 2. Is there a way after they are opened of knowing which file belongs >> > to which series? >> >> Yes, there is a method of IFormatReader called >> getSeriesUsedFiles(boolean) which tells you. But you would need to write >> Java code to call it -- there is no facility to call it from a macro >> (though it would be easy to add to the Ext functions). >> >> > I found the following two functions in the extensions: > Ext.getSeriesCount(**seriesCount) > Ext.getSeries(seriesNum) > > I thought that they might do what I want, but even after including > run("Bio-Formats Macro Extensions"); > I cannot get them to work. > > This is because I have not figured out how to use the extensions ( for > example, if they are -== Usable after initializing a file ==- > what does it mean to initialize a file?). > > Does Ext.getSeries(seriesNum) return what I want? > Also, are there some examples which use the extensions, from which I can > learn how they work? > > Best regards, > --aryeh > > >> >> On Mon, Jun 17, 2013 at 9:59 AM, Aryeh Weiss <[hidden email] >> <mailto:[hidden email]>> wrote: >> >> When I open a multifield image with the bioformats importer, all of >> the fields come up with the same name. There appears to be no way to >> know which is which from the metadata. >> >> When opening with bioformats in a macro, the arguments series_1, >> series_2 etc specify which series to open. However, I may not know >> ahead of time how many fields are in my multifield file. >> >> If I open with metadata only, I can parse the metadata text to find >> out how many series (fields) I have (but it would be nice if the >> importer did that for me). >> >> My questions are: >> >> 1. Is there a way to open all of the series at once, in a macro, >> without knowing ahead of time how many series are in the file? >> >> 2. Is there a way after they are opened of knowing which file >> belongs to which series? >> >> Thanks in advance. >> --aryeh >> -- >> Aryeh Weiss >> Faculty of Engineering >> Bar Ilan University >> Ramat Gan 52900 Israel >> >> Ph: 972-3-5317638 >> FAX: 972-3-7384051 >> >> -- >> ImageJ mailing list: http://imagej.nih.gov/ij/list.**__html<http://imagej.nih.gov/ij/list.__html> >> <http://imagej.nih.gov/ij/**list.html<http://imagej.nih.gov/ij/list.html> >> > >> >> >> > > -- > Aryeh Weiss > Faculty of Engineering > Bar Ilan University > Ramat Gan 52900 Israel > > Ph: 972-3-5317638 > FAX: 972-3-7384051 > > -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
Hi Curtis,
Thanks for your reply. As I cannot in reasonable time write my macro as a plugin (due to my lack of Java programming skill), I will need to do it by opening the series one at a time. However, I found that: Ext.getSeriesCount(seriesCount); does return the number of series, so I do not need to parse the metadata for that. So that is a big help. Is there a way to tell Ext.openImagePlus(path) which series to load. The doc says that it uses the default parameters, but I di not see how to set those parameters. Best regards, --aryeh On 6/17/13 9:35 PM, Curtis Rueden wrote: > Hi Aryeh, > > > Does Ext.getSeries(seriesNum) return what I want? > > Unfortunately not. As I said, the macro extensions do *not* currently > include a "getSeriesUsedFiles" method. What I meant is that such a thing > could easily be added by the core developers. But the extensions do not > include it at the moment. > > > Also, are there some examples which use the extensions, from which I > > can learn how they work? > > Sure, here is one such example: > https://github.com/openmicroscopy/bioformats/blob/v4.4.8/components/loci-plugins/utils/macros/planeTimings.txt > > Regards, > Curtis > > > On Mon, Jun 17, 2013 at 1:29 PM, Aryeh Weiss <[hidden email] > <mailto:[hidden email]>> wrote: > > Hi Curtis, > > Thank you for your quick reply. > > > On 6/17/13 8:41 PM, Curtis Rueden wrote: > > Hi Aryeh, > > > 1. Is there a way to open all of the series at once, in a macro, > > without knowing ahead of time how many series are in the file? > > Sure, there is an "Open all series" checkbox in the initial Importer > dialog, which does exactly that. > > > Thanks -- I missed this, and it does the job. > > > > 2. Is there a way after they are opened of knowing which > file belongs > > to which series? > > Yes, there is a method of IFormatReader called > getSeriesUsedFiles(boolean) which tells you. But you would need > to write > Java code to call it -- there is no facility to call it from a macro > (though it would be easy to add to the Ext functions). > > > I found the following two functions in the extensions: > Ext.getSeriesCount(__seriesCount) > Ext.getSeries(seriesNum) > > I thought that they might do what I want, but even after including > run("Bio-Formats Macro Extensions"); > I cannot get them to work. > > This is because I have not figured out how to use the extensions ( > for example, if they are -== Usable after initializing a file ==- > what does it mean to initialize a file?). > > Does Ext.getSeries(seriesNum) return what I want? > Also, are there some examples which use the extensions, from which I > can learn how they work? > > Best regards, > --aryeh > > > > On Mon, Jun 17, 2013 at 9:59 AM, Aryeh Weiss > <[hidden email] <mailto:[hidden email]> > <mailto:[hidden email] <mailto:[hidden email]>>> wrote: > > When I open a multifield image with the bioformats > importer, all of > the fields come up with the same name. There appears to be > no way to > know which is which from the metadata. > > When opening with bioformats in a macro, the arguments > series_1, > series_2 etc specify which series to open. However, I may > not know > ahead of time how many fields are in my multifield file. > > If I open with metadata only, I can parse the metadata text > to find > out how many series (fields) I have (but it would be nice > if the > importer did that for me). > > My questions are: > > 1. Is there a way to open all of the series at once, in a > macro, > without knowing ahead of time how many series are in the file? > > 2. Is there a way after they are opened of knowing which file > belongs to which series? > > Thanks in advance. > --aryeh > -- > Aryeh Weiss > Faculty of Engineering > Bar Ilan University > Ramat Gan 52900 Israel > > Ph: 972-3-5317638 > FAX: 972-3-7384051 > -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
In reply to this post by ctrueden
I have a solution that does the job, and is not difficult.
Thanks to Curtis for pointing me to the extensions and to the example code that allowed me to use them. Here it is: Ext.setId(path); Ext.getCurrentFile(file); Ext.getSeriesCount(seriesCount); // this gets the number of fields print(seriesCount); seriesId = newArray(seriesCount); seriesTitle = newArray(seriesCount); // now we open them one by one and get the imageID and set the title // to something unique for (i=0; i<seriesCount; i++) { Ext.setSeries(i); // Ext.openImagePlus(path); // I did not know how to tell Ext.openImagePlus which series to use, // so I did it with the recorded command and some string games... run("Bio-Formats Importer", "open=&path color_mode=Default view=Hyperstack stack_order=XYCZT series_"+d2s(i+1,0)); seriesId[i] = getImageID(); // inputPrefix is defined earlier in my macro rename(inputPrefix+"_series"+ d2s(i+1,0)); seriesTitle[i] = getTitle(); Ext.getSeries(seriesNum); print(seriesNum); } Best regards, --aryeh On 6/17/13 9:35 PM, Curtis Rueden wrote: > Hi Aryeh, > > > Does Ext.getSeries(seriesNum) return what I want? > > Unfortunately not. As I said, the macro extensions do *not* currently > include a "getSeriesUsedFiles" method. What I meant is that such a thing > could easily be added by the core developers. But the extensions do not > include it at the moment. > > > Also, are there some examples which use the extensions, from which I > > can learn how they work? > > Sure, here is one such example: > https://github.com/openmicroscopy/bioformats/blob/v4.4.8/components/loci-plugins/utils/macros/planeTimings.txt > > Regards, > Curtis > > > On Mon, Jun 17, 2013 at 1:29 PM, Aryeh Weiss <[hidden email] > <mailto:[hidden email]>> wrote: > > Hi Curtis, > > Thank you for your quick reply. > > > On 6/17/13 8:41 PM, Curtis Rueden wrote: > > Hi Aryeh, > > > 1. Is there a way to open all of the series at once, in a macro, > > without knowing ahead of time how many series are in the file? > > Sure, there is an "Open all series" checkbox in the initial Importer > dialog, which does exactly that. > > > Thanks -- I missed this, and it does the job. > > > > 2. Is there a way after they are opened of knowing which > file belongs > > to which series? > > Yes, there is a method of IFormatReader called > getSeriesUsedFiles(boolean) which tells you. But you would need > to write > Java code to call it -- there is no facility to call it from a macro > (though it would be easy to add to the Ext functions). > > > I found the following two functions in the extensions: > Ext.getSeriesCount(__seriesCount) > Ext.getSeries(seriesNum) > > I thought that they might do what I want, but even after including > run("Bio-Formats Macro Extensions"); > I cannot get them to work. > > This is because I have not figured out how to use the extensions ( > for example, if they are -== Usable after initializing a file ==- > what does it mean to initialize a file?). > > Does Ext.getSeries(seriesNum) return what I want? > Also, are there some examples which use the extensions, from which I > can learn how they work? > > Best regards, > --aryeh > > > > On Mon, Jun 17, 2013 at 9:59 AM, Aryeh Weiss > <[hidden email] <mailto:[hidden email]> > <mailto:[hidden email] <mailto:[hidden email]>>> wrote: > > When I open a multifield image with the bioformats > importer, all of > the fields come up with the same name. There appears to be > no way to > know which is which from the metadata. > > When opening with bioformats in a macro, the arguments > series_1, > series_2 etc specify which series to open. However, I may > not know > ahead of time how many fields are in my multifield file. > > If I open with metadata only, I can parse the metadata text > to find > out how many series (fields) I have (but it would be nice > if the > importer did that for me). > > My questions are: > > 1. Is there a way to open all of the series at once, in a > macro, > without knowing ahead of time how many series are in the file? > > 2. Is there a way after they are opened of knowing which file > belongs to which series? > > Thanks in advance. > --aryeh > -- > Aryeh Weiss > Faculty of Engineering > Bar Ilan University > Ramat Gan 52900 Israel > > Ph: 972-3-5317638 > FAX: 972-3-7384051 > -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
Hi Aryeh,
> I have a solution that does the job, and is not difficult. I am glad you got something that works for you! > Is there a way to tell Ext.openImagePlus(path) which series to load. For the record: you call Ext.setSeries(seriesNo) before calling the other functions, to assign which series is active. You can do this in a loop over the value returned from Ext.getSeriesCount(seriesCount) if you need to operate on all available series. Regards, Curtis On Mon, Jun 17, 2013 at 2:43 PM, Aryeh Weiss <[hidden email]> wrote: > I have a solution that does the job, and is not difficult. > > Thanks to Curtis for pointing me to the extensions and to the example code > that allowed me to use them. > > Here it is: > > Ext.setId(path); > Ext.getCurrentFile(file); > Ext.getSeriesCount(**seriesCount); // this gets the number of fields > print(seriesCount); > > seriesId = newArray(seriesCount); > seriesTitle = newArray(seriesCount); > > // now we open them one by one and get the imageID and set the title > // to something unique > > for (i=0; i<seriesCount; i++) { > Ext.setSeries(i); > // Ext.openImagePlus(path); > // I did not know how to tell Ext.openImagePlus which series to use, > // so I did it with the recorded command and some string games... > run("Bio-Formats Importer", "open=&path color_mode=Default view=Hyperstack > stack_order=XYCZT series_"+d2s(i+1,0)); > seriesId[i] = getImageID(); > // inputPrefix is defined earlier in my macro > rename(inputPrefix+"_series"+ d2s(i+1,0)); > seriesTitle[i] = getTitle(); > Ext.getSeries(seriesNum); > print(seriesNum); > > } > > > Best regards, > --aryeh > > > On 6/17/13 9:35 PM, Curtis Rueden wrote: > >> Hi Aryeh, >> >> > Does Ext.getSeries(seriesNum) return what I want? >> >> Unfortunately not. As I said, the macro extensions do *not* currently >> include a "getSeriesUsedFiles" method. What I meant is that such a thing >> could easily be added by the core developers. But the extensions do not >> include it at the moment. >> >> > Also, are there some examples which use the extensions, from which I >> > can learn how they work? >> >> Sure, here is one such example: >> https://github.com/**openmicroscopy/bioformats/** >> blob/v4.4.8/components/loci-**plugins/utils/macros/**planeTimings.txt<https://github.com/openmicroscopy/bioformats/blob/v4.4.8/components/loci-plugins/utils/macros/planeTimings.txt> >> >> Regards, >> Curtis >> >> >> On Mon, Jun 17, 2013 at 1:29 PM, Aryeh Weiss <[hidden email] >> <mailto:[hidden email]>> wrote: >> >> Hi Curtis, >> >> Thank you for your quick reply. >> >> >> On 6/17/13 8:41 PM, Curtis Rueden wrote: >> >> Hi Aryeh, >> >> > 1. Is there a way to open all of the series at once, in a >> macro, >> > without knowing ahead of time how many series are in the file? >> >> Sure, there is an "Open all series" checkbox in the initial >> Importer >> dialog, which does exactly that. >> >> >> Thanks -- I missed this, and it does the job. >> >> >> > 2. Is there a way after they are opened of knowing which >> file belongs >> > to which series? >> >> Yes, there is a method of IFormatReader called >> getSeriesUsedFiles(boolean) which tells you. But you would need >> to write >> Java code to call it -- there is no facility to call it from a >> macro >> (though it would be easy to add to the Ext functions). >> >> >> I found the following two functions in the extensions: >> Ext.getSeriesCount(__**seriesCount) >> >> Ext.getSeries(seriesNum) >> >> I thought that they might do what I want, but even after including >> run("Bio-Formats Macro Extensions"); >> I cannot get them to work. >> >> This is because I have not figured out how to use the extensions ( >> for example, if they are -== Usable after initializing a file ==- >> what does it mean to initialize a file?). >> >> Does Ext.getSeries(seriesNum) return what I want? >> Also, are there some examples which use the extensions, from which I >> can learn how they work? >> >> Best regards, >> --aryeh >> >> >> >> On Mon, Jun 17, 2013 at 9:59 AM, Aryeh Weiss >> <[hidden email] <mailto:[hidden email]> >> <mailto:[hidden email] <mailto:[hidden email]>>> wrote: >> >> When I open a multifield image with the bioformats >> importer, all of >> the fields come up with the same name. There appears to be >> no way to >> know which is which from the metadata. >> >> When opening with bioformats in a macro, the arguments >> series_1, >> series_2 etc specify which series to open. However, I may >> not know >> ahead of time how many fields are in my multifield file. >> >> If I open with metadata only, I can parse the metadata text >> to find >> out how many series (fields) I have (but it would be nice >> if the >> importer did that for me). >> >> My questions are: >> >> 1. Is there a way to open all of the series at once, in a >> macro, >> without knowing ahead of time how many series are in the >> file? >> >> 2. Is there a way after they are opened of knowing which file >> belongs to which series? >> >> Thanks in advance. >> --aryeh >> -- >> Aryeh Weiss >> Faculty of Engineering >> Bar Ilan University >> Ramat Gan 52900 Israel >> >> Ph: 972-3-5317638 >> FAX: 972-3-7384051 >> >> > > > > -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
In reply to this post by Aryeh Weiss
Hi Everyone,
I had the same problem with .lif tile scans, and solved it by updating to latest version of LOCI. I guess there was some bug in one of the may or june releases. Best regards Federico Il 17.06.2013 16:59 Aryeh Weiss ha scritto: > When I open a multifield image with the bioformats importer, all of > the fields come up with the same name. There appears to be no way to > know which is which from the metadata. > > When opening with bioformats in a macro, the arguments series_1, > series_2 etc specify which series to open. However, I may not know > ahead of time how many fields are in my multifield file. > > If I open with metadata only, I can parse the metadata text to find > out how many series (fields) I have (but it would be nice if the > importer did that for me). > > My questions are: > > 1. Is there a way to open all of the series at once, in a macro, > without knowing ahead of time how many series are in the file? > > 2. Is there a way after they are opened of knowing which file belongs > to which series? > > Thanks in advance. > --aryeh -- Federico Luzzati, PhD Researcher Dept. Life Sciences and Systems Biology University of Turin Via Accademia Albertina, 13 10123 Torino Neuroscience Institute Cavalieri Ottolenghi (NICO) Regione Gonzole, 10 10043 Orbassano (Torino) ITALY tel. +39-011670-4683/ -6631 -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
Free forum by Nabble | Edit this page |