[vtkusers] how can i get grayscale scene?!
xiong jun
mickyxiong at hotmail.com
Wed Nov 13 20:32:05 EST 2002
Dear friends,
i want to display the grayscale images.But the following code is giving
color image as output but i want grayscale image as output.And how to
convert the color scene to grayscale?Please give me suggestion.
For that output i wrote the folowing code:
vtkExtractVOI *extract = vtkExtractVOI::New();
extract->SetInput(image);
extract->SetVOI(0,256,64,64,0,64);
vtkDataSetMapper *contMapper = vtkDataSetMapper::New();
contMapper->SetInput(extract->GetOutput());
contMapper->SetScalarRange(0,4095);
vtkActor *conactor = vtkActor::New();
conactor->SetMapper(contMapper);
aRenderer->AddActor(conactor);
aRenderer->SetBackground(0.22656, 0.42969, 0.64453);
renWin->SetSize( 300, 300);
renWin->Render();
Thanking you,
Regards,
mickyxiong
_________________________________________________________________
免费下载 MSN Explorer: http://explorer.msn.com/lccn/
More information about the vtkusers
mailing list