SOP TO CHOP TO SOP TO CHOP! A question about convertion

hey guys!
i started studying touchdesigner last week and Matthew’s tutorials are helping me a lot, but, i’m having a lot of basic questions about converting images to another operators.

i have a TOP operator, with a image (B&W). when i convert this top to a chop, what the chop are doing? it are converting the pixels of the image to a two dimensional row? how can i see this information, as a tab data?
how can i use theis chop information (from a top image) to, for an example, use as coordenates to form a image with a line?

i loved the program, but my background it’s with processing, and not see this numbers and infos are making me so lost =(

You can read what it does on the Top to CHOP wiki page, which opens if you click the question mark icon in the top-left of the parameter window of a node.

Maybe it helps to see this image: (to see the full version: rightclick image, open in new tab )


On the left is TOP of 50 x50 pixels.
Then comes a Top to CHOP which has 4 channels (r,g,b,a) and is 50 samples long.
In this case the Top to CHOP shows the values of a single horizontal row of pixels in the image. But you can also set its crop to a vertical column, a single pixel, or the full image.

Then comes a CHOP to DAT which shows all the numbers in a table.

If you want to use CHOP data to create a 3d model in a SOP, you can use a Limit SOP.

You can use a Select DAT to pick only certain rows/columns from the DAT.
You can use a Select CHOP to pick only certain channels from the CHOP.
etc etc.

Hope this gets you a bit further.

What Idz said.

It might be useful to keep in mind that TOPs are essentially just pixel shaders wrapped with some parameters. This makes them very fast, but hard to debug. Just like you might import and run a fragment shader in Processing, you can use a GLSL TOP to write your own shader (or adapt one from somewhere else).

Once you start converting TOPs to other formats your going to hit a CPU bottle neck at some point. Copying pixel data from the GPU to CPU can be a slow process, especially with large resolutions, and it’s worth being mindful that some of the speed of Touch comes with trying to stay on the GPU for as many operations as possible. That’s all to say that if you’re converting to other data formats to perform image manipulation operations - dont! - instead look for a TOP or GLSL solution so you don’t loose your performance to conversion and data transfer.

If you’re needing to deform or build geometry out of pixels as a data source it’s wroth putting in the time to get a handle on the GLSL Mat - using a sampler in a shader still has some slowdowns but nothing near converting from TOPs to CHOPs.

I’d add that you can use a few other good tricks to get a sense of what’s happening here:

Here’s a sample tox to get a handle on what’s happening with the CHOP to process:
base_chop_to.tox (1.22 KB)

If you’re looking for a good way to just see the values of your pixels you can do that in the TOP viewer, make your TOP viewer active, and right click to bring up another contextual menu:
GIF.gif

You can also use python to sample single pixels:

op('yourTargetTop').sample(x=int, y=int)

or

op('yourTargetTop').sample(u=float, v=float)

derivative.ca/wiki099/index. … =TOP_Class

I realized your question was also how to draw lines using an image as input - so also see the Trace SOP, which creates geometry from a TOP image.
extrude.jpg

ohh nice!!! thank you guys for the straight and clear answer! i got now!!

grettings from brazil!