[vtk-developers] vtkImageActor doesn't allow you to increase image components from 1 to 3

David Doria daviddoria at gmail.com
Mon Nov 29 16:08:40 EST 2010


Any thoughts on this?

David


On Tue, Nov 23, 2010 at 12:41 PM, David Doria <daviddoria at gmail.com> wrote:
> I setup a demo and tried a few cases. (1) - (3) work properly, and (4)
> is the issue.
>
> 1) If I create an image with image->SetNumberOfScalarComponents(1), then call:
>
> vtkImageActor* actor = vtkImageActor::New()
> actor->SetInput(image);
>
> it works as expected, a grayscale image is displayed.
>
> 2) If I create an image with image->SetNumberOfScalarComponents(3), then call:
>
> vtkImageActor* actor = vtkImageActor::New()
> actor->SetInput(image);
>
> it works as expected, a color image is displayed.
>
> 3) If I create an image with image->SetNumberOfScalarComponents(3), then call:
>
> vtkImageActor* actor = vtkImageActor::New()
> actor->SetInput(image);
>
> then change the image:
> image->SetNumberOfScalarComponents(1)
> ... update image ...
>
> it works as expected, a grayscale image is displayed.
>
> 4) HOWEVER, if I create an image with
> image->SetNumberOfScalarComponents(1), then call:
>
> vtkImageActor* actor = vtkImageActor::New()
> actor->SetInput(image);
>
> then change the image:
> image->SetNumberOfScalarComponents(3)
> ... update image ...
>
> A GRAYSCALE image is still displayed. I have attached a demonstration
> of the problem (comment or uncomment #define DemonstrateBug to see the
> correct vs the incorrect behavior).
>
> If someone can confirm this is a bug I will add it to the bug tracker.
>
> Thanks,
>
> David
>



More information about the vtk-developers mailing list