[vtkusers] VTK6 SetInputData for vtkImageActor: nothing shows

Bill Lorensen bill.lorensen at gmail.com
Mon Nov 18 10:19:52 EST 2013


Try
 pWindowLevel->Update();

Please look here for an explanation:
http://www.vtk.org/Wiki/VTK/VTK_6_Migration/Replacement_of_SetInput


On Mon, Nov 18, 2013 at 9:11 AM, Doug Hoppes <dhoppes at mbfbioscience.com> wrote:
> Found out more information… If the vtkImageShiftScale filter is taken out of
> the pipeline, then the image shows up.
>
>
>
> So, seems that there may be a change/bug with the vtkImageShiftScale in
> VTK6?
>
>
>
> Note: This happens with VTK 6.0.0 and the latest nightly build (as of three
> days ago).
>
>
>
> Doug
>
>
>
> From: vtkusers-bounces at vtk.org [mailto:vtkusers-bounces at vtk.org] On Behalf
> Of Doug Hoppes
> Sent: Monday, November 18, 2013 8:49 AM
> To: vtkusers at vtk.org
> Subject: [vtkusers] VTK6 SetInputData for vtkImageActor: nothing shows
>
>
>
> 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
>
>
>
>
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>



-- 
Unpaid intern in BillsBasement at noware dot com


More information about the vtkusers mailing list