Get time unit from meta data within a macro

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Get time unit from meta data within a macro

Philippe CARL
Dear all,

Inside a macro, I would need to get a hold of the time unit parameter (s, m
or h) saved within the meta data of a tif file.

Thus my first guess was to use the Ext. features of the Loci toolbox but
very unfortunately there is no getUnitT or getTimeUnit or similar method
within their package.

Another idea was to get a hold to the data displayed within the "OME
Metadata" window when selecting the "Display OME-XML metadata" option of the
Bio-formats importer.

But I haven’t figured out a way to access the data displayed within this
window.

And at last, given that the parameter I’m interested in is saved within the
end of the tiff file, I thought about using a kind of
"File.openAsRawString(path, count)" method that would start from the end of
the file or alternatively have a kind of "File.openAsRawString(path, begin,
end)" macro method with begin and end defining the positions of a pointer
within to file from where to where the data are read and interpreted as
text.

But with none of these ideas or paths I was able to solve the issue.

Thus is there a better option (and that would be working) on which I didn’t
think for solving this issue?

I thank you very much in advance for your ideas and help.

My best regards,

Philippe

 

Philippe CARL

Laboratoire de Bioimagerie et Pathologies

UMR 7021 CNRS - Université de Strasbourg

Faculté de Pharmacie

74 route du Rhin

67401 ILLKIRCH

Tel : +33(0)3 68 85 41 84


--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Get time unit from meta data within a macro

Cammer, Michael
Years ago I wrote a macro for someone to pull the times out of the metadata of an ND2 file.

I think I got all the metadata as a string or array of strings and then checked the beginning of each line for the time tag and then parsed the line to get the times.  Then we had an array of the times and matched the slice number with the array offset by 1.

Sorry I cannot locate the code.

But in the end, if we had used the nominal time instead of the time reported times, the answer regarding biology would not have changed.


Michael Cammer, Sr Research Scientist, DART Microscopy Laboratory

NYU Langone Health, 540 First Avenue, SK2 Microscopy Suite, New York, NY  10016

[hidden email]<mailto:[hidden email]>  http://nyulmc.org/micros  http://microscopynotes.com/

Voice direct only, no text or messages:  1-914-309-3270 and 1-646-501-0567



________________________________
From: Philippe CARL <[hidden email]>
Sent: Friday, June 22, 2018 9:13:31 AM
To: [hidden email]
Subject: Get time unit from meta data within a macro

Dear all,

Inside a macro, I would need to get a hold of the time unit parameter (s, m
or h) saved within the meta data of a tif file.

Thus my first guess was to use the Ext. features of the Loci toolbox but
very unfortunately there is no getUnitT or getTimeUnit or similar method
within their package.

Another idea was to get a hold to the data displayed within the "OME
Metadata" window when selecting the "Display OME-XML metadata" option of the
Bio-formats importer.

But I haven’t figured out a way to access the data displayed within this
window.

And at last, given that the parameter I’m interested in is saved within the
end of the tiff file, I thought about using a kind of
"File.openAsRawString(path, count)" method that would start from the end of
the file or alternatively have a kind of "File.openAsRawString(path, begin,
end)" macro method with begin and end defining the positions of a pointer
within to file from where to where the data are read and interpreted as
text.

But with none of these ideas or paths I was able to solve the issue.

Thus is there a better option (and that would be working) on which I didn’t
think for solving this issue?

I thank you very much in advance for your ideas and help.

My best regards,

Philippe



Philippe CARL

Laboratoire de Bioimagerie et Pathologies

UMR 7021 CNRS - Université de Strasbourg

Faculté de Pharmacie

74 route du Rhin

67401 ILLKIRCH

Tel : +33(0)3 68 85 41 84


--
ImageJ mailing list: https://urldefense.proofpoint.com/v2/url?u=http-3A__imagej.nih.gov_ij_list.html&d=DwIFAw&c=j5oPpO0eBH1iio48DtsedbOBGmuw5jHLjgvtN2r4ehE&r=oU_05LztNstAydlbm5L5GDu_vAdjXk3frDLx_CqKkuo&m=dS38J0J14zqHkmOdMFWyZny4r4XYljdfgW4z9H_kct8&s=fJWaut6Gg1As0v_xwL_Q4Wr9hiSgEs1dKx-nGCCvmyY&e=

------------------------------------------------------------
This email message, including any attachments, is for the sole use of the intended recipient(s) and may contain information that is proprietary, confidential, and exempt from disclosure under applicable law. Any unauthorized review, use, disclosure, or distribution is prohibited. If you have received this email in error please notify the sender by return email and delete the original message. Please note, the recipient should check this email and any attachments for the presence of viruses. The organization accepts no liability for any damage caused by any virus transmitted by this email.
=================================

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Get time unit from meta data within a macro

