<div dir="ltr">Hello all,<br><br>I am trying to convert an image from RGBA to gray scale so that I can compare it pixel by pixel with another gray scale image. Following is what I did:<br><br> vtkSmartPointer<vtkImageMapToColors> gray_from_RGBA_map = vtkSmartPointer<vtkImageMapToColors>::New();<br>
grayd_from_RGB_map->SetInput(RGBA_image_data);<br><br> gray_from_RGB_map->SetOutputFormatToLuminance();<br> <br> gray_from_RGB_map->Update();<br><br> int channels = gray_from_RGBA_map->GetOutput()->GetNumberOfScalarComponents(); <br>
<br>The variable "channels" is 4 irrespective of whether I include a vtkImageMapToColors in the pipeline.<br><br>Am I doing anything wrong here? What is the best way to do this?<br><br><br>Any help will be highly appreciated.<br>
<br><br>Prathamesh<br></div>