including measured data in videostack

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

including measured data in videostack

dschones
Hi,

I use SEM to take videos of an old powertransistor biased with a triangle
voltage (AC) between emitter and base in order to compare contrast and bias
voltage. The signal of the frequency generator is recorded by oscilloscope
and saved as csv-table, at a rate of one measurement every 10ms.

I use ImagaJ to create videostacks in order to manipulate the videos
(enhance contrast, correct shifting, add scalebars…). Now I'd like to
add/overlay the voltage data at the specific time, let's say in the lower
right corner. Any ideas if it is possible?

Thanks for your help. Best wishes!

Jonas
<http://imagej.1557.x6.nabble.com/file/t381882/mag50e0%2C7wd25ap2cl10_5V_1-1.gif>



--
Sent from: http://imagej.1557.x6.nabble.com/

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

Re: including measured data in videostack

Herbie
Good day Jonas,

this IJ-Forum contribution may help you further:
<http://forum.imagej.net/t/how-to-save-my-counter-results-on-my-image/10521/21>

Regards

Herbie

::::::::::::::::::::::::::::::::::::::

dschones wrote

> Hi,
>
> I use SEM to take videos of an old powertransistor biased with a triangle
> voltage (AC) between emitter and base in order to compare contrast and
> bias
> voltage. The signal of the frequency generator is recorded by oscilloscope
> and saved as csv-table, at a rate of one measurement every 10ms.
>
> I use ImagaJ to create videostacks in order to manipulate the videos
> (enhance contrast, correct shifting, add scalebars…). Now I'd like to
> add/overlay the voltage data at the specific time, let's say in the lower
> right corner. Any ideas if it is possible?
>
> Thanks for your help. Best wishes!
>
> Jonas
> &lt;http://imagej.1557.x6.nabble.com/file/t381882/mag50e0%2C7wd25ap2cl10_5V_1-1.gif&gt; 
>
>
>
> --
> Sent from: http://imagej.1557.x6.nabble.com/
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html





--
Sent from: http://imagej.1557.x6.nabble.com/

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

Re: including measured data in videostack

Jerome Mutterer-3
In reply to this post by dschones
Hi Jonas,

You need to read and parse the csv file to get the voltage data, and then
overlay it the the image.

image = "/Users/jeromemutterer/Desktop/mag50e0,7wd25ap2cl10_5V_1-1.gif";
csv_data = "/Users/jeromemutterer/Desktop/data.csv";
data = split (File.openAsString(csv_data), "\n");
open (image);
for (i=0;i<nSlices;i++) {
  setSlice(i+1);
  csv_line = split (data[i],",");
  voltage = csv_line[1];
  makeText(voltage, 10, getHeight-20);
  run("Add Selection...","");
}
run ("Select None");
//////

I used a csv file that looks like this:

1,510 V
2,520 V
3,530 V
4,540 V
5,550 V
6,560 V
7,570 V
8,580 V
9,590 V
10,600 V
11,610 V
12,620 V
13,630 V
14,640 V
15,650 V
16,660 V
17,670 V
18,680 V
19,690 V
20,700 V
21,710 V
22,720 V


2018-06-23 18:49 GMT+02:00 dschones <[hidden email]>:

> Hi,
>
> I use SEM to take videos of an old powertransistor biased with a triangle
> voltage (AC) between emitter and base in order to compare contrast and bias
> voltage. The signal of the frequency generator is recorded by oscilloscope
> and saved as csv-table, at a rate of one measurement every 10ms.
>
> I use ImagaJ to create videostacks in order to manipulate the videos
> (enhance contrast, correct shifting, add scalebars…). Now I'd like to
> add/overlay the voltage data at the specific time, let's say in the lower
> right corner. Any ideas if it is possible?
>
> Thanks for your help. Best wishes!
>
> Jonas
> <<a href="http://imagej.1557.x6.nabble.com/file/t381882/mag50e0%">http://imagej.1557.x6.nabble.com/file/t381882/mag50e0%
> 2C7wd25ap2cl10_5V_1-1.gif>
>
>
>
> --
> Sent from: http://imagej.1557.x6.nabble.com/
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>



--
Jerome Mutterer
CNRS - Institut de biologie moléculaire des plantes
12, rue du Général Zimmer
67084 Strasbourg Cedex
www.ibmp.cnrs.fr

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