George Patterson
Dear Phillippe,
Here is a link to macro written by Curtis Rueden.
We use a variation on this to get the time stamps for our images.
Best,
George

https://github.com/openmicroscopy/bioformats/blob/develop/components/bio-formats-plugins/utils/macros/planeTimings.txt

On Fri, Jun 22, 2018 at 10:52 AM, Cammer, Michael <
[hidden email]> wrote:

> Years ago I wrote a macro for someone to pull the times out of the
> metadata of an ND2 file.
>
> I think I got all the metadata as a string or array of strings and then
> checked the beginning of each line for the time tag and then parsed the
> line to get the times.  Then we had an array of the times and matched the
> slice number with the array offset by 1.
>
> Sorry I cannot locate the code.
>
> But in the end, if we had used the nominal time instead of the time
> reported times, the answer regarding biology would not have changed.
>
>
> Michael Cammer, Sr Research Scientist, DART Microscopy Laboratory
>
> NYU Langone Health, 540 First Avenue, SK2 Microscopy Suite, New York, NY
> 10016
>
> [hidden email]<mailto:[hidden email]>
> http://nyulmc.org/micros  http://microscopynotes.com/
>
> Voice direct only, no text or messages:  1-914-309-3270 and 1-646-501-0567
>
>
>
> ________________________________
> From: Philippe CARL <[hidden email]>
> Sent: Friday, June 22, 2018 9:13:31 AM
> To: [hidden email]
> Subject: Get time unit from meta data within a macro
>
> Dear all,
>
> Inside a macro, I would need to get a hold of the time unit parameter (s, m
> or h) saved within the meta data of a tif file.
>
> Thus my first guess was to use the Ext. features of the Loci toolbox but
> very unfortunately there is no getUnitT or getTimeUnit or similar method
> within their package.
>
> Another idea was to get a hold to the data displayed within the "OME
> Metadata" window when selecting the "Display OME-XML metadata" option of
> the
> Bio-formats importer.
>
> But I haven’t figured out a way to access the data displayed within this
> window.
>
> And at last, given that the parameter I’m interested in is saved within the
> end of the tiff file, I thought about using a kind of
> "File.openAsRawString(path, count)" method that would start from the end of
> the file or alternatively have a kind of "File.openAsRawString(path, begin,
> end)" macro method with begin and end defining the positions of a pointer
> within to file from where to where the data are read and interpreted as
> text.
>
> But with none of these ideas or paths I was able to solve the issue.
>
> Thus is there a better option (and that would be working) on which I didn’t
> think for solving this issue?
>
> I thank you very much in advance for your ideas and help.
>
> My best regards,
>
> Philippe
>
>
>
> Philippe CARL
>
> Laboratoire de Bioimagerie et Pathologies
>
> UMR 7021 CNRS - Université de Strasbourg
>
> Faculté de Pharmacie
>
> 74 route du Rhin
>
> 67401 ILLKIRCH
>
> Tel : +33(0)3 68 85 41 84
>
>
> --
> ImageJ mailing list: https://urldefense.proofpoint.
> com/v2/url?u=http-3A__imagej.nih.gov_ij_list.html&d=DwIFAw&c=
> j5oPpO0eBH1iio48DtsedbOBGmuw5jHLjgvtN2r4ehE&r=oU_05LztNstAydlbm5L5GDu_
> vAdjXk3frDLx_CqKkuo&m=dS38J0J14zqHkmOdMFWyZny4r4XYljdfgW4z9H_kct8&s=
> fJWaut6Gg1As0v_xwL_Q4Wr9hiSgEs1dKx-nGCCvmyY&e=
>
> ------------------------------------------------------------
> This email message, including any attachments, is for the sole use of the
> intended recipient(s) and may contain information that is proprietary,
> confidential, and exempt from disclosure under applicable law. Any
> unauthorized review, use, disclosure, or distribution is prohibited. If you
> have received this email in error please notify the sender by return email
> and delete the original message. Please note, the recipient should check
> this email and any attachments for the presence of viruses. The
> organization accepts no liability for any damage caused by any virus
> transmitted by this email.
> =================================
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Get time unit from meta data within a macro

Philippe CARL
Dear George,
Thanks a lot for the indicated link, but its code is simply using the Ext features of the Loci feature.
Very unfortunatelly as can be seen here:
http://downloads.openmicroscopy.org/bio-formats/5.4.1/api/loci/plugins/macro/LociFunctions.html
There is no method within the Bio formats tool that able you to extract the time unit (as getPlaneTimingDeltaT and getPlaneTimingExposureTime are implemented).

