Can someone suggest why ColorBar is giving me this error:
ERROR: ColorBar: Invalid data: colormap must be a single field; not a group
and how I might correct the problem ?
Situation:
I've written a data import module which seems to be working..
when I pass the imported values through AutoColor and Image
the picture I get looks fine; yet when I try to add a ColorBar
I get the error above...
Why does this happen and what must I do to correct my
code in the import module to allow the ColorBar to work?
Below is a diagram of my network and the output from "Describe",
which I hope will give sufficient detail to allow an understanding
of what I'm doing.
thanks for your help,
Craig Schwartz
[EMAIL PROTECTED]
Color Bar
/ \
FileSelector ==> MyImport=>AutoColor => Collect => Image
\
\=>Describe
--------------- this is an exceprt from the code which creates the DX object--
ctr_positions=DXNewArray( TYPE_FLOAT, CATEGORY_REAL,1,3);
ctr_data=DXNewArray( TYPE_FLOAT, CATEGORY_REAL,1,dim);
DXAddArrayData(ctr_positions, 0, max_pts,NULL))
if (!DXAddArrayData(ctr_positions, 0, max_pts,NULL)) {
/* pts array has co-ordinates, val ha
for (i=0;i< max_pts;i++) {
*posPtr++ = levelTmp->cons->pts[i][0];
*posPtr++ = levelTmp->cons->pts[i][1];
*posPtr++ = levelTmp->cons->pts[i][2];
*dataPtr = levelTmp->cons->val[i];
}
/* set dependency attribute of data values
* to indicate "positions" (not connections)
*/
if(!DXSetStringAttribute((Object)ctr_positions, "dep","positions")) {
e = ERROR;
goto error;
}
if(!DXSetStringAttribute((Object)ctr_data, "dep","positions")) {
e = ERROR;
goto error;
}
/* create new field to hold this contour */
ctrField = DXNewField();
if (!ctrField ){
DXSetError(ERROR_UNEXPECTED,"Cannot Create Field");
e = ERROR;
goto error;
}
/* associate array with the "data" field */
if (!DXSetComponentValue((Field)ctrField,
"data",(Object)ctr_data)) {
DXSetError(ERROR_UNEXPECTED,
"Cannot associate \"data\" component. Try marking \"colors\"");
e = ERROR;
goto error;
}
/* associate point array with the "positions" field
component */
if (!DXSetComponentValue(ctrField, "positions",(Object)ctr_positions)) {
DXSetError(ERROR_UNEXPECTED, "Can't associate positions");
e = ERROR;
goto error;
}
/*
* add connections interpolation lines
* if we are doing line type contours -
*/
ctrConnections = DXNewPathArray(levelTmp->cons->numpts);
if (!ctrConnections) {
DXSetError(ERROR_UNEXPECTED,"Bad Connection Array");
e = ERROR;
goto error;
}
if (!DXSetComponentValue(ctrField,
"connections",(Object)ctrConnections)) {
DXSetError(ERROR_UNEXPECTED, "Can't associate connections");
e = ERROR;
goto error;
}
DXSetComponentAttribute(ctrField,"connections",
"ref",(Object)DXNewString("positions"));
DXSetComponentAttribute(ctrField,"connections",
"element type",(Object)DXNewString("lines"));
/* tidy up field */
if (DXEndField(ctrField)==NULL) {
DXSetError(ERROR_BAD_PARAMETER,"End Field barfed");
e = ERROR;
goto error;
}
--------------- this is the output from describe ------------------
Begin Execution
2: Starting ImportUCF on localhost; will wait up to 60 seconds for
connections.
ERROR: ColorBar: Invalid data: colormap must be a single field; not a group
Object Description:
Input object is a Group which contains 255 members.
member 0 is named level 1.000000
member 1 is named level 2.000000
member 2 is named level 3.000000
member 3 is named level 4.000000
member 4 is named level 5.000000
...
member 250 is named level 251.000000
member 251 is named level 252.000000
member 252 is named level 253.000000
member 253 is named level 254.000000
member 254 is named level 255.000000
Each group member is a Field, the basic data carrying structure in DX.
The positions are enclosed within the box defined by the corner points:
[ -90.3338 -34.0928 -58.0527 ] and [ 58.6871 63.2004 0.028758 ]
Data range is:
minimum = -7.16989, maximum = 6.59012, average = 0.342089
(These are the scalar statistics which will be used by modules
which need scalar values. The length is computed for vectors and
the determinant for matricies.)
Input is not ready to be rendered because 255 Fields in the Input object do not
have colors yet.
Use the `AutoColor', `AutoGreyScale', or `Color' modules to add colors.