Re: including measured data in videostack

Jerome Mutterer-3
In reply to this post by Herbie
Herbie,
yours is a smarter solution !
Jerome



2018-06-24 13:24 GMT+02:00 Herbie <[hidden email]>:

> Good day Jonas,
>
> this IJ-Forum contribution may help you further:
> <http://forum.imagej.net/t/how-to-save-my-counter-
> results-on-my-image/10521/21>
>
> Regards
>
> Herbie
>
> ::::::::::::::::::::::::::::::::::::::
>
> dschones wrote
> > Hi,
> >
> > I use SEM to take videos of an old powertransistor biased with a triangle
> > voltage (AC) between emitter and base in order to compare contrast and
> > bias
> > voltage. The signal of the frequency generator is recorded by
> oscilloscope
> > and saved as csv-table, at a rate of one measurement every 10ms.
> >
> > I use ImagaJ to create videostacks in order to manipulate the videos
> > (enhance contrast, correct shifting, add scalebars…). Now I'd like to
> > add/overlay the voltage data at the specific time, let's say in the lower
> > right corner. Any ideas if it is possible?
> >
> > Thanks for your help. Best wishes!
> >
> > Jonas
> > &lt;http://imagej.1557.x6.nabble.com/file/t381882/
> mag50e0%2C7wd25ap2cl10_5V_1-1.gif&gt;
> >
> >
> >
> > --
> > Sent from: http://imagej.1557.x6.nabble.com/
> >
> > --
> > ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>
>
>
>
>
> --
> Sent from: http://imagej.1557.x6.nabble.com/
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>



--
Jerome Mutterer
CNRS - Institut de biologie moléculaire des plantes
12, rue du Général Zimmer
67084 Strasbourg Cedex
www.ibmp.cnrs.fr

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

Re: including measured data in videostack

Herbie
Thanks Jerome,

but your solution may suffice!

Best

Herbie

::::::::::::::::::::::::::::::::::::::::::::
Am 24.06.18 um 13:41 schrieb Jerome Mutterer:

> Herbie,
> yours is a smarter solution !
> Jerome
>
>
>
> 2018-06-24 13:24 GMT+02:00 Herbie <[hidden email]>:
>
>> Good day Jonas,
>>
>> this IJ-Forum contribution may help you further:
>> <http://forum.imagej.net/t/how-to-save-my-counter-
>> results-on-my-image/10521/21>
>>
>> Regards
>>
>> Herbie
>>
>> ::::::::::::::::::::::::::::::::::::::
>>
>> dschones wrote
>>> Hi,
>>>
>>> I use SEM to take videos of an old powertransistor biased with a triangle
>>> voltage (AC) between emitter and base in order to compare contrast and
>>> bias
>>> voltage. The signal of the frequency generator is recorded by
>> oscilloscope
>>> and saved as csv-table, at a rate of one measurement every 10ms.
>>>
>>> I use ImagaJ to create videostacks in order to manipulate the videos
>>> (enhance contrast, correct shifting, add scalebars…). Now I'd like to
>>> add/overlay the voltage data at the specific time, let's say in the lower
>>> right corner. Any ideas if it is possible?
>>>
>>> Thanks for your help. Best wishes!
>>>
>>> Jonas
>>> &lt;http://imagej.1557.x6.nabble.com/file/t381882/
>> mag50e0%2C7wd25ap2cl10_5V_1-1.gif&gt;
>>>
>>>
>>>
>>> --
>>> Sent from: http://imagej.1557.x6.nabble.com/
>>>
>>> --
>>> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>>
>>
>>
>>
>>
>> --
>> Sent from: http://imagej.1557.x6.nabble.com/
>>
>> --
>> 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: including measured data in videostack

dschones
Wow, thanks to both of you!

This list/forum is really helpful! I'll never use any other prog editing
images/videos :)

Now my only problem is that I get an error with the length of my videos
while creating the stack (›AVI File Error: 'III1' @ 0x2eb17440 has invalid
length. File damaged/truncated?‹). It contains every image of the video but
the timescale, the length is 5~10s short. Any ideas.

All the best wishes
Jonas



--
Sent from: http://imagej.1557.x6.nabble.com/

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

Re: including measured data in videostack