Dear Michael,
What you propose is a potential solution I thought as well about.
But I'm blocked on the first step, i.e. on how to "get all the metadata as a string or array of strings".

I thank you very much in advance for your help.

My best regards,

Philippe

Le Vendredi 22 Juin 2018 18:39 CEST, George Patterson <[hidden email]> a écrit:

> Dear Phillippe,
> Here is a link to macro written by Curtis Rueden.
> We use a variation on this to get the time stamps for our images.
> Best,
> George
>
> https://github.com/openmicroscopy/bioformats/blob/develop/components/bio-formats-plugins/utils/macros/planeTimings.txt
>
> On Fri, Jun 22, 2018 at 10:52 AM, Cammer, Michael <
> [hidden email]> wrote:
>
> > Years ago I wrote a macro for someone to pull the times out of the

> > metadata of an ND2 file.
> >
> > I think I got all the metadata as a string or array of strings and then
> > checked the beginning of each line for the time tag and then parsed the
> > line to get the times.  Then we had an array of the times and matched the
> > slice number with the array offset by 1.
> >
> > Sorry I cannot locate the code.
> >
> > But in the end, if we had used the nominal time instead of the time
> > reported times, the answer regarding biology would not have changed.
> >
> >
> > Michael Cammer, Sr Research Scientist, DART Microscopy Laboratory
> >
> > NYU Langone Health, 540 First Avenue, SK2 Microscopy Suite, New York, NY
> > 10016
> >
> > [hidden email]<mailto:[hidden email]>
> > http://nyulmc.org/micros  http://microscopynotes.com/
> >
> > Voice direct only, no text or messages:  1-914-309-3270 and 1-646-501-0567
> >
> >
> >
> > ________________________________
> > From: Philippe CARL <[hidden email]>
> > Sent: Friday, June 22, 2018 9:13:31 AM
> > To: [hidden email]
> > Subject: Get time unit from meta data within a macro
> >
> > Dear all,
> >
> > Inside a macro, I would need to get a hold of the time unit parameter (s, m
> > or h) saved within the meta data of a tif file.
> >
> > Thus my first guess was to use the Ext. features of the Loci toolbox but
> > very unfortunately there is no getUnitT or getTimeUnit or similar method
> > within their package.
> >
> > Another idea was to get a hold to the data displayed within the "OME
> > Metadata" window when selecting the "Display OME-XML metadata" option of
> > the
> > Bio-formats importer.
> >
> > But I haven’t figured out a way to access the data displayed within this
> > window.
> >
> > And at last, given that the parameter I’m interested in is saved within the
> > end of the tiff file, I thought about using a kind of
> > "File.openAsRawString(path, count)" method that would start from the end of
> > the file or alternatively have a kind of "File.openAsRawString(path, begin,
> > end)" macro method with begin and end defining the positions of a pointer
> > within to file from where to where the data are read and interpreted as
> > text.
> >
> > But with none of these ideas or paths I was able to solve the issue.
> >
> > Thus is there a better option (and that would be working) on which I didn’t
> > think for solving this issue?
> >
> > I thank you very much in advance for your ideas and help.
> >
> > My best regards,
> >
> > Philippe
> >
> >
> >
> > Philippe CARL
> >
> > Laboratoire de Bioimagerie et Pathologies
> >
> > UMR 7021 CNRS - Université de Strasbourg
> >
> > Faculté de Pharmacie
> >
> > 74 route du Rhin
> >
> > 67401 ILLKIRCH
> >
> > Tel : +33(0)3 68 85 41 84
> >
> >
> > --
> > ImageJ mailing list: https://urldefense.proofpoint.
> > com/v2/url?u=http-3A__imagej.nih.gov_ij_list.html&d=DwIFAw&c=
> > j5oPpO0eBH1iio48DtsedbOBGmuw5jHLjgvtN2r4ehE&r=oU_05LztNstAydlbm5L5GDu_
> > vAdjXk3frDLx_CqKkuo&m=dS38J0J14zqHkmOdMFWyZny4r4XYljdfgW4z9H_kct8&s=
> > fJWaut6Gg1As0v_xwL_Q4Wr9hiSgEs1dKx-nGCCvmyY&e=
> >
> > ------------------------------------------------------------
> > This email message, including any attachments, is for the sole use of the
> > intended recipient(s) and may contain information that is proprietary,
> > confidential, and exempt from disclosure under applicable law. Any

> > unauthorized review, use, disclosure, or distribution is prohibited. If you
> > have received this email in error please notify the sender by return email
> > and delete the original message. Please note, the recipient should check
> > this email and any attachments for the presence of viruses. The
> > organization accepts no liability for any damage caused by any virus
> > transmitted by this email.
> > =================================
> >
> > --
> > ImageJ mailing list: http://imagej.nih.gov/ij/list.html
> >
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html





