Discussion:
[mitk-users] mitk-users Digest, Vol 129, Issue 14
Wojciech Lassmann
2017-02-28 18:36:28 UTC
Permalink
I am starting from scratch (using mitk as a toolkit), so i don't have
access to RequestRenderWindowUpdate.
What I do now is :
ui->myQmitkStdMultiWidget->update();
ui->myQmitkStdMultiWidget->mitkWidget4->update();
ui->myQmitkStdMultiWidget->mitkWidget4->GetRenderWindow()->Render();but
it doesn't work.


I have recently noticed that vtk RotateWXYZ does allow to rotate around a
vector. Is there any way of rotating contents of mitkWidget4 this way?


Z powaÅŒaniem,
Wojciech Lassmann
Send mitk-users mailing list submissions to
To subscribe or unsubscribe via the World Wide Web, visit
https://lists.sourceforge.net/lists/listinfo/mitk-users
or, via email, send a message with subject or body 'help' to
You can reach the person managing the list at
When replying, please edit your Subject line so it is more specific
than "Re: Contents of mitk-users digest..."
1. Re: Render vtkCamera position update on QMitkRenderWindow
(Girish Lande)
2. Re: using mitkRotationOperation (Albert Alises)
----------------------------------------------------------------------
Message: 1
Date: Mon, 27 Feb 2017 09:03:18 +0530
Subject: Re: [mitk-users] Render vtkCamera position update on
QMitkRenderWindow
mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
Hi Albert,
Can you try changing this position vector.
currentCamera->SetPosition(0.0,0.0,0.0);
in my observation setPosition actually defines direction vector in which
camera is looking at the object.
So I think it should have some direction .
For e.g to look at same object in 3 different directions(standard x,y,z) I
do this
cam->SetFocalPoint(0,0,0);
cam->SetPosition(1,0,0);
cam->SetViewUp(0,0,1);
break;
cam->SetFocalPoint(0,0,0);
cam->SetPosition(0,-1,0);
cam->SetViewUp(0,0,1);
break;
cam->SetFocalPoint(0,0,0);
cam->SetPosition(0,0,1);
cam->SetViewUp(0,1,0);
break;
regards,
Girish
Hello Ingmar,
Thank you for your response! I did try to do that but unfortunately the
scene keeps going black after executing these changes. Calling any event
on
the window makes the view to render correctly (wheel event, or just
moving
around), so it has to be a method called when doing that on a
QmitkRenderWindow, just cannot seem to find it...
Thank you,
Albert.
Hi Albert,
did you try orthogonalizing the view up vector before calling
RequestUpdate?
currentCamera->OrthogonalizeViewUp();
mitk::RenderingManager::GetInstance()->RequestUpdateAll(
mitk::RenderingManager::REQUEST_UPDATE_3DWINDOWS);// For 3D widget only
This recomputes the view up vector to force it to be perpendicular to
camera->focal point vector. (See vtkCamera docu)
Ingmar
(Written on cellphone)
Hello everyone,
I am having trouble rendering the update of a vtkCamera on a
QMitkRenderWindow. I have a renderWindow which looks at a given scene.
I
get its associated* vtkRenderWindow* and from it, the* ActiveCamera()*
(Which is a vtkCamera object).
currentCamera->SetPosition(0.0,0.0,0.0);
currentCamera->SetViewUp(1.0,0.0,0.0);
currentCamera->SetFocalPoint(0.7, 0.3, 0.4);
vtkTransform* translationToPoint = vtkTransform::New();
translationToPoint->Translate(40, 20, 30);
currentCamera->ApplyTransform(translationToPoint);
After applying these transformations, the renderwindow turns black,
currentCamera->Modified();
this->RequestRenderWindowsUpdate();
Paint method of the Base Renderer from MITK
vtkRenderWindow->Update();
and rendering the camera, render windows, renderer associated.... None
of them is working though.... However, the rendering is updated
correctly
when scrolling on the window with the mouse. Which method is the
correct
one to call for the window to show the new scene after modifying the
vtkCamera associated to a the window? (the one the WheelEvent method
on the
QMitkRenderWindows seems to call).
Thank you very much,
Albert.
------------------------------------------------------------
------------------
Check out the vibrant tech community on one of the world's most
engaging
tech sites, SlashDot.org! http://sdm.link/slashdot______
_________________________________________ mitk-users mailing list
lists/listinfo/mitk-users
------------------------------------------------------------
------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
mitk-users mailing list
https://lists.sourceforge.net/lists/listinfo/mitk-users
--
thanks & regards,
Girish
--
------------------------------------------------------------
-------------------------------------------------------------
*Disclaimer:* This email message including any attachments is confidential,
and may be privileged and proprietary to Agiliad. If you are not the
intended recipient, please notify us immediately by replying to this
message and destroy all copies of this message including any attachments.
You are NOT authorized to read, print, retain, copy, disseminate,
distribute, or use this message or any part thereof. Thank you.
------------------------------------------------------------
------------------------------------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
------------------------------
Message: 2
Date: Tue, 28 Feb 2017 13:35:39 +0100
Subject: Re: [mitk-users] using mitkRotationOperation
gmail.com>
Content-Type: text/plain; charset="utf-8"
Hello Wojciech,
The first parameter indicates which operation do you want to perform, in
our case the rotation, so the first parameter is *mitk::OpROTATE* instead
of 1. The second parameter indicates the point to rotate around. by setting
it to *geo->GetCenterInWorld() *, you are rotating around the center of
your view, which is correct based on your goals. The third and four
parameters refer to the vector of rotation and angle of rotation,
respectively. That is, they represent a rotation in *Axis-Angle *form.
In your case, you are rotating an angle given by *position *(MITK treats
them as non radian angles), *around the axis* defined by vector (in your
case, (0,1,0), but note that you assigned the position 0 of the vector 3
times! instead of: mitk::Vector3D vector = mitk::Vector3D();
vector[0]=0.0;
vector[1]=1.0;
vector[2]=0.0;)
* geo->ExecuteOperation(op);*
And update the geometry. Try defining the rotation with the parameters
mentioned above and also render again using *this->
RequestRenderWindowUpdate
*and see if it works.
Cheers,
Hi, i have problem.
I want to rotate the mitkWidget4 cotents arround 3 perpendicular vectors
(that would rotate with the world)
I allready know that VTK functions are not much of a help, as they rotate
around static axis, And i want to try with mitkRotationOperation, but
seems
thet i dont understand it.
i use qt slider moved signal to trigger the slot, and read its position
qDebug() <<QString(position); //to check if is propperly trigered
// typedef mitk::Vector<ScalarType, 3> Vector3D;
mitk::Vector3D vector = mitk::Vector3D();
vector[0]=0.0;
vector[0]=1.0;
vector[0]=0.0;
mitk::RotationOperation* op = new mitk::RotationOperation(1, //i dont
actually know what does tis fo as it just an int, what value should it
have
geo->GetCenterInWorld(), //where geo is time geometry of the data storage
initialising the views
vector,
(double)position); //which is the slider value
geo->ExecuteOperation(op);
ui->view2->mitkWidget4->update(); //where view2 is my temorary name
for QmitkStdMultiWidget
This doesn't seem to do anything, and I have no Idea why.
(http://docs.mitk.org/2015.05/GeometryOverviewPage.html
*geometry->GetVtkMatrix()->Rotate()
*mentioned at the end of the page doesn't seem to exist anymore)
With Regards,
Wojciech Lassmann
------------------------------------------------------------
------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
mitk-users mailing list
https://lists.sourceforge.net/lists/listinfo/mitk-users
-------------- next part --------------
An HTML attachment was scrubbed...
------------------------------
------------------------------------------------------------
------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
------------------------------
_______________________________________________
mitk-users mailing list
https://lists.sourceforge.net/lists/listinfo/mitk-users
End of mitk-users Digest, Vol 129, Issue 14
*******************************************
Goch, Caspar Jonas
2017-03-09 11:56:47 UTC
Permalink
Hi Wojciech,

if you want to check out what goes into the entire render process in MITK you could take a look at the mitk::RenderingManager (which is called by the requestRenderWindowUpdate), especially RenderingManager::ForceImmediateUpdate(vtkRenderWindow *renderWindow for a direct rendering. Additionally you might find [1] helpful.

Apart from that, having a minimal example of what you are trying to achieve would be helpful.

Best,
Caspar

[1] http://docs.mitk.org/nightly/QVTKRendering.html


Von: Wojciech Lassmann [mailto:***@gmail.com]
Gesendet: Dienstag, 28. Februar 2017 19:36
An: mitk-***@lists.sourceforge.net
Betreff: Re: [mitk-users] mitk-users Digest, Vol 129, Issue 14

I am starting from scratch (using mitk as a toolkit), so i don't have access to RequestRenderWindowUpdate.
What I do now is :
ui->myQmitkStdMultiWidget->update();
ui->myQmitkStdMultiWidget->mitkWidget4->update();
ui->myQmitkStdMultiWidget->mitkWidget4->GetRenderWindow()->Render();but it doesn't work.

I have recently noticed that vtk RotateWXYZ does allow to rotate around a vector. Is there any way of rotating contents of mitkWidget4 this way?


Z powaÅŒaniem,
Wojciech Lassmann

2017-02-28 13:35 GMT+01:00 <mitk-users-***@lists.sourceforge.net<mailto:mitk-users-***@lists.sourceforge.net>>:
Send mitk-users mailing list submissions to
mitk-***@lists.sourceforge.net<mailto:mitk-***@lists.sourceforge.net>

To subscribe or unsubscribe via the World Wide Web, visit
https://lists.sourceforge.net/lists/listinfo/mitk-users
or, via email, send a message with subject or body 'help' to
mitk-users-***@lists.sourceforge.net<mailto:mitk-users-***@lists.sourceforge.net>

You can reach the person managing the list at
mitk-users-***@lists.sourceforge.net<mailto:mitk-users-***@lists.sourceforge.net>

When replying, please edit your Subject line so it is more specific
than "Re: Contents of mitk-users digest..."


Today's Topics:

1. Re: Render vtkCamera position update on QMitkRenderWindow
(Girish Lande)
2. Re: using mitkRotationOperation (Albert Alises)


----------------------------------------------------------------------

Message: 1
Date: Mon, 27 Feb 2017 09:03:18 +0530
From: Girish Lande <***@agiliad.com<mailto:***@agiliad.com>>
Subject: Re: [mitk-users] Render vtkCamera position update on
QMitkRenderWindow
To: Albert Alises <***@gmail.com<mailto:***@gmail.com>>
Cc: mitk-***@lists.sourceforge.net<mailto:mitk-***@lists.sourceforge.net>
Message-ID:
<CAGOvywZ26Scw28+fARTDW-GnpOv5PtYiLMucdhtC=***@mail.gmail.com<mailto:***@mail.gmail.com>>
Content-Type: text/plain; charset="utf-8"

Hi Albert,
Can you try changing this position vector.
currentCamera->SetPosition(0.0,0.0,0.0);

in my observation setPosition actually defines direction vector in which
camera is looking at the object.
So I think it should have some direction .

For e.g to look at same object in 3 different directions(standard x,y,z) I
do this

case 0:

cam->SetFocalPoint(0,0,0);

cam->SetPosition(1,0,0);

cam->SetViewUp(0,0,1);

break;


case 1:

cam->SetFocalPoint(0,0,0);

cam->SetPosition(0,-1,0);

cam->SetViewUp(0,0,1);

break;


case 2:

cam->SetFocalPoint(0,0,0);

cam->SetPosition(0,0,1);

cam->SetViewUp(0,1,0);

break;



regards,
Girish
Hello Ingmar,
Thank you for your response! I did try to do that but unfortunately the
scene keeps going black after executing these changes. Calling any event on
the window makes the view to render correctly (wheel event, or just moving
around), so it has to be a method called when doing that on a
QmitkRenderWindow, just cannot seem to find it...
Thank you,
Albert.
Hi Albert,
did you try orthogonalizing the view up vector before calling
RequestUpdate?
currentCamera->OrthogonalizeViewUp();
mitk::RenderingManager::GetInstance()->RequestUpdateAll(
mitk::RenderingManager::REQUEST_UPDATE_3DWINDOWS);// For 3D widget only
This recomputes the view up vector to force it to be perpendicular to
camera->focal point vector. (See vtkCamera docu)
Ingmar
(Written on cellphone)
Hello everyone,
I am having trouble rendering the update of a vtkCamera on a
QMitkRenderWindow. I have a renderWindow which looks at a given scene. I
get its associated* vtkRenderWindow* and from it, the* ActiveCamera()*
(Which is a vtkCamera object).
currentCamera->SetPosition(0.0,0.0,0.0);
currentCamera->SetViewUp(1.0,0.0,0.0);
currentCamera->SetFocalPoint(0.7, 0.3, 0.4);
vtkTransform* translationToPoint = vtkTransform::New();
translationToPoint->Translate(40, 20, 30);
currentCamera->ApplyTransform(translationToPoint);
After applying these transformations, the renderwindow turns black,
currentCamera->Modified();
this->RequestRenderWindowsUpdate();
Paint method of the Base Renderer from MITK
vtkRenderWindow->Update();
and rendering the camera, render windows, renderer associated.... None
of them is working though.... However, the rendering is updated correctly
when scrolling on the window with the mouse. Which method is the correct
one to call for the window to show the new scene after modifying the
vtkCamera associated to a the window? (the one the WheelEvent method on the
QMitkRenderWindows seems to call).
Thank you very much,
Albert.
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most engaging
tech sites, SlashDot.org! http://sdm.link/slashdot______
_________________________________________ mitk-users mailing list
lists/listinfo/mitk-users
------------------------------------------------------------
------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
mitk-users mailing list
https://lists.sourceforge.net/lists/listinfo/mitk-users
--
thanks & regards,
Girish
--
-------------------------------------------------------------------------------------------------------------------------
*Disclaimer:* This email message including any attachments is confidential,
and may be privileged and proprietary to Agiliad. If you are not the
intended recipient, please notify us immediately by replying to this
message and destroy all copies of this message including any attachments.
You are NOT authorized to read, print, retain, copy, disseminate,
distribute, or use this message or any part thereof. Thank you.
------------------------------------------------------------------------------------------------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...

------------------------------

Message: 2
Date: Tue, 28 Feb 2017 13:35:39 +0100
From: Albert Alises <***@gmail.com<mailto:***@gmail.com>>
Subject: Re: [mitk-users] using mitkRotationOperation
To: Wojciech Lassmann <***@gmail.com<mailto:***@gmail.com>>
Cc: mitk-***@lists.sourceforge.net<mailto:mitk-***@lists.sourceforge.net>
Message-ID:
<CAGjZvMwJAmY2pLG4Qza5h1P=***@mail.gmail.com<mailto:***@mail.gmail.com>>
Content-Type: text/plain; charset="utf-8"

Hello Wojciech,

The mitk Rotation Operation works as follows:

The first parameter indicates which operation do you want to perform, in
our case the rotation, so the first parameter is *mitk::OpROTATE* instead
of 1. The second parameter indicates the point to rotate around. by setting
it to *geo->GetCenterInWorld() *, you are rotating around the center of
your view, which is correct based on your goals. The third and four
parameters refer to the vector of rotation and angle of rotation,
respectively. That is, they represent a rotation in *Axis-Angle *form.

In your case, you are rotating an angle given by *position *(MITK treats
them as non radian angles), *around the axis* defined by vector (in your
case, (0,1,0), but note that you assigned the position 0 of the vector 3
times! instead of: mitk::Vector3D vector = mitk::Vector3D();
vector[0]=0.0;
vector[1]=1.0;
vector[2]=0.0;)

Once defined this operation, you apply it to your geometry such as:



* geo->ExecuteOperation(op);*
And update the geometry. Try defining the rotation with the parameters
mentioned above and also render again using *this->RequestRenderWindowUpdate
*and see if it works.

Cheers,
Hi, i have problem.
I want to rotate the mitkWidget4 cotents arround 3 perpendicular vectors
(that would rotate with the world)
I allready know that VTK functions are not much of a help, as they rotate
around static axis, And i want to try with mitkRotationOperation, but seems
thet i dont understand it.
i use qt slider moved signal to trigger the slot, and read its position
qDebug() <<QString(position); //to check if is propperly trigered
// typedef mitk::Vector<ScalarType, 3> Vector3D;
mitk::Vector3D vector = mitk::Vector3D();
vector[0]=0.0;
vector[0]=1.0;
vector[0]=0.0;
mitk::RotationOperation* op = new mitk::RotationOperation(1, //i dont
actually know what does tis fo as it just an int, what value should it have
geo->GetCenterInWorld(), //where geo is time geometry of the data storage
initialising the views
vector,
(double)position); //which is the slider value
geo->ExecuteOperation(op);
ui->view2->mitkWidget4->update(); //where view2 is my temorary name
for QmitkStdMultiWidget
This doesn't seem to do anything, and I have no Idea why.
(http://docs.mitk.org/2015.05/GeometryOverviewPage.html *geometry->GetVtkMatrix()->Rotate()
*mentioned at the end of the page doesn't seem to exist anymore)
With Regards,
Wojciech Lassmann
------------------------------------------------------------
------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
mitk-users mailing list
https://lists.sourceforge.net/lists/listinfo/mitk-users
-------------- next part --------------
An HTML attachment was scrubbed...

------------------------------

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot

------------------------------

_______________________________________________
mitk-users mailing list
mitk-***@lists.sourceforge.net<mailto:mitk-***@lists.sourceforge.net>
https://lists.sourceforge.net/lists/listinfo/mitk-users


End of mitk-users Digest, Vol 129, Issue 14
*******************************************
Loading...