dschones
dschones wrote
> Now my only problem is that I get an error with the length of my videos
> while creating the stack (›AVI File Error: 'III1' @ 0x2eb17440 has invalid
> length. File damaged/truncated?‹).

My captured avis were corrupted. I found a solution to recapture them.
Thanks for your help
Best wishes, jonas




--
Sent from: http://imagej.1557.x6.nabble.com/

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

Re: including measured data in videostack

dschones
In reply to this post by Jerome Mutterer-3
Hi Jerome,

i try to get the macro running on a stack of 353 slices with a csv of 353
lines which look similiiar like yours:

0,16 V
0,08 V
0,08 V
0,00 V
0,08 V
0,08 V
0,08 V
0,08 V
...

When I run the macro a new stack with the double amount of frames opens and
I get the following error:

Index (353) out of 0-352 range in line 7:
csv_line = split ( data [ i <]> , "," ) ;

The new stack has a rect in the downer left corner with the decimals of line
7 which appear in every slice and can be moved (and deleted). underneath are
the correct decimals of line 1-353 in these specific slices.

Any idea what I can do?

Thanks for your help!

Best wishes, Jonas



--
Sent from: http://imagej.1557.x6.nabble.com/

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

Re: including measured data in videostack

Jerome Mutterer-3
Hi Jonas,
The macro stops because the data array only has 353 elements (number of
lines in the csv file)
The text you see in the lower left corner is the latest text selection
added to the 353th slice.
Bottom line : you need a csv file with as many lines as the stack has
slices.
Maybe for some reason, the data was only saved in the csv for every other
slice, or maybe each image was add twice in the stack.
Sincerely,
Jerome.

2018-06-27 19:12 GMT+02:00 dschones <[hidden email]>:

> Hi Jerome,
>
> i try to get the macro running on a stack of 353 slices with a csv of 353
> lines which look similiiar like yours:
>
> 0,16 V
> 0,08 V
> 0,08 V
> 0,00 V
> 0,08 V
> 0,08 V
> 0,08 V
> 0,08 V
> ...
>
> When I run the macro a new stack with the double amount of frames opens and
> I get the following error:
>
> Index (353) out of 0-352 range in line 7:
> csv_line = split ( data [ i <]> , "," ) ;
>
> The new stack has a rect in the downer left corner with the decimals of
> line
> 7 which appear in every slice and can be moved (and deleted). underneath
> are
> the correct decimals of line 1-353 in these specific slices.
>
> Any idea what I can do?
>
> Thanks for your help!
>
> Best wishes, Jonas
>
>
>
> --
> Sent from: http://imagej.1557.x6.nabble.com/
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>



--
Jerome Mutterer
CNRS - Institut de biologie moléculaire des plantes
12, rue du Général Zimmer
67084 Strasbourg Cedex
www.ibmp.cnrs.fr

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

Re: including measured data in videostack

dschones
Hi Jerome,
Thanks for helping me. That one I managed. I did the "stack -> tools ->
reduce" feature in order to get the right number of slices before but didn't
save in the meantime..
I still can't figure out why the macro is inserting only digits but the hole
data content. So I get "08 V", "16 V",  .. "80 V" instead of "0,08 V", "0,16
V", .. "-2,80 V". What to do?
Merci, jonas


Jerome Mutterer-3 wrote

> Hi Jonas,
> The macro stops because the data array only has 353 elements (number of
> lines in the csv file)
> The text you see in the lower left corner is the latest text selection
> added to the 353th slice.
> Bottom line : you need a csv file with as many lines as the stack has
> slices.
> Maybe for some reason, the data was only saved in the csv for every other
> slice, or maybe each image was add twice in the stack.
> Sincerely,
> Jerome.





--
Sent from: http://imagej.1557.x6.nabble.com/

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

Re: including measured data in videostack

Herbie
The latter issue may be due to "," versus "." decimal delimiter and this
may be more a problem of a localized version of EXCEL. You can change
this in the EXCEL preferences.

HTH

Herbie

::::::::::::::::::::::::::::::::::::::
Am 27.06.18 um 22:05 schrieb dschones:

> Hi Jerome,
> Thanks for helping me. That one I managed. I did the "stack -> tools ->
> reduce" feature in order to get the right number of slices before but didn't
> save in the meantime..
> I still can't figure out why the macro is inserting only digits but the hole
> data content. So I get "08 V", "16 V",  .. "80 V" instead of "0,08 V", "0,16
> V", .. "-2,80 V". What to do?
> Merci, jonas
>
>
> Jerome Mutterer-3 wrote
>> Hi Jonas,
>> The macro stops because the data array only has 353 elements (number of
>> lines in the csv file)
>> The text you see in the lower left corner is the latest text selection
>> added to the 353th slice.
>> Bottom line : you need a csv file with as many lines as the stack has
>> slices.
>> Maybe for some reason, the data was only saved in the csv for every other
>> slice, or maybe each image was add twice in the stack.
>> Sincerely,
>> Jerome.
>
>
>
>
>
> --
> Sent from: http://imagej.1557.x6.nabble.com/
>
> --
> 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: including measured data in videostack

dschones
Unfortunately not.
If I open the csv in a text editor it looks like the list I posted. without
any other delimiter or charakter.
The Problem remains the same when I change from "," to "."
Best wishes, jonas



--
Sent from: http://imagej.1557.x6.nabble.com/

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

Re: including measured data in videostack

Herbie
CSV means Comma Separated Values.

Perhaps this helps.

Herbie

PS:
Please provide a typical small stack and the corresponding text-file
(preferably tab-delimited) with the values.

:::::::::::::::::::::::::::::::::::::

dschones wrote

> Unfortunately not.
> If I open the csv in a text editor it looks like the list I posted.
> without
> any other delimiter or charakter.
> The Problem remains the same when I change from "," to "."
> Best wishes, jonas
>
>
>
> --
> Sent from: http://imagej.1557.x6.nabble.com/
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html





--
Sent from: http://imagej.1557.x6.nabble.com/

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

Re: including measured data in videostack

Herbie
In reply to this post by dschones
Jonas,

here is a zip-archive containing three files:
Archiv.zip <http://imagej.1557.x6.nabble.com/file/t380516/Archiv.zip>  

1. text2stack.ijm (the macro code)
2. TestStack.tif (a test stack containing 22 images)
3. Voltages.txt (a text file with the 22 voltages from Jerome's earlier
post)

Copy the three files to the same directory on your computer
Open the TestStack.tif in ImageJ
Double-click the macro-file and it should open in ImageJ
Run the macro
A file-dialog will ask for the file Voltages.txt
Open this file from the file-dialog

For me the macro then writes the voltages to the top left of every image of
the stack.

HTH

Herbie





--
Sent from: http://imagej.1557.x6.nabble.com/

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

Re: including measured data in videostack

dschones
Dear Herbie,

thanks a lot. that macro of yours works well, I just had to change the text
size and position and add antialiasing in order to make it smooth.
Unfortunately the one of Jerome is not working for me. I put the sample in
attached zip file.

samples.zip <http://imagej.1557.x6.nabble.com/file/t381882/samples.zip>  

Best wishes, Jonas



--
Sent from: http://imagej.1557.x6.nabble.com/

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

Re: including measured data in videostack

Jerome Mutterer-3
Hi Jonas, sorry for the delay.

In your case, you have a simple text file, not a CSV file. As Herbie
pointed, in your data the commas are part of the data you want to read, so
you do not need to split the lines.

You can change those two lines :

>
>   csv_line = split (data[i],",");
>   voltage = csv_line[1];



to this:

voltage = data[i];


and you'll get the correct data overlaid on your images.


Jerome



2018-06-28 14:27 GMT+02:00 dschones <[hidden email]>:

> Dear Herbie,
>
> thanks a lot. that macro of yours works well, I just had to change the text
> size and position and add antialiasing in order to make it smooth.
> Unfortunately the one of Jerome is not working for me. I put the sample in
> attached zip file.
>
> samples.zip <http://imagej.1557.x6.nabble.com/file/t381882/samples.zip>
>
> Best wishes, Jonas
>
>
>
> --
> Sent from: http://imagej.1557.x6.nabble.com/
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>



--
Jerome Mutterer
CNRS - Institut de biologie moléculaire des plantes
12, rue du Général Zimmer
67084 Strasbourg Cedex
www.ibmp.cnrs.fr

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

Re: including measured data in videostack

dschones
Thx Jerome, that will do :)
Have a nice weekend!
Best wishes, Jonas



--
Sent from: http://imagej.1557.x6.nabble.com/

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