--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Get time unit from meta data within a macro

Cammer, Michael
Just tried this on a nd2 file from Nikon Elements.

  info = getMetadata("Info");
  // print(info);
  infolist = split(info, "\t\n\r");
  for (i=0; i<infolist.length; i++)
    if(startsWith(infolist[i], "times"))
      print(infolist[i]);

Give result:
timestamp #01 = 0.9597483713328838
timestamp #02 = 2.7837702463269234
timestamp #03 = 4.653781396329403
timestamp #04 = 6.501763421326876
timestamp #05 = 8.391364496350288
timestamp #06 = 10.297633496344089
timestamp #07 = 12.22872657135129
timestamp #08 = 14.103870246350764
timestamp #09 = 16.02579087135196
timestamp #10 = 17.901595146328212
timestamp #11 = 19.792212546348573  
etc.


Michael Cammer, Sr Research Scientist, DART Microscopy Laboratory
NYU Langone Health, 540 First Avenue, SK2 Microscopy Suite, New York, NY  10016
[hidden email]  http://nyulmc.org/micros  http://microscopynotes.com/ 
Voice direct only, no text or messages:  1-914-309-3270 and 1-646-501-0567



-----Original Message-----
From: CARL Philippe (LBP) [mailto:[hidden email]]
Sent: Friday, June 22, 2018 3:46 PM
To: [hidden email]
Subject: Re: Get time unit from meta data within a macro

Dear George,
Thanks a lot for the indicated link, but its code is simply using the Ext features of the Loci feature.
Very unfortunatelly as can be seen here:
https://urldefense.proofpoint.com/v2/url?u=http-3A__downloads.openmicroscopy.org_bio-2Dformats_5.4.1_api_loci_plugins_macro_LociFunctions.html&d=DwIFaQ&c=j5oPpO0eBH1iio48DtsedbOBGmuw5jHLjgvtN2r4ehE&r=oU_05LztNstAydlbm5L5GDu_vAdjXk3frDLx_CqKkuo&m=-n2cwaRgJv_piIFFn-fNXI2rxf1VvdJYZ9h7PnP4Nn8&s=4hvGvyOc85MlYntlC2BIoEF_zcosRGUJnujvfvic56M&e=
There is no method within the Bio formats tool that able you to extract the time unit (as getPlaneTimingDeltaT and getPlaneTimingExposureTime are implemented).

Dear Michael,
What you propose is a potential solution I thought as well about.
But I'm blocked on the first step, i.e. on how to "get all the metadata as a string or array of strings".

I thank you very much in advance for your help.

My best regards,

Philippe

Le Vendredi 22 Juin 2018 18:39 CEST, George Patterson <[hidden email]> a écrit:

> Dear Phillippe,
> Here is a link to macro written by Curtis Rueden.
> We use a variation on this to get the time stamps for our images.
> Best,
> George
>
> https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_openmicroscopy_bioformats_blob_develop_components_bio-2Dformats-2Dplugins_utils_macros_planeTimings.txt&d=DwIFaQ&c=j5oPpO0eBH1iio48DtsedbOBGmuw5jHLjgvtN2r4ehE&r=oU_05LztNstAydlbm5L5GDu_vAdjXk3frDLx_CqKkuo&m=-n2cwaRgJv_piIFFn-fNXI2rxf1VvdJYZ9h7PnP4Nn8&s=dPCHzTLwyMlfr4I6KhHKPakiBM3pXhM2ivj_4n5VWkc&e=
>
> On Fri, Jun 22, 2018 at 10:52 AM, Cammer, Michael <
> [hidden email]> wrote:
>
> > Years ago I wrote a macro for someone to pull the times out of the

