calling getImageCount or getPlaneCount from matlab returns wrong values

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

calling getImageCount or getPlaneCount from matlab returns wrong values

Heerpa
Hello everyone,

I just tried to get the total number of planes in an image in matlab.
So I opened the file using bfopen.m from the loci website and get the image
cell; metadata is stored in the second entry, so trying
r = bfopen(..);
meta = r{2};
a = meta.getImageCount()
b = meta.getPlaneCount(0)

returns a==b==0.
However, running the command line script  showinf with the same versions of
loci_tools and bio_formats (4.3.3), the correct value is given in line 475:
int imageCount = reader.getImageCount();
 
Also, when I query
getPixelsSizeT(0)
getPixelsSizeC(0)
in matlab, the correct values are returned, and all the rest of metadata not
concerned with planes is returned correctly.
meta.getPlaneDeltaT(0,0)
returns empy.

I cannot think of any reason for this but the initialization of metadata in
bfopen might be different than that in showinf? But then, why should
querying it work with anything but planes?

Does any of you have an idea about that?

Cheers
--Heinrich

-----Ursprüngliche Nachricht-----
Von: ImageJ Interest Group [mailto:[hidden email]] Im Auftrag von
Curtis Rueden
Gesendet: Freitag, 20. Januar 2012 23:43
An: [hidden email]
Betreff: Re: extracting acquistion times from time series

Hi Felipe and everyone,

I have a time series in the form of a big stack of tiffs (thousands of
> tiffs) and I'd like to extract each frame's acquisition time quickly
> and efficiently.
>

I know it's been awhile since this thread, but I wanted to clarify that
Bio-Formats does support parsing of variable time stamps, converted from any
supported format. And as Janne suggests, there are some examples that
demonstrate how to do it.

For an ImageJ macro, see planeTimings.txt, linked from:
  http://loci.wisc.edu/bio-formats/imagej

For Java code, see PrintTimestamps.java, linked from:
  http://loci.wisc.edu/bio-formats/bio-formats-java-library

HTH,
Curtis


2011/12/9 Janne Hyötylä <[hidden email]>

> Hello Christophe and Felipe,
>
> I wrote a macro for a similar purpose. BioFormats can read the time
> stamps with arbitrary intervals. The timings are copied per channel
> into the clipboard from where you can paste them into a spreadsheet or
> whatever. Of course you can modify the macro to directly write to a
> file.
>
> The macro uses the getPlaneTimingDeltaT macro command from BioFormats,
> so if that doesn't return anything the macro fails as well. I tested
> it with plain TIFF stacks and it doesn't seem to work there. But for
> example for Leica LIF files it works perfectly.
> It works on one file at a time so also not sure if it would help you,
> Felipe (if you indeed have thousands of separate tiff files).
>
> I don't know how to attach files here and pasting it into the email
> might mess with the formatting, so please contact me off list if
> you're interested and I'll send it to you.
>
>
> Cheers,
> Janne
>
>
>
> On Fri, 09 Dec 2011 00:26:26 +0100, Christophe Leterrier
> <christophe.leterrier@gmail.**com <[hidden email]>> wrote:
>
>  Le jeudi 8 décembre 2011 à 22:53, Felipe-Andres Piedra a écrit :
>>
>>  Hi,
>>>
>>> I have a time series in the form of a big stack of tiffs (thousands
>>> of
>>> tiffs) and I'd like to extract each frame's acquisition time quickly
>>> and efficiently. I'd then like to export all of the acquisition
>>> times to a text file or an excel spreadsheet.
>>>
>>> Any help would be hugely appreciated!
>>>
>>> Thanks,
>>>
>>> Felipe
>>>
>>
>> I'd also be very interested in that. I guess this is more a
>> BioFormats question than an ImageJ one, as it deals with timestamp
>> metadata associated with microscope file formats (that's why I CCed
>> Curtis Rueden). Is it possible to have arbitrary time stamps or is
>> there only a constant time interval when importing a file as an xyt
>> stack? I seem to remember that ImageJ only allows a constant interval
>> in this case, so the intervals are averaged if they are not strictly
>> constant. But does it keep the real timestamp somewhere in the image
metadata ?

>>
>> A word on why I ask this question: when acquiring a stream of images
>> as fast as possible (such as when doing fluorescence recovery after
>> bleaching measurements on fast-diffusing molecules), the interval
>> between frame can vary quite a bit. Then, knowing the precise
>> interval would be interesting for precise fitting of the recovery curves.
>>
>> Christophe
>>
>
Reply | Threaded
Open this post in threaded view
|

AW: calling getImageCount or getPlaneCount from matlab returns wrong values

Heerpa
Sorry, wrong list
H

