<div dir="ltr">Hi everyone,
<br>I have an image represented with vtkImageData. I want to fit and 
fill this image into a qvtkwidget. I have succesfully rotated and 
reshaped the image to the size of my renderwindow, however when I 
display it is seems to be scaled down and is surrounded with a lot of 
space(see image). 
<br><br>And another thing; when is it necessary to "update()" the different image interactors?
<br><br>If anyone have any input that could help me to achieve my objective, please help me out here! :)
<br><br>The code I use is as follows:
<br><br>vtkSmartPointer<vtkImageViewer2> viewer1 = vtkSmartPointer<vtkImageViewer2>::New ();
<br>vtkSmartPointer<vtkImageData> image = vtkSmartPointer<vtkImageData>::New();
<br>vtkSmartPointer<vtkImageResize> resize = vtkSmartPointer<vtkImageResize>::New();
<br>vtkSmartPointer<vtkTransform> rotate = vtkSmartPointer<vtkTransform>::New();
<br>vtkSmartPointer<vtkImageReslice> reslice = vtkSmartPointer<vtkImageReslice>::New();
<br>vtkSmartPointer<vtkMatrix4x4> transposeMatrix = vtkSmartPointer<vtkMatrix4x4>::New();
<br><br>viewer1->SetupInteractor(physioApp->dopplerDataWidget->GetInteractor());
<br>viewer1->SetRenderWindow(physioApp->dopplerDataWidget->GetRenderWindow());
<br><br>image->DeepCopy(dopplerImages[previousDopplerFrameIndex]);
<br><br>rotate->RotateZ(-90);
<br>rotate->GetTranspose(transposeMatrix);
<br>                
<br><br>reslice->SetInput(image);
<br>reslice->Update();
<br>reslice->SetResliceAxes(transposeMatrix);
<br>reslice->SetInterpolationModeToLinear();
<br>reslice->Update();
<br><br>resize->SetInputConnection(reslice->GetOutputPort());
<br>resize->SetBorder(0);
<br>resize->SetCropping(0);
<br>resize->Update();
<br><br>int * r=resize->GetOutput()->GetDimensions();
<br><br>int* size = physioApp->dopplerDataWidget->GetRenderWindow()->GetInteractor()->GetSize();
<br>if(r[0]>0 && r[1]>0 && r[2]>0)
<br>        resize->SetOutputDimensions(size[0],size[1],1);
<br><br>resize->Update();
<br>reslice->Update();
<br><br>viewer1->SetInputConnection(reslice->GetOutputPort());
<br>viewer1->Render();
<br><br>Resulting image:<br><br></div>