Hello
I want to put an vtkImageData on the RGY view….
I already initialized my image data like this:
img->SetExtent(….)
img->AllocateScalars(VTK_DOUBLE, 1);
for (….)
{
for (….)
{
img->SetScalarComponentFromDouble( …...);
}
}
It give me (let’s suppose ….) an orange square in a test renderView.
I want that orange square to be on a certain position on the red view in Slicer, like this (photoshoped result):
So i face two problems …
Get the redView and manipulate it
A correct way to set bounds…
My current result:
(Not really beautiful…)
I reach that point with that code:
qSlicerLayoutManager* layoutManager = qSlicerApplication::application()->layoutManager();
vtkRenderWindowInteractor* interactor = layoutManager->sliceWidget("Red")->sliceView()->interactor();
vtkRendererCollection *rendererCollection= interactor->GetRenderWindow()->GetRenderers();
//ImageActor is my vtkImageData red square
rendererCollection->GetFirstRenderer()->AddActor(imageActor);
Any ideas ?