> > metadata of an ND2 file.
> >
> > I think I got all the metadata as a string or array of strings and then
> > checked the beginning of each line for the time tag and then parsed the
> > line to get the times.  Then we had an array of the times and matched the
> > slice number with the array offset by 1.
> >
> > Sorry I cannot locate the code.
> >
> > But in the end, if we had used the nominal time instead of the time
> > reported times, the answer regarding biology would not have changed.
> >
> >
> > Michael Cammer, Sr Research Scientist, DART Microscopy Laboratory
> >
> > NYU Langone Health, 540 First Avenue, SK2 Microscopy Suite, New York, NY
> > 10016
> >
> > [hidden email]<mailto:[hidden email]>
> > https://urldefense.proofpoint.com/v2/url?u=http-3A__nyulmc.org_micros&d=DwIFaQ&c=j5oPpO0eBH1iio48DtsedbOBGmuw5jHLjgvtN2r4ehE&r=oU_05LztNstAydlbm5L5GDu_vAdjXk3frDLx_CqKkuo&m=-n2cwaRgJv_piIFFn-fNXI2rxf1VvdJYZ9h7PnP4Nn8&s=fpc5SD3hoD9YH1e0UeJvwtdi_fN9cgGy8gCTnfTBESw&e=  https://urldefense.proofpoint.com/v2/url?u=http-3A__microscopynotes.com_&d=DwIFaQ&c=j5oPpO0eBH1iio48DtsedbOBGmuw5jHLjgvtN2r4ehE&r=oU_05LztNstAydlbm5L5GDu_vAdjXk3frDLx_CqKkuo&m=-n2cwaRgJv_piIFFn-fNXI2rxf1VvdJYZ9h7PnP4Nn8&s=TbPtIDQKxP7DRZgkM0oDTl9SmgLG_8XkQbJ3It7GRr4&e=
> >
> > Voice direct only, no text or messages:  1-914-309-3270 and 1-646-501-0567
> >
> >
> >
> > ________________________________
> > From: Philippe CARL <[hidden email]>
> > Sent: Friday, June 22, 2018 9:13:31 AM
> > To: [hidden email]
> > Subject: Get time unit from meta data within a macro
> >
> > Dear all,
> >
> > Inside a macro, I would need to get a hold of the time unit parameter (s, m
> > or h) saved within the meta data of a tif file.
> >
> > Thus my first guess was to use the Ext. features of the Loci toolbox but
> > very unfortunately there is no getUnitT or getTimeUnit or similar method
> > within their package.
> >
> > Another idea was to get a hold to the data displayed within the "OME
> > Metadata" window when selecting the "Display OME-XML metadata" option of
> > the
> > Bio-formats importer.
> >
> > But I haven’t figured out a way to access the data displayed within this
> > window.
> >
> > And at last, given that the parameter I’m interested in is saved within the
> > end of the tiff file, I thought about using a kind of
> > "File.openAsRawString(path, count)" method that would start from the end of
> > the file or alternatively have a kind of "File.openAsRawString(path, begin,
> > end)" macro method with begin and end defining the positions of a pointer
> > within to file from where to where the data are read and interpreted as
> > text.
> >
> > But with none of these ideas or paths I was able to solve the issue.
> >
> > Thus is there a better option (and that would be working) on which I didn’t
> > think for solving this issue?
> >
> > I thank you very much in advance for your ideas and help.
> >
> > My best regards,
> >
> > Philippe
> >
> >
> >
> > Philippe CARL
> >
> > Laboratoire de Bioimagerie et Pathologies
> >
> > UMR 7021 CNRS - Université de Strasbourg
> >
> > Faculté de Pharmacie
> >
> > 74 route du Rhin
> >
> > 67401 ILLKIRCH
> >
> > Tel : +33(0)3 68 85 41 84
> >
> >
> > --
> > ImageJ mailing list: https://urldefense.proofpoint.com/v2/url?u=https-3A__urldefense.proofpoint&d=DwIFaQ&c=j5oPpO0eBH1iio48DtsedbOBGmuw5jHLjgvtN2r4ehE&r=oU_05LztNstAydlbm5L5GDu_vAdjXk3frDLx_CqKkuo&m=-n2cwaRgJv_piIFFn-fNXI2rxf1VvdJYZ9h7PnP4Nn8&s=WEitu7yDiY83DzqsiCW2tb6HOhU6D7CXBT5EqJFS4RA&e=.
> > com/v2/url?u=http-3A__imagej.nih.gov_ij_list.html&d=DwIFAw&c=
> > j5oPpO0eBH1iio48DtsedbOBGmuw5jHLjgvtN2r4ehE&r=oU_05LztNstAydlbm5L5GDu_
> > vAdjXk3frDLx_CqKkuo&m=dS38J0J14zqHkmOdMFWyZny4r4XYljdfgW4z9H_kct8&s=
> > fJWaut6Gg1As0v_xwL_Q4Wr9hiSgEs1dKx-nGCCvmyY&e=
> >
> > ------------------------------------------------------------
> > This email message, including any attachments, is for the sole use of the
> > intended recipient(s) and may contain information that is proprietary,
> > confidential, and exempt from disclosure under applicable law. Any

