Hello Rocío,
good to know that you could solve your problem.
However, there might be a slight misunderstanding: The mentioned
‘mitk::RenderWindowViewDirectionController::InitializeViewByBoundingObjects(const
BaseRenderer* renderer)’ is private and inaccessible.
But the idea was to just look at the function and try to understand what’s
going on as this might help you in your scenario. E.g. doing something like
‘mitk::RenderingManager::GetInstance()->InitializeView(renderer->GetRenderWindow(),
bounds)’
where you initialize the view of each renderer window in one of your
StdMultiWidget with the given bounds. The bounds are computed in the line
before that by using the nodes from one of your data storages.
This will allow you to do the InitializeView only for those render windows in
StdMultiWidget1 where DataStorage1 is valid and InitializeView differently for
those render windows in StdMultiWidget2 where DataStorage2 is valid.
However, you approach might also work since both of your two rendering manager
now only manage their own subset of render windows and will only update those.
But I’m not sure if you get into trouble with that somewhere else so keep in
mind, that the global rendering manager will still be used at different places.
E.g. if you click ‘Reinit’ on the context menu of a data node the global
rendering manager will still be used so all your render windows won’t be
updated since they are not known to the global rendering manager.
Best,
Amir
From: LOPEZ VELAZCO, ROCIO [mailto:rocio.lo...@upf.edu]
Sent: Monday, 19 March, 2018 15:46
To: Kalali, Amir
Cc: mitk-users@lists.sourceforge.net
Subject: Re: [mitk-users] Update different QmitkStdMultiWidget in same app
Hello Amir,
Thank you! it was useful to me your explanation about the global rendering
manager.
Regarding the function you suggested
me<https://phabricator.mitk.org/source/mitk/browse/master/Modules/RenderWindowManager/src/mitkRenderWindowViewDirectionController.cpp;48733f55943c98170b2339eb85503edc4d5052d8$83-110>
, it is private and I couldn't access it. To solve the issue I found that you
can provide a specific RenderingManager to the QmitkStdMultiWidget constructor,
so I created a different Rendering Managers for each one, then I just called:
my_rendering_manager->InitializeViewsByBoundingObjects(my_data_storage);
Now it is working perfectly!
Thank you again.
Best regards,
Rocío
2018-03-15 12:54 GMT+01:00 Kalali, Amir
<a.kal...@dkfz-heidelberg.de<mailto:a.kal...@dkfz-heidelberg.de>>:
Hello Rocío,
I don’t have enough experience with multiple data storages to say something
about the interaction with multiple multi widgets.
The problem with the “Reset View” option is, that it initializes the views of
the render windows with the geometry of the nodes of a specific data storage.
So you would use the different nodes of your different data storages in your
multi widgets. However, the different data nodes are used to computing the
bounding box. The update of the render windows (renderer) is still done on ALL
known renderer (see the marked line in
https://phabricator.mitk.org/source/mitk/browse/master/Modules/Core/src/Controllers/mitkRenderingManager.cpp;48733f55943c98170b2339eb85503edc4d5052d8$362).
This happens, since there is a global rendering manager who knows all render
windows.
So if you look at the second link of my last mail you can see that this “global
rendering manager” is used to initialize the view of a specific render window
(and not all known render windows). You could try to start here and see if you
can just use this function to initialize all your (4?) render windows in the
first multi widget with the MRI image and then initialize all your (4?) render
windows in the second multi widget with the US image.
I could image that you wouldn’t need render window specific property lists in
this case.
The idea of the render window specific property lists in the rendering manager
was, that you could show image 1 in render window 1 and image 2 in render
window 2, even if one would hide the other. You could then just hide the
foreground image in one of the render windows. But this seems not to be the
case in your scenario, since the problem is that your images do not overlap and
are therefore not visible simultaneously.
Best,
Amir
From: LOPEZ VELAZCO, ROCIO
[mailto:rocio.lo...@upf.edu<mailto:rocio.lo...@upf.edu>]
Sent: Thursday, 15 March, 2018 12:32
To: Kalali, Amir
Cc: mitk-users@lists.sourceforge.net<mailto:mitk-users@lists.sourceforge.net>
Subject: Re: [mitk-users] Update different QmitkStdMultiWidget in same app
Hello Amir,
Thank you very much for your fast reply.
I have different data storages for each tab to control what they contain and
show... is this a bad idea?
Yes, by "Reset View" I mean the option in the render window menu, so I might be
calling a Global Reinit. Does this mean that, even if they have different data
storages, all QmitkStdMultiWidget would be updated in the same geometry as the
current one?
Is there any way to separate this and do a "Individual Reinit" and not
globally for tabs?
I will take a look at the renderer specific property list, thanks for that!
Could this be an alternative to have several data storages?
Best,
Rocío
2018-03-15 12:06 GMT+01:00 Kalali, Amir
<a.kal...@dkfz-heidelberg.de<mailto:a.kal...@dkfz-heidelberg.de>>:
Hello Rocío,
How do you “load files”? Typically you won’t load files (images) into a multi
widget or a render window but into the data storage. The content of the data
storage is then represented by the data manager (typically the workbench part
on the leftmost side of the MITK workbench).
Is the MRI image visible in both multi widgets, if you just load it alone?
What do you mean with “Reset View”? Using the “Reset View” option from the
top-right render window menu? This should trigger a so-called “Global Reinit”,
which is also available in the context-menu of data nodes in the data manager.
This will initialize the views to the bounding box of all images inside the
data storage. However, depending on the origin and geometry of your images you
might not be able to see both images simultaneously.
There is a possibility to circumvent this issue using “renderer specific
property lists”. You can look into the RenderWindowManager module (e.g. here:
https://phabricator.mitk.org/source/mitk/browse/master/Modules/RenderWindowManager/src/mitkRenderWindowLayerController.cpp;48733f55943c98170b2339eb85503edc4d5052d8$120-161)
to see how you can define a data node to be visible in a renderer specific
property list.
Using a renderer specific property list will allow you to show different nodes
with different renderer (inside a render window).
Here
https://phabricator.mitk.org/source/mitk/browse/master/Modules/RenderWindowManager/src/mitkRenderWindowViewDirectionController.cpp;48733f55943c98170b2339eb85503edc4d5052d8$83-110
you can see how the view of a renderer is initialized only with the bounding
geometries of the images that are currently visible inside the renderer.
Best,
Amir
From: LOPEZ VELAZCO, ROCIO
[mailto:rocio.lo...@upf.edu<mailto:rocio.lo...@upf.edu>]
Sent: Thursday, 15 March, 2018 11:27
To: mitk-users@lists.sourceforge.net<mailto:mitk-users@lists.sourceforge.net>
Subject: [mitk-users] Update different QmitkStdMultiWidget in same app
Hello all,
I am developing a MITK based application which has two tabs with two different
QmitkStdMultiWidget . The first one is to show a MRI Image and the second one
is to show a US image. The button "load files" is in the first tab. When images
are loaded only the first QmitkStdMultiWidget shows the image, to be able to
see the US in second tab I have to manually do "Reset View". This allows me to
show US image but then MRI image "disappears" in the first QmitkStdMultiWidget.
It seems that I can't show both tabs updated at the same time...
Would you have any hint with this? Does it have something to do with the
Rendering Manager? I would be grateful if you could help me!
Thank you very much in advance!
Best regards,
Rocío
--
Rocío López Velazco
SimbioSYS group, BCN MedTech
UniversityPompeu Fabra
Department of Information and Communication Technologies
Roc Boronat, 122 (Tànger Building), 08018 Barcelona
Office 55 119
https://bcn-medtech.upf.edu/
------------------------------------------------------------------------------
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-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mitk-users