[vtkusers] convert own dataset into vtkStructuredPoints
verena kinder
verena.kinder at web.de
Fri Apr 8 12:35:59 EDT 2005
Hello!
That' s fine but it don't work!
I get an error -when I maked the program
error: no matching function for call to `vtkUnsignedShortArray::SetArray(Model3D*&, int, int)'
/home/VTK/Common/vtkUnsignedShortArray.h:149: error: candidates are: void
vtkUnsignedShortArray::SetArray(short unsigned int*, int, int)
I thougt, if I had used the SetArray function the first parameter has to be the address of my own array and thats enough. But the message say, that model and array have to be the same type->short unsigned int *. But model has the Type Model3D.
Is there a possibility to take another way?
This is the code :
// Model3D is our own class. This class contains a 3 dim. array of
// unsigned int values. The model should be convert into vtkstructuredPoints
//data
Model3D * model = readRawSlices(argv[1]);
int w= model->getWidth();
int h= model->getHeight();
int d= model->getDepth();
vtkUnsignedShortArray *array =vtkUnsignedShortArray::New();
array->SetArray(model,w*h*d,1);
vtkStructuredPoints * data =vtkStructuredPoints::New();
data->GetPointData()->SetScalars(array);
data->SetDimensions(w,h,d);
data->SetScalarType(VTK_UNSIGNED_SHORT);
data->SetSpacing(1.0,1.0,1.0);
data->SetOrigin(0.0,0.0,0.0);
Thanks
Ali Hashimi <benkasmi at yahoo.com> schrieb am 07.04.05 00:36:19:
>
> Hi
> it looks like the right start
>
______________________________________________________________
Verschicken Sie romantische, coole und witzige Bilder per SMS!
Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193
More information about the vtkusers
mailing list