need something quick

Feb 6, 2007 at 3:12pm

need something quick

hello, i just started out with MaxMsp and read about Jitter etc. but like i said, just started.

now, i’m also a Phd student in the biology department and i’m studying the aging process.

the two things aren’t linked, but reading about Jitter gave me an idea i need to work out very quickly now (and i’m not able to do it myself because i’m noob deluxe)

i want to measure quatitatively the amount of movement over time.

so i have this group of animals (little worms) that lie still. but will slowly regain the ability to move. i want to measure the amaunt/gain of movement over time. (i have two mutant groups and want to compare them)… it is a small test, but i need this done quick…

i will just make video’s of the process and use those as input for jitter to analyse.

that’s the idea alright…

so i would like to ask if someone has a patch like that? will jitter be able to do this?

like i said i need this quick, otherwise i would search and make all of it myself…

#30144
Feb 6, 2007 at 5:19pm

Hi GD,

This could work:

#P newex 257 56 66 196617 loadmess 65;
#P user jit.pwindow 282 178 82 62 0 1 0 0 1 0;
#P flonum 89 229 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 89 209 32 196617 mean;
#B color 5;
#P number 89 145 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 89 188 174 196617 pack 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.;
#P newex 104 167 150 196617 bucket 11;
#P number 210 36 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 210 56 44 196617 * 1000;
#P message 210 75 52 196617 thresh $1;
#P button 89 107 15 0;
#P newex 89 125 35 196617 timer;
#P message 145 30 30 196617 read;
#P toggle 89 30 15 0;
#P newex 89 48 46 196617 metro 5;
#P newex 89 87 54 196617 jit.change;
#P newex 89 67 97 196617 jit.qt.movie @vol 0;
#P comment 126 230 100 196617 < -- change rate;
#P comment 247 36 67 196617 < -- treshold;
#P connect 14 0 13 0;
#P fasten 14 0 12 0 94 163 109 163;
#P connect 12 10 13 11;
#P connect 12 9 13 10;
#P connect 12 8 13 9;
#P connect 12 7 13 8;
#P connect 12 6 13 7;
#P connect 12 5 13 6;
#P connect 12 4 13 5;
#P connect 12 3 13 4;
#P connect 12 2 13 3;
#P connect 12 1 13 2;
#P connect 12 0 13 1;
#P connect 13 0 15 0;
#P connect 18 0 11 0;
#P connect 2 0 3 0;
#P connect 2 0 17 0;
#P connect 4 0 2 0;
#P connect 5 0 4 0;
#P connect 7 0 14 0;
#P connect 15 0 16 0;
#P connect 8 0 7 0;
#P connect 8 0 7 1;
#P connect 3 0 8 0;
#P connect 11 0 10 0;
#P connect 10 0 9 0;
#P connect 9 0 3 0;
#P connect 6 0 2 0;

Cheers,
Mattijs

#95732
Feb 6, 2007 at 5:37pm

yep start searching and start making a small patch
then send a patch and we will give advice….

>
>
>like i said i need this quick, otherwise i would search and make all
>of it myself…
>
>
>

#95733
Feb 7, 2007 at 4:33pm

wohow Mattijs, that’s almost exactly what i was looking for!

i tried to at least understand the basics of the patch.

as i see it the actual framerate of te mov file should be the limiting factor in this patch?

this is very encouraging…

basicly this patch sends bangs (frames) when a certainamount of pixels/cells in a matrix change from one frame to the next? is this correct?

so to actually quantise the amount of movement i should maybe have a set of different thresholds and count the amount of bangs over time for each threshold value?

i take it that i will also be able to program a patch that can track individual subject? that would be very cool! because i could eg follow 10 individuals simultaneously from 1 video!

thanks for your patch!

#95734
Feb 7, 2007 at 6:18pm

Quote: GD wrote on Wed, 07 February 2007 17:33
—————————————————-
> wohow Mattijs, that’s almost exactly what i was looking for!
>
> i tried to at least understand the basics of the patch.
>
> as i see it the actual framerate of te mov file should be the limiting factor in this patch?
>
> this is very encouraging…
>
> basicly this patch sends bangs (frames) when a certainamount of pixels/cells in a matrix change from one frame to the next? is this correct?

that’s correct

>
> so to actually quantise the amount of movement i should maybe have a set of different thresholds and count the amount of bangs over time for each threshold value?

No, the amount of change is equal to the amount of bangs per second (with a maximum of 1 bang per 5 ms, due to the movie framerate). The timer object counts the time between bangs, so the number that is output by timer has an inverse relationship with the amount of change, so will get smaller with more change.

You need only one threshold (the one that’s already present). Tweak this threshold to match the global amount of movement in your video, or in other words, the sensitivity of the system. Once you configured it to match your data you’ll no longer have to change the threshold. The 65000 I came up with was with very rapidly changing video, I can imagine that bringing it down works much better for worms that move slowly (I didn’t have that kind of test material ;) Test it and you’ll see the change factor get smaller when you lower the threshold.

>
>
> i take it that i will also be able to program a patch that can track individual subject? that would be very cool! because i could eg follow 10 individuals simultaneously from 1 video!

That would definitly be possible, but a factor 100 more difficult to do it right. Look here

http://www.iamas.ac.jp/~jovan02/cv/objects.html

for more about that.

>
> thanks for your patch!

You’re welcome,

Cheers,
Mattijs

#95735
Feb 8, 2007 at 7:53am

yes i understand.

but in my case i have a movie were the first 5 minutes are without movement. than slowly more and more movement over time untill the animals recovered completely and move around like they normally would.

i need to compare the rate of recovery (so the regain of movement) between two groups.

that’s why i came up with the different threshold levels… but indeed maybe that’s not the best way to do it.

i just need to record the actual program output somehow (and put the changing output of the program on a timeline) that way i should end up with data (a curve) i can really use!

you understand what i mean?

#95736
Feb 8, 2007 at 9:51am

Quote: GD wrote on Thu, 08 February 2007 08:53
—————————————————-

> i just need to record the actual program output somehow (and put the changing output of the program on a timeline) that way i should end up with data (a curve) i can really use!
>
> you understand what i mean?

I think I do. What about this? It writes the data to a coll every 500 ms. Shouldn’t be hard to fit the data into a curve..

#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P newex 180 316 72 196617 loadmess 500;
#P comment 216 336 164 196617 < -- interval between registrations;
#P number 180 336 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P toggle 132 336 15 0;
#P newex 132 355 58 196617 metro 500;
#P newex 132 376 27 196617 f;
#P newex 132 395 84 196617 prepend insert 1;
#N coll ;
#P newobj 132 414 53 196617 coll;
#P newex 317 116 66 196617 loadmess 65;
#P user jit.pwindow 342 238 82 62 0 1 0 0 1 0;
#P flonum 149 289 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 149 269 32 196617 mean;
#B color 5;
#P number 149 205 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 149 248 174 196617 pack 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.;
#P newex 164 227 150 196617 bucket 11;
#P number 270 96 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 270 116 44 196617 * 1000;
#P message 270 135 52 196617 thresh $1;
#P button 149 167 15 0;
#P newex 149 185 35 196617 timer;
#P message 205 90 30 196617 read;
#P toggle 149 90 15 0;
#P newex 149 108 46 196617 metro 5;
#P newex 149 147 54 196617 jit.change;
#P newex 149 127 97 196617 jit.qt.movie @vol 0;
#P comment 186 290 100 196617 < -- change rate;
#P comment 307 96 67 196617 < -- treshold;
#P connect 26 0 24 0;
#P connect 24 0 22 1;
#P connect 22 0 21 0;
#P connect 23 0 22 0;
#P connect 21 0 20 0;
#P connect 16 0 21 1;
#P connect 20 0 19 0;
#P connect 6 0 2 0;
#P connect 9 0 3 0;
#P connect 10 0 9 0;
#P connect 11 0 10 0;
#P connect 3 0 8 0;
#P connect 8 0 7 1;
#P connect 8 0 7 0;
#P connect 15 0 16 0;
#P connect 7 0 14 0;
#P connect 5 0 4 0;
#P connect 4 0 2 0;
#P connect 2 0 17 0;
#P connect 2 0 3 0;
#P connect 18 0 11 0;
#P connect 13 0 15 0;
#P connect 12 0 13 1;
#P connect 12 1 13 2;
#P connect 12 2 13 3;
#P connect 12 3 13 4;
#P connect 12 4 13 5;
#P connect 12 5 13 6;
#P connect 12 6 13 7;
#P connect 12 7 13 8;
#P connect 12 8 13 9;
#P connect 12 9 13 10;
#P connect 12 10 13 11;
#P fasten 14 0 12 0 154 223 169 223;
#P connect 14 0 13 0;
#P window clipboard copycount 27;

#95737

You must be logged in to reply to this topic.