> > unauthorized review, use, disclosure, or distribution is prohibited. If you
> > have received this email in error please notify the sender by return email
> > and delete the original message. Please note, the recipient should check
> > this email and any attachments for the presence of viruses. The
> > organization accepts no liability for any damage caused by any virus
> > transmitted by this email.
> > =================================
> >
> > --
> > ImageJ mailing list: https://urldefense.proofpoint.com/v2/url?u=http-3A__imagej.nih.gov_ij_list.html&d=DwIFaQ&c=j5oPpO0eBH1iio48DtsedbOBGmuw5jHLjgvtN2r4ehE&r=oU_05LztNstAydlbm5L5GDu_vAdjXk3frDLx_CqKkuo&m=-n2cwaRgJv_piIFFn-fNXI2rxf1VvdJYZ9h7PnP4Nn8&s=11cFXTSYXGiSAzngr4knsJBl3Q1dszzwPE-0E24Iz2k&e=
> >
>
> --
> ImageJ mailing list: https://urldefense.proofpoint.com/v2/url?u=http-3A__imagej.nih.gov_ij_list.html&d=DwIFaQ&c=j5oPpO0eBH1iio48DtsedbOBGmuw5jHLjgvtN2r4ehE&r=oU_05LztNstAydlbm5L5GDu_vAdjXk3frDLx_CqKkuo&m=-n2cwaRgJv_piIFFn-fNXI2rxf1VvdJYZ9h7PnP4Nn8&s=11cFXTSYXGiSAzngr4knsJBl3Q1dszzwPE-0E24Iz2k&e=





--
ImageJ mailing list: https://urldefense.proofpoint.com/v2/url?u=http-3A__imagej.nih.gov_ij_list.html&d=DwIFaQ&c=j5oPpO0eBH1iio48DtsedbOBGmuw5jHLjgvtN2r4ehE&r=oU_05LztNstAydlbm5L5GDu_vAdjXk3frDLx_CqKkuo&m=-n2cwaRgJv_piIFFn-fNXI2rxf1VvdJYZ9h7PnP4Nn8&s=11cFXTSYXGiSAzngr4knsJBl3Q1dszzwPE-0E24Iz2k&e=

------------------------------------------------------------
This email message, including any attachments, is for the sole use of the intended recipient(s) and may contain information that is proprietary, confidential, and exempt from disclosure under applicable law. Any unauthorized review, use, disclosure, or distribution is prohibited. If you have received this email in error please notify the sender by return email and delete the original message. Please note, the recipient should check this email and any attachments for the presence of viruses. The organization accepts no liability for any damage caused by any virus transmitted by this email.
=================================


--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Get time unit from meta data within a macro

Philippe CARL
Dear Michael,
Your proposed solution is indeed working!

In parallel I also received a similar solution from Jérôme using the following Java code:
                IJ.debugMode = true;
                IJ.open();
                IJ.debugMode = false;
And I was aware of this "IJ.debugMode" trick either!

Thanks a lot for both of you!!!
My best regards,
Philippe

-----Message d'origine-----
De : ImageJ Interest Group [mailto:[hidden email]] De la part de Cammer, Michael
Envoyé : lundi 25 juin 2018 23:02
À : [hidden email]
Objet : Re: Get time unit from meta data within a macro

Just tried this on a nd2 file from Nikon Elements.

  info = getMetadata("Info");
  // print(info);
  infolist = split(info, "\t\n\r");
  for (i=0; i<infolist.length; i++)
    if(startsWith(infolist[i], "times"))
      print(infolist[i]);

Give result:
timestamp #01 = 0.9597483713328838
timestamp #02 = 2.7837702463269234
timestamp #03 = 4.653781396329403
timestamp #04 = 6.501763421326876
timestamp #05 = 8.391364496350288
timestamp #06 = 10.297633496344089
timestamp #07 = 12.22872657135129
timestamp #08 = 14.103870246350764
timestamp #09 = 16.02579087135196
timestamp #10 = 17.901595146328212
timestamp #11 = 19.792212546348573  
etc.


Michael Cammer, Sr Research Scientist, DART Microscopy Laboratory
NYU Langone Health, 540 First Avenue, SK2 Microscopy Suite, New York, NY  10016
[hidden email]  http://nyulmc.org/micros  http://microscopynotes.com/ 
Voice direct only, no text or messages:  1-914-309-3270 and 1-646-501-0567



-----Original Message-----
From: CARL Philippe (LBP) [mailto:[hidden email]]
Sent: Friday, June 22, 2018 3:46 PM
To: [hidden email]
Subject: Re: Get time unit from meta data within a macro

Dear George,
Thanks a lot for the indicated link, but its code is simply using the Ext features of the Loci feature.
Very unfortunatelly as can be seen here:
https://urldefense.proofpoint.com/v2/url?u=http-3A__downloads.openmicroscopy.org_bio-2Dformats_5.4.1_api_loci_plugins_macro_LociFunctions.html&d=DwIFaQ&c=j5oPpO0eBH1iio48DtsedbOBGmuw5jHLjgvtN2r4ehE&r=oU_05LztNstAydlbm5L5GDu_vAdjXk3frDLx_CqKkuo&m=-n2cwaRgJv_piIFFn-fNXI2rxf1VvdJYZ9h7PnP4Nn8&s=4hvGvyOc85MlYntlC2BIoEF_zcosRGUJnujvfvic56M&e=
There is no method within the Bio formats tool that able you to extract the time unit (as getPlaneTimingDeltaT and getPlaneTimingExposureTime are implemented).

