Float32 "Value Keying" using a MOP?

May 5, 2008 at 5:15pm

Float32 "Value Keying" using a MOP?

Hi all
Here’s something that’s been coming up a few times in my latest project. Sorry if the answer’s obvious, I just can’t seem to find an elegant solution to this.
Basically what I’m looking for is an object / method of “keying” out only a certain range of values from a matrix, so that these are output to a smaller matrix containing only the relevant values. This is to be done for float32 data matrices, not video etc. I’ve currently done it on a cell by cell basis using jit.iter, but finding a MOP will be very nice indeed.
Any help is welcome!
-Nadav

#37560
May 5, 2008 at 6:12pm

its missing the final (and probably the most important) stage of adapting
the matrix to fit the smaller dim. you need wes xray package.

#P user jit.cellblock 320 226 566 331 139 9 5 5 45 17 0 1 1 0 0 0 1 1 1 0 0
0 255 255 255 0 0 0 0 0 0 191 191 191 0 0 0 215 215 240 1 1 1 0 4 0 0 0;
#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P newex 318 203 39 9109513 jit.bsort;
#P flonum 166 72 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P user jit.pwindow 10 177 82 62 0 1 0 0 1 0;
#P user jit.pwindow 183 121 82 62 0 1 0 0 1 0;
#P user jit.pwindow 99 151 82 62 0 1 0 0 1 0;
#P user jit.pwindow 329 94 82 62 0 1 0 0 1 0;
#P newex 77 126 95 9109513 xray.jit.cellcoords;
#P newex 2 155 85 9109513 xray.jit.keepcell;
#P user jit.cellblock 2 244 249 351 139 9 5 5 45 17 0 1 1 0 0 0 1 1 1 0 0 0
255 255 255 0 0 0 0 0 0 191 191 191 0 0 0 215 215 240 1 1 1 0 4 0 0 0;
#P newex 77 99 99 9109513 jit.op @op < @val 0.5;
#P user jit.cellblock 411 95 657 200 139 9 5 5 45 17 0 1 1 0 0 0 1 1 1 0 0 0
255 255 255 0 0 0 0 0 0 191 191 191 0 0 0 215 215 240 1 1 1 0 4 0 0 0;
#P toggle 2 25 15 0;
#P newex 2 46 60 9109513 qmetro 1444;
#P newex 2 69 96 9109513 jit.noise 1 float32 5 5;
#P connect 6 0 5 0;
#P connect 6 0 11 0;
#P connect 6 0 13 0;
#P connect 13 0 14 0;
#P connect 7 0 6 1;
#P connect 7 0 9 0;
#P connect 4 0 7 0;
#P fasten 4 0 10 0 82 120 189 120;
#P connect 0 0 6 0;
#P fasten 0 0 4 0 7 93 82 93;
#P fasten 0 0 8 0 7 91 335 91;
#P fasten 0 0 3 0 7 91 416 91;
#P connect 1 0 0 0;
#P connect 2 0 1 0;
#P connect 12 0 4 1;
#P window clipboard copycount 15;

peace in the middle east!

On Mon, May 5, 2008 at 8:15 PM, Nadav Assor wrote:

>
> Hi all
> Here’s something that’s been coming up a few times in my latest project.
> Sorry if the answer’s obvious, I just can’t seem to find an elegant solution
> to this.
> Basically what I’m looking for is an object / method of “keying” out only
> a certain range of values from a matrix, so that these are output to a
> smaller matrix containing only the relevant values. This is to be done for
> float32 data matrices, not video etc. I’ve currently done it on a cell by
> cell basis using jit.iter, but finding a MOP will be very nice indeed.
> Any help is welcome!
> -Nadav
>

#129870
May 5, 2008 at 8:38pm

Thanks! just what I was looking for. My humble thanks again also to wes for the great xray objects.

Don’t want to be picky, but while we’re there- still looking for an elegant solution to the second issue, that of automatically adapting the matrix to as small a dim as possible while getting rid of all unnecessary zeros?
Any ideas?
-n

#129871
May 5, 2008 at 10:37pm

going to sleep, thanks for the puzzle. jitter needs a zl.
next year….

#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P newex 251 246 53 9109513 jit.3m;
#P user jit.cellblock 101 544 739 573 139 9 9 1 45 17 0 1 1 0 0 0 1 1 1 0 0
0 255 255 255 0 0 0 0 0 0 191 191 191 0 0 0 215 215 240 1 1 1 0 4 0 0 0;
#P user jit.cellblock 101 482 739 511 139 9 25 1 45 17 0 1 1 0 0 0 1 1 1 0 0
0 255 255 255 0 0 0 0 0 0 191 191 191 0 0 0 215 215 240 1 1 1 0 4 0 0 0;
#P user jit.cellblock 101 513 739 542 139 9 25 1 45 17 0 1 1 0 0 0 1 1 1 0 0
0 255 255 255 0 0 0 0 0 0 191 191 191 0 0 0 215 215 240 1 1 1 0 4 0 0 0;
#P newex 9 386 295 9109513 jit.matrix 1 float32 25 @usesrcdim 1 @srcdimstart
24 @srcdimend 0;
#P newex 9 446 159 9109513 jit.scanwrap 1 float32 5 5 @mode 1;
#P message 102 417 36 9109513 dim $1;
#P newex 102 172 50 9109513 cv.jit.sum;
#N vpatcher 762 178 900 380;
#P window setfont “Sans Serif” 9.;
#P message 13 150 36 9109513 dim $1;
#P newex 13 129 40 9109513 change;
#P outlet 13 170 15 0;
#P newex 13 108 54 9109513 *;
#P newex 13 87 54 9109513 unpack 0 0;
#P newex 13 66 47 9109513 route dim;
#P newex 13 44 60 9109513 jit.matrixinfo;
#P inlet 13 24 15 0;
#P connect 0 0 1 0;
#P connect 1 0 2 0;
#P connect 2 0 3 0;
#P connect 3 0 4 0;
#P connect 4 0 6 0;
#P connect 6 0 7 0;
#P connect 7 0 5 0;
#P connect 3 1 4 1;
#P pop;
#P newobj 35 303 34 9109513 p 2to1;
#P newex 9 327 110 9109513 jit.scanwrap 1 float32 25;
#P newex 9 355 39 9109513 jit.bsort;
#P flonum 173 79 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 84 255 95 9109513 xray.jit.cellcoords;
#P newex 9 279 85 9109513 xray.jit.keepcell;
#P newex 84 106 99 9109513 jit.op @op < @val 0.5;
#P user jit.cellblock 267 102 495 190 139 9 5 5 45 17 0 1 1 0 0 0 0 0 1 0 0
0 255 255 255 0 0 0 0 0 0 191 191 191 0 0 0 215 215 240 1 1 1 0 4 0 0 0;
#P toggle 9 32 15 0;
#P newex 9 53 60 9109513 qmetro 1444;
#P newex 9 76 96 9109513 jit.noise 1 float32 5 5;
#P comment 24 589 100 9109513 yair reshef;
#P connect 1 0 6 0;
#P fasten 1 0 5 0 14 100 89 100;
#P fasten 1 0 4 0 14 98 272 98;
#P connect 3 0 2 0;
#P connect 2 0 1 0;
#P connect 6 0 10 0;
#P fasten 11 0 10 0 40 324 14 324;
#P connect 10 0 9 0;
#P connect 9 0 15 0;
#P fasten 13 0 14 0 107 440 14 440;
#P connect 15 0 14 0;
#P fasten 6 0 11 0 14 300 40 300;
#P connect 5 0 7 0;
#P connect 7 0 6 1;
#P hidden connect 9 0 17 0;
#P hidden connect 15 0 16 0;
#P hidden connect 14 0 18 0;
#P connect 5 0 12 0;
#P connect 12 0 13 0;
#P connect 8 0 5 1;
#P window clipboard copycount 20;

On Mon, May 5, 2008 at 11:38 PM, Nadav Assor wrote:

>
> Thanks! just what I was looking for. My humble thanks again also to wes
> for the great xray objects.
>
> Don’t want to be picky, but while we’re there- still looking for an
> elegant solution to the second issue, that of automatically adapting the
> matrix to as small a dim as possible while getting rid of all unnecessary
> zeros?
> Any ideas?
> -n
>

#129872

You must be logged in to reply to this topic.