There is a matrix library for JavaScript that can be used in QC. Though you can't link against it as such, it's relatively easy to extract the bits you need to use in your own code.

The project is called Sylvester (for some reason).
http://sylvester.jcoglan.com/

Dunno what the licensing situation is with using chunks of it though. You might want to contact the author about that.


a|x
http://machinesdontcare.wordpress.com




On 18 Aug 2009, at 13:57, Dick Applebaum wrote:

Jacob,

You can use JavaScript functions to manipulate strings of data, such as a row of space-delimited numbers, into an array. See:

   http://www.tizag.com/javascriptT/javascript-string-split.php

I don't know if JavaScript has any native functions to deal with matrix manipulation, There may be third-party-developed JavaScript packages that do this.

You can google JavaScript and matrix and see what's available.

If nothing, you could roll your own by adding each row array (created above) to another array, a matrix array. Then, perform any desired manipulations by iterating through the array of arrays....

BTW, you can do almost any text-manipulation you'd ever want (and more) using RegExp (Regular Expressions). RegExps take a bit of effort to learn but you will be handsomely rewarded for the effort. RegExps can be found in Perl, PHP, JavaScript, OS X (Unix, Linux) Command Line Interface, and many text editors. They are often called "grep" in CLIs and Text Editors. Seriously, once you learn to use
RegExps, you will wonder how you ever lived without them.

Dick




On Aug 17, 2009, at 3:17 PM, jacob Balthazor wrote:

I am from a research team at Cal Poly Pomona working on developing laser based chemical analysis device. I am in charge of software development and am I am looking for an approach on how to read in a matrix of values from a text file in the formatting show below and generate a gray scale image from this data on the fly. The text files is formatted with each value being separated by a space, the values ranging between 0 and 4096, and different matrices being separated be a single line space. I am not sure how to implement this but am sure that it is possible to do in quartz composer. One possible way of loading the values could be using Kineme (http://kineme.net/) file tools plug in. But this returns the file as a long string of character which I am not sure how to break up to obtain the values or how to turn these characters back into integers, matrices and then images. I would appreciate any advice or help.

-Jacob Balthazor

Sample formatting of my source text file in a 5e5 matrix (real data is 32x32):

"
1 32 54 38 95
2 44 4 552 23
1 32 54 38 95
2 44 4 552 23
1 32 54 38 95

1 32 11138 94
2 23 4 552 23
1 32 54 76 95
2 44 4 334 23
1 32 11 38 95
"

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartzcomposer-dev mailing list (Quartzcomposer- [email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quartzcomposer-dev/ dicklacara%40mac.com

This email sent to [email protected]

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartzcomposer-dev mailing list (Quartzcomposer- [email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quartzcomposer-dev/the_voder% 40yahoo.co.uk

This email sent to [email protected]

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartzcomposer-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quartzcomposer-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to