Dear Michael,
What you propose is a potential solution I thought as well about.
But I'm blocked on the first step, i.e. on how to "get all the metadata as a string or array of strings".

I thank you very much in advance for your help.

My best regards,

Philippe

Le Vendredi 22 Juin 2018 18:39 CEST, George Patterson <[hidden email]> a écrit:

> Dear Phillippe,
> Here is a link to macro written by Curtis Rueden.
> We use a variation on this to get the time stamps for our images.
> Best,
> George
>
> https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_openmicroscopy_bioformats_blob_develop_components_bio-2Dformats-2Dplugins_utils_macros_planeTimings.txt&d=DwIFaQ&c=j5oPpO0eBH1iio48DtsedbOBGmuw5jHLjgvtN2r4ehE&r=oU_05LztNstAydlbm5L5GDu_vAdjXk3frDLx_CqKkuo&m=-n2cwaRgJv_piIFFn-fNXI2rxf1VvdJYZ9h7PnP4Nn8&s=dPCHzTLwyMlfr4I6KhHKPakiBM3pXhM2ivj_4n5VWkc&e=
>
> On Fri, Jun 22, 2018 at 10:52 AM, Cammer, Michael <
> [hidden email]> wrote:
>
> > Years ago I wrote a macro for someone to pull the times out of the

> > metadata of an ND2 file.
> >
> > I think I got all the metadata as a string or array of strings and then
> > checked the beginning of each line for the time tag and then parsed the
> > line to get the times.  Then we had an array of the times and matched the
> > slice number with the array offset by 1.
> >
> > Sorry I cannot locate the code.
> >
> > But in the end, if we had used the nominal time instead of the time
> > reported times, the answer regarding biology would not have changed.
> >
> >
> > Michael Cammer, Sr Research Scientist, DART Microscopy Laboratory
> >
> > NYU Langone Health, 540 First Avenue, SK2 Microscopy Suite, New York, NY
> > 10016
> >
> > [hidden email]<mailto:[hidden email]>
> > https://urldefense.proofpoint.com/v2/url?u=http-3A__nyulmc.org_micros&d=DwIFaQ&c=j5oPpO0eBH1iio48DtsedbOBGmuw5jHLjgvtN2r4ehE&r=oU_05LztNstAydlbm5L5GDu_vAdjXk3frDLx_CqKkuo&m=-n2cwaRgJv_piIFFn-fNXI2rxf1VvdJYZ9h7PnP4Nn8&s=fpc5SD3hoD9YH1e0UeJvwtdi_fN9cgGy8gCTnfTBESw&e=  https://urldefense.proofpoint.com/v2/url?u=http-3A__microscopynotes.com_&d=DwIFaQ&c=j5oPpO0eBH1iio48DtsedbOBGmuw5jHLjgvtN2r4ehE&r=oU_05LztNstAydlbm5L5GDu_vAdjXk3frDLx_CqKkuo&m=-n2cwaRgJv_piIFFn-fNXI2rxf1VvdJYZ9h7PnP4Nn8&s=TbPtIDQKxP7DRZgkM0oDTl9SmgLG_8XkQbJ3It7GRr4&e=
> >
> > Voice direct only, no text or messages:  1-914-309-3270 and 1-646-501-0567
> >
> >
> >
> > ________________________________
> > From: Philippe CARL <[hidden email]>
> > Sent: Friday, June 22, 2018 9:13:31 AM
> > To: [hidden email]
> > Subject: Get time unit from meta data within a macro
> >
> > Dear all,
> >
> > Inside a macro, I would need to get a hold of the time unit parameter (s, m
> > or h) saved within the meta data of a tif file.
> >
> > Thus my first guess was to use the Ext. features of the Loci toolbox but
> > very unfortunately there is no getUnitT or getTimeUnit or similar method
> > within their package.
> >
> > Another idea was to get a hold to the data displayed within the "OME
> > Metadata" window when selecting the "Display OME-XML metadata" option of
> > the
> > Bio-formats importer.
> >
> > But I haven’t figured out a way to access the data displayed within this
> > window.
> >
> > And at last, given that the parameter I’m interested in is saved within the
> > end of the tiff file, I thought about using a kind of
> > "File.openAsRawString(path, count)" method that would start from the end of
> > the file or alternatively have a kind of "File.openAsRawString(path, begin,
> > end)" macro method with begin and end defining the positions of a pointer
> > within to file from where to where the data are read and interpreted as
> > text.
> >
> > But with none of these ideas or paths I was able to solve the issue.
> >
> > Thus is there a better option (and that would be working) on which I didn’t
> > think for solving this issue?
> >
> > I thank you very much in advance for your ideas and help.
> >
> > My best regards,
> >
> > Philippe
> >
> >
> >
> > Philippe CARL
> >
> > Laboratoire de Bioimagerie et Pathologies
> >
> > UMR 7021 CNRS - Université de Strasbourg
> >
> > Faculté de Pharmacie
> >
> > 74 route du Rhin
> >
> > 67401 ILLKIRCH
> >
> > Tel : +33(0)3 68 85 41 84
> >
> >
> > --
> > ImageJ mailing list: https://urldefense.proofpoint.com/v2/url?u=https-3A__urldefense.proofpoint&d=DwIFaQ&c=j5oPpO0eBH1iio48DtsedbOBGmuw5jHLjgvtN2r4ehE&r=oU_05LztNstAydlbm5L5GDu_vAdjXk3frDLx_CqKkuo&m=-n2cwaRgJv_piIFFn-fNXI2rxf1VvdJYZ9h7PnP4Nn8&s=WEitu7yDiY83DzqsiCW2tb6HOhU6D7CXBT5EqJFS4RA&e=.
> > com/v2/url?u=http-3A__imagej.nih.gov_ij_list.html&d=DwIFAw&c=
> > j5oPpO0eBH1iio48DtsedbOBGmuw5jHLjgvtN2r4ehE&r=oU_05LztNstAydlbm5L5GDu_
> > vAdjXk3frDLx_CqKkuo&m=dS38J0J14zqHkmOdMFWyZny4r4XYljdfgW4z9H_kct8&s=
> > fJWaut6Gg1As0v_xwL_Q4Wr9hiSgEs1dKx-nGCCvmyY&e=
> >
> > ------------------------------------------------------------
> > This email message, including any attachments, is for the sole use of the
> > intended recipient(s) and may contain information that is proprietary,
> > confidential, and exempt from disclosure under applicable law. Any

> > unauthorized review, use, disclosure, or distribution is prohibited. If you
> > have received this email in error please notify the sender by return email
> > and delete the original message. Please note, the recipient should check
> > this email and any attachments for the presence of viruses. The
> > organization accepts no liability for any damage caused by any virus
> > transmitted by this email.
> > =================================
> >
> > --
> > ImageJ mailing list: https://urldefense.proofpoint.com/v2/url?u=http-3A__imagej.nih.gov_ij_list.html&d=DwIFaQ&c=j5oPpO0eBH1iio48DtsedbOBGmuw5jHLjgvtN2r4ehE&r=oU_05LztNstAydlbm5L5GDu_vAdjXk3frDLx_CqKkuo&m=-n2cwaRgJv_piIFFn-fNXI2rxf1VvdJYZ9h7PnP4Nn8&s=11cFXTSYXGiSAzngr4knsJBl3Q1dszzwPE-0E24Iz2k&e=
> >
>
> --
> ImageJ mailing list: https://urldefense.proofpoint.com/v2/url?u=http-3A__imagej.nih.gov_ij_list.html&d=DwIFaQ&c=j5oPpO0eBH1iio48DtsedbOBGmuw5jHLjgvtN2r4ehE&r=oU_05LztNstAydlbm5L5GDu_vAdjXk3frDLx_CqKkuo&m=-n2cwaRgJv_piIFFn-fNXI2rxf1VvdJYZ9h7PnP4Nn8&s=11cFXTSYXGiSAzngr4knsJBl3Q1dszzwPE-0E24Iz2k&e=





--
ImageJ mailing list: https://urldefense.proofpoint.com/v2/url?u=http-3A__imagej.nih.gov_ij_list.html&d=DwIFaQ&c=j5oPpO0eBH1iio48DtsedbOBGmuw5jHLjgvtN2r4ehE&r=oU_05LztNstAydlbm5L5GDu_vAdjXk3frDLx_CqKkuo&m=-n2cwaRgJv_piIFFn-fNXI2rxf1VvdJYZ9h7PnP4Nn8&s=11cFXTSYXGiSAzngr4knsJBl3Q1dszzwPE-0E24Iz2k&e=

------------------------------------------------------------
This email message, including any attachments, is for the sole use of the intended recipient(s) and may contain information that is proprietary, confidential, and exempt from disclosure under applicable law. Any unauthorized review, use, disclosure, or distribution is prohibited. If you have received this email in error please notify the sender by return email and delete the original message. Please note, the recipient should check this email and any attachments for the presence of viruses. The organization accepts no liability for any damage caused by any virus transmitted by this email.
=================================


--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html