Hi,<br><br>I can't seem to display a 16 bit image.<br><br>I'm creating a vtkImage as follows and then am using QVTKWidget to display it. Do I need to set the scale factor or something somewhere? Everything keeps displayinga s an 8 bit image! Thanks in advance for your help. (code segment below)<br>
<br>Serena<br><br> imageData = vtkSmartPointer<vtkImageData>::New();<br> imageData->SetDimensions(xsize,ysize,1);<br> imageData->SetScalarTypeToUnsignedShort();<br> imageData->SetNumberOfScalarComponents(1);<br>
<br>//populate the data here<br> int* dims = imageData->GetDimensions();<br> // int dims[3]; // can't do this<br> <br> for (int y = 0; y < dims[1]; y++)<br> {<br> for (int x = 0; x < dims[0]; x++)<br>
{<br><br>/// some sort of population with values between 0 and 2^16<br>}<br>}<br><br> imageActor = vtkSmartPointer<vtkImageActor>::New();<br> imageActor->SetInput(imageData); //this adds the vtk image actor<br>
renderer = vtkSmartPointer<vtkRenderer>::New();<br> renderer->InteractiveOff(); //turn the interaction off for now<br> renderer->AddActor(imageActor);<br><br> this->ui->waterfallVTKObject->GetRenderWindow()->AddRenderer(renderer);<br>
this->ui->waterfallVTKObject->GetRenderWindow()->Render();<br><br><br><br><br><br>