Let's talk about what is going on in the various versions of the net we've just created. Refer to the image below to refresh your memory of the various net permutations we just made.
|
|
I would not recommend you build and run the net portrayed in the image. As shown, this net would Import the watermolecule.dx data 6 times. You could build the net using only one Import, then drag wires from Import to the next modules shown. Remember that Version 1 will still give you an error, and Version 3 is identical to Version 2, as shown. |
In all cases, Import fetched some data from disk by name and created a Field Object. In the cases where Isosurface is in line with AutoColor, essentially the same operations happen in different order and with different Objects.
In Version 4, the imported Object ran down the pipe to AutoColor. AutoColor does this: it looks at the whole data distribution in the input Field Object, then fits the histogram of the data to a color range in which blue maps to the lowest data value and red to the highest. In-between colors map to the rainbow spectrum (blue-cyan-green-yellow-orange-red). AutoColor creates a "colors" Component within the Field, so the Object that comes out is otherwise identical to the input, but with this new Component added to it.
|
 |
Optional: View this Technical Aside if you want more detail on this subject; the information is not required to understand the upcoming material. |
|
|
Once AutoColor has created a "colors" Component from the "data", you could actually Remove the "data" from the Field and still render an Image. You don't actually see "data" in the rendered Image …quot; you see a realization of data. One realization is a colormapped line, surface, or volume. All it takes to make the image is the "positions", "connections", and "colors". That said, you do not normally discard the "data". |
|
|
In general terms, what is the range of data that AutoColor passes to Isosurface? In other words, did AutoColor affect the "data" that came in?
Answer |
Next, this new "colored" Object passed into Isosurface. Isosurface's job is to find the surface within a volume upon which all the data values are identical.
Identical to what value, you should be asking yourself? We didn't give it a value, did we?
|
|
What default value would you use if you wrote the Isosurface module? Consider that the users of your module will be submitting arbitrary data sets.
Answer …Try again… Answer |
|
 |
Optional: View this Technical Aside if you want more detail on this subject; the information is not required to understand the upcoming material. |
So, AutoColor colored the data according to a blue-red scale, then Isosurface found the surface for the data mean of this data set. Remember the first volume-rendered image (Version 2) was mostly blue? Because the data set is distributed unevenly, with a strong preponderance of very low values, the data mean is pulled down to a low value and thus tends to be very blue. In this particular data set, the Isosurface that corresponds to "data mean" is an isosurface of a low data value and is therefore blue in color. That's what Image showed us. (Learning to interpret visualizations is half the fun, by the way!)
When we reverse the order of AutoColor and Isosurface (Version 5) something quite different takes place. Now we Import, then Isosurface. Again, Isosurface finds the "data mean" value.
|
|
What is the range of data that AutoColor is handed from Isosurface?
Answer |
|
 |
Optional: View this Technical Aside if you want more detail on this subject; the information is not required to understand the upcoming material. |
It happens that AutoColor defaults to using a deep blue color in cases where all the data is the same constant value. So once again, but for very different reasons, we get a dark blue surface. By "very different reasons", I mean that in the first net, Isosurface received a full range of data and a full range of colors, but selected out only the data values equal to data mean, and therefore only the values that were already colored blue passed through to Image. In this second case, only data mean values were received by AutoColor, so there never were any green or red colors created.
This is big stuff! Modules are to a large degree commutative: you can order them arbitrarily, but only if the objects flowing in and out of the modules make sense. This is part of the deeper understanding of DX required to do effective programming. If you know what is flowing in any particular pipe, then you'll know if it makes sense to connect that pipe to a module input. Very soon, I'll show you how to watch the contents of the pipes directly.
In Version 6, we rewired so that we could see both the isosurface and the volume rendering of the water molecule data at the same time. Now that we've described the function of AutoColor, look at the net and consider what is happening here.
This time, we've rewired AutoColor to once again receive the full range of data directly from Import.
|
|
Why is there a faint fuzzy greenish patch in the center of the data volume?
Answer |
But did you notice that the isosurface in this image is not the same dark blue as before? DX is still finding the isosurface corresponding to "data mean", which hasn't changed, right?
This is a trick question. It is correct that the data mean has not changed, and that Isosurface is therefore creating the exact same surface as before. But note that Isosurface is not coming from or going to AutoColor, so it is not receiving the dark blue that AutoColor maps to low (or constant) data values. Instead (the trick), Isosurface itself assigns a default color of light blue to the object it outputs if no other colors are already assigned. This avoids the Error message from Image about the lack of a "colors" Component. In other words, you could create a simple little net that imports watermolecule.dx, Isosurfaces it, and Images it without any errors, as long as you want light blue for the color. Go ahead: prove it to yourself.
|
|
A little bit of unwiring is all you need to do to try this. If you are currently looking at Version 6, you can just disconnect AutoColor from Collect. |
|
|
It's perfectly OK to leave unconnected modules in your net while you are experimenting with a new program. A very few modules will complain even if they are not connected at all: Image, for example. Most modules will simply do nothing as long as there are no output wires connected from them to any other modules. This is true even if they show a cyan "required" input tab and you haven't connected anything to it. The rule is this: a module will not run if (a) it creates no side-effects (Image creates a display in another window), or (b) no downstream module is connected to that module. |
This is a general principle of DX; the program designers sought to make the user experience as easy as possible. Whenever a sensible default value can be preprogrammed or defined on the fly, it is done. Whenever there is no such reasonable or calculable default, you must provide a required input. There is no good "default" filename, so Import needed some help. But a perfectly good Isosurface value is "data mean", so you don't have to run a separate statistics test to find "good" values to try. Light blue is as good as any other color for a default color, so you didn't have to remember to perform a separate coloring operation.
Note also that there are several other input tabs on the modules we've placed in the net that we didn't have to do anything with to run the net successfully. Once again, internally, reasonable default values are being chosen for those inputs.
You cannot change the built-in default color setting for Isosurfaces, but you can change the color that the isosurface ends up with in any particular net when it is rendered.
Let's do that. Add Transformation: Color (not AutoColor). Drop it just below Isosurface and wire it into the net as per the illustration. If you disconnected AutoColor from Collect, reconnect it now.
Before you execute, open Color's CDB (double-click the module, or, select the module, then Edit: Configuration…). The second input is where you specify a color. There are several ways to do this, but for the moment, choose one from the pull-down menu on the far right of the input (menu looks like an ellipsis: "…"). Pick any color you see, then close the dialog and Execute the net. (I chose "orange").
|
 |
Optional: View this Technical Aside if you want more detail on this subject; the information is not required to understand the upcoming material. |