Dear all

I have a 3D "spreadsheet" style file (imported via the *.general filter) in which one column contains a string identifier:

i.e.:
X ,  Y,  Z,  data1, data2, data3, ID
1    1    1     25      26       27       set1
6    30  7     27      24      29       set2
1    2    7     26      25      28       set1
4    20  3     26      25      28       set2
2    3    1     27      24      29       set1
3    4    9     28      23      30       set3
2    10  2     25      26      27       set2
8    40  5     28      23      30       set3
etc...

What I need to do is select part of the data based on the identifier. Is there an easy way of doing this that I have missed in the egs, documentation and archives? I have tried all the combinations/settings for categorise and lookup (after converting the group to a field) I can think of in order to extract the data but have yet to get it right. I think this must be a pretty normal task so I am assuming there is something I have over looked.

Thanks for the help

Peter


The example XYZs imply this is scattered data (not a grid). Is that correct? If not, don't go any further with this solution cause it won't apply.

First, get out Print, set it to "rd" and use it frequently to follow the discussion.

If so, use ImportSpreadsheet (ISS) to read in the data. Although ISS has a built-in call to Categorize, it has been buggy in the past, so safer is to import the data then pass it to Categorize. Tell Categorize to operate on the column "ID" assuming you've opened up the ISS config dialog and told it that your column names are on Line 1 (last entry in the config box as I remember and normally hidden until you Expand and scroll down). If you don't do this, you have to keep track of which is the auto-named "column0", etc.

Out of Categorize will come a field with (at least) 8 components: X, Y, Z, d1, d2, d3, ID, and 'ID lookup' (which contains 3 strings "set1", "set2", "set3"). The "ID" component now is a byte array containing 00, 01, and 02 to indicate which value in the lookup table corresponds to each data row (or more correctly, "position-dependent value"). Since the lookup table is generated by alphabetizing the input values, I would guess that your first row above will get "ID" of 00.

ISS has a side-effect, sometimes annoying, sometimes invaluable, that it assumes your data rows are, like beads on a string, connected by "line" connections, one to the next (you cannot import a 3D grid with ISS!). So if you display your data with ShowConnections, you'd get a wacky line that traverses space like a ball of string (I'm guessing, in this case). Use Remove to get rid of these connections before performing the next step. To restore what you call XYZ to the "positions" component (which ISS has declared to be a path array with origin 1, delta 1, count nrows), use 3 instances of Mark in parallel to mark "X", "Y", "Z", then Compute(float([a,b,c]) (the outputs of the 3 Marks are made into a float 3-vector) and Unmark("positions").

Now use Mark("ID"), followed by Include. Set Include range to contain only the subset of ID values (remember they are byte lookup values now) of interest. So Include(min=0, max = 0.5) will pass set1 but not the others. After Include, use Unmark(unspecified name) which will clear the "marked status" of the field and permit you to immediately Mark("data1") or whatever you like, for Autoglyph, for example.

Thus, you use ID to mask, but data1 to display at your 3D scattered positions in space.

If that's not what you wanted, then you didn't explain the problem clearly. (:-)

Chris Pelkie
Vice President/Scientific Visualization Producer
Conceptual Reality Presentations, Inc.
30 West Meadow Drive
Ithaca, NY 14850
[EMAIL PROTECTED]

Reply via email to