[vtkusers] VTK6 SetInputData for vtkImageActor: nothing shows
Doug Hoppes
dhoppes at mbfbioscience.com
Mon Nov 18 08:48:37 EST 2013
Hi all,
I'm migrating our application from VTK5.10 to VTK6. I'm running into an issue with the VTKImageActor: The image data no longer shows up in the Image actor. In VTK 5.10, there is no problem. I can see our image data on the actor. In VTK 6, I only see a black area.
Code:
// Create the image data and load it with our pixel information
vtkSmartPointer<vtkImageData> pImageData = vtkSmartPointer<vtkImageData>::New();
SetupVTKImageDimensions(pImageData);
pImageData->AllocateScalars(VTK_UNSIGNED_CHAR, iNumOfScalarComponents);
unsigned char* pDest = static_cast<unsigned char*>(pImageData->GetScalarPointer());
CopyImageData(pDest); //our code for copying the image data
// Adjust the size of the image data
vtkSmartPointer<vtkImageShiftScale> pWindowLevel = vtkSmartPointer<vtkImageShiftScale>::New();
pWindowLevel->SetOutputScalarTypeToUnsignedChar();
pWindowLevel->ClampOverflowOn();
// Assign the image data to the image actor
pWindowLevel->SetInputData(pImageData);
m_pImageActor->SetInputData(pWindowLevel->GetOutput());
Any help is greatly appreciated.
Doug
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20131118/4bb4205c/attachment.htm>
More information about the vtkusers
mailing list