[vtkusers] Visualization problem with normalized images
Nens
nicolas.narbonne at gmail.com
Mon Apr 28 02:06:33 EDT 2014
Hello,
I have to display images in my soft. I do it well with a lot of images but
when I try to visualize a normalize image, I have a white image.
I think that the value of the image change and my QVtkWidget don't manage
it.
For exemple, maybe the value of my image is between 0 and 255 and when I
normalize the image, the value change to 0 and 1.
My workmate said to me that images values is allways between 0 and 1.
Also, when i keep my left button down and drag off to the upper right
screen, I change something to the image (contrast or something else) and i
can see the image. I use vtkInteractorStyleImage. What value is modified
when I do this ?
So, to resume, I want to display the image that I give to you in a
Qvtkwidget, could you help me ?
Thanks.
Sorry for my english.
The code :
imageReader =
readerFactory->CreateImageReader2(inputFilename.toUtf8().constData());
imageReader->SetFileName(inputFilename.toUtf8().constData());
imageReader->SetDataScalarTypeToUnsignedShort();
imageReader->SetDataByteOrderToLittleEndian();
imageReader->UpdateWholeExtent();
imageReader->Update();
actorImage = vtkSmartPointer<vtkImageActor>::New();
#if VTK_MAJOR_VERSION <= 5
actorImage->SetInput(imageReader->GetOutput());
#else
actorImage->SetInputData(imageReader->GetOutput());
#endif
actorImage->SetInterpolate(0);
renderer = vtkSmartPointer<vtkRenderer>::New();
renderer->AddActor(actorImage);
// Set the custom style to use for interaction.
vtkSmartPointer<vtkInteractorStyleImage> style =
vtkSmartPointer<vtkInteractorStyleImage>::New();
style->SetDefaultRenderer(renderer);
renderer->ResetCamera();
renderer->SetBackground(1,1,1);
renderer->SetTexturedBackground(true);
ui->qvtkWidget->GetRenderWindow()->AddRenderer(renderer);
ui->qvtkWidget->GetRenderWindow()->GetInteractor()->Initialize();
ui->qvtkWidget->GetRenderWindow()->GetInteractor()->SetInteractorStyle(style);
The image :
filtered00.png
<http://vtk.1045678.n5.nabble.com/file/n5726902/filtered00.png>
--
View this message in context: http://vtk.1045678.n5.nabble.com/Visualization-problem-with-normalized-images-tp5726902.html
Sent from the VTK - Users mailing list archive at Nabble.com.
More information about the vtkusers
mailing list