-----Ursprüngliche Nachricht-----
Von: ImageJ Interest Group [mailto:[hidden email]] Im Auftrag von
Heinrich Grabmayr
Gesendet: Samstag, 21. Januar 2012 19:36
An: [hidden email]
Betreff: calling getImageCount or getPlaneCount from matlab returns wrong
values

Hello everyone,

I just tried to get the total number of planes in an image in matlab.
So I opened the file using bfopen.m from the loci website and get the image
cell; metadata is stored in the second entry, so trying r = bfopen(..); meta
= r{2}; a = meta.getImageCount() b = meta.getPlaneCount(0)

returns a==b==0.
However, running the command line script  showinf with the same versions of
loci_tools and bio_formats (4.3.3), the correct value is given in line 475:
int imageCount = reader.getImageCount();
 
Also, when I query
getPixelsSizeT(0)
getPixelsSizeC(0)
in matlab, the correct values are returned, and all the rest of metadata not
concerned with planes is returned correctly.
meta.getPlaneDeltaT(0,0)
returns empy.

I cannot think of any reason for this but the initialization of metadata in
bfopen might be different than that in showinf? But then, why should
querying it work with anything but planes?

Does any of you have an idea about that?

Cheers
--Heinrich

-----Ursprüngliche Nachricht-----
Von: ImageJ Interest Group [mailto:[hidden email]] Im Auftrag von
Curtis Rueden
Gesendet: Freitag, 20. Januar 2012 23:43
An: [hidden email]
Betreff: Re: extracting acquistion times from time series

Hi Felipe and everyone,

I have a time series in the form of a big stack of tiffs (thousands of
> tiffs) and I'd like to extract each frame's acquisition time quickly
> and efficiently.
>

I know it's been awhile since this thread, but I wanted to clarify that
Bio-Formats does support parsing of variable time stamps, converted from any
supported format. And as Janne suggests, there are some examples that
demonstrate how to do it.

For an ImageJ macro, see planeTimings.txt, linked from:
  http://loci.wisc.edu/bio-formats/imagej

For Java code, see PrintTimestamps.java, linked from:
  http://loci.wisc.edu/bio-formats/bio-formats-java-library

HTH,
Curtis


2011/12/9 Janne Hyötylä <[hidden email]>

> Hello Christophe and Felipe,
>
> I wrote a macro for a similar purpose. BioFormats can read the time
> stamps with arbitrary intervals. The timings are copied per channel
> into the clipboard from where you can paste them into a spreadsheet or
> whatever. Of course you can modify the macro to directly write to a
> file.
>
> The macro uses the getPlaneTimingDeltaT macro command from BioFormats,
> so if that doesn't return anything the macro fails as well. I tested
> it with plain TIFF stacks and it doesn't seem to work there. But for
> example for Leica LIF files it works perfectly.
> It works on one file at a time so also not sure if it would help you,
> Felipe (if you indeed have thousands of separate tiff files).
>
> I don't know how to attach files here and pasting it into the email
> might mess with the formatting, so please contact me off list if
> you're interested and I'll send it to you.
>
>
> Cheers,
> Janne
>
>
>
> On Fri, 09 Dec 2011 00:26:26 +0100, Christophe Leterrier
> <christophe.leterrier@gmail.**com <[hidden email]>> wrote:
>
>  Le jeudi 8 décembre 2011 à 22:53, Felipe-Andres Piedra a écrit :
>>
>>  Hi,
>>>
>>> I have a time series in the form of a big stack of tiffs (thousands
>>> of
>>> tiffs) and I'd like to extract each frame's acquisition time quickly
>>> and efficiently. I'd then like to export all of the acquisition
>>> times to a text file or an excel spreadsheet.
>>>
>>> Any help would be hugely appreciated!
>>>
>>> Thanks,
>>>
>>> Felipe
>>>
>>
>> I'd also be very interested in that. I guess this is more a
>> BioFormats question than an ImageJ one, as it deals with timestamp
>> metadata associated with microscope file formats (that's why I CCed
>> Curtis Rueden). Is it possible to have arbitrary time stamps or is
>> there only a constant time interval when importing a file as an xyt
>> stack? I seem to remember that ImageJ only allows a constant interval
>> in this case, so the intervals are averaged if they are not strictly
>> constant. But does it keep the real timestamp somewhere in the image
metadata ?

>>
>> A word on why I ask this question: when acquiring a stream of images
>> as fast as possible (such as when doing fluorescence recovery after
>> bleaching measurements on fast-diffusing molecules), the interval
>> between frame can vary quite a bit. Then, knowing the precise
>> interval would be interesting for precise fitting of the recovery curves.
>>
>> Christophe
>>
>