Hi Luca,

To answer your first question:

1.       You can customize the layout to your needs by adding a new function to 
the QmitkMultiWidgetLayoutManager, which provides you with the desired amount 
and grouping of render windows.

2.       You can still drag the borders of two render windows, e.g. when using 
ALL_2D_LEFT_3D_RIGHT such that one render window is hid.

Note that this will only hide the Qt-window, such that the rendered image is 
not visible; the render window instance is still there and will not be 
destructed that way.

To answer your second question:

1.       The SetInputWorldGeometry3D was removed in 
https://phabricator.mitk.org/T29218 /<https://phabricator.mitk.org/T29218%20/> 
https://phabricator.mitk.org/D701

2.       The way to use the SliceNavigationController is by giving it a 
TimeGeometry via SliceNavigationController::SetInputWorldTimeGeometry.

The code you linked uses a BaseGeometry, specifically a SlicedGeometry3D.

If you want to be able to add a customized geometry to the 
SliceNavigationController you’ll probably have to make a TimeGeometry out of it.

You can see an example of how this is done in 
SliceNavigationController::CreateWorldGeometry:

At the end of the function an ArbitraryTimeGeometry is created from the 
SlicedGeometry3D.

You can probably get the relevant time information (time steps and time bounds) 
from baseData->GetTimeGeometry().

Best,

Amir

Von: Luca Pegolotti <pegolotti.l...@gmail.com>
Gesendet: Tuesday, 28 March, 2023 19:52
An: Kalali, Amir <a.kal...@dkfz-heidelberg.de>
Cc: mitk-users@lists.sourceforge.net
Betreff: Re: [mitk-users] Changing layout of central widget to 2X 2D left and 
3D right

Hi Amir,

Thank you very much for your reply, I did manage to change the layout using 
QmitkMultiWidgetLayoutManager::SetLayoutDesign(LayoutDesign::ALL_2D_LEFT_3D_RIGHT).

I have a couple of follow up questions:

— Is it possible to only keep 2 2D views like it was done in old versions of 
MITK with changeLayoutTo2x2Dand3DWidget?
— I need to update some code that switches the content of the 2D views to show 
a slice of the medical image according to a certain plane. 
This<https://github.com/SimVascular/SimVascular/blob/f6179e1f07e36cde191cb5e15945ab5eee310113/Code/Source/sv4gui/Modules/Segmentation/sv4gui_SegmentationUtils.cxx#L338>
 is how the SlicedGeometry3D is currently created and 
this<https://github.com/SimVascular/SimVascular/blob/f6179e1f07e36cde191cb5e15945ab5eee310113/Code/Source/sv4gui/Modules/QtWidgets/sv4gui_ResliceSlider.cxx#L192>
 is where it is assigned to a view. However, the function 
SetInputWorldGeometry3D doesn’t exist anymore. Is It possible to do the same in 
newer versions of MITK?

Best,
Luca



On Mar 28, 2023, at 8:48 AM, Kalali, Amir 
<a.kal...@dkfz-heidelberg.de<mailto:a.kal...@dkfz-heidelberg.de>> wrote:

Hi Luca,

sorry for the late reply, we are currently in the process of finalizing new 
features for the upcoming MITK release in April / Mai.

If you have an IRenderWindowPart I guess you are casting it to a an 
QmitkStdMultiWidgetEditor (or at least an QmitkAbstractMultiWidgetEditor), 
right?

The QmitkAbstractMultiWidgetEditor (which is also the base class of the 
QmitkStdMultiWidgetEditor) provides a function to retrieve the contained 
QmitkAbtractMultiWidget (QmitkStdMultiWidget):
-          QmitkAbstractMultiWidgetEditor::GetMultiWidget()

You can use this function to get the multi widget and pass it on to your 
QmitkMultiWidgetLayoutManager.
However, we were wondering how you use the layout manager:
If you already have e.g. a QmitkStdMultiWidgetEditor (because you retrieved it 
using e.g. QmitkAbstractView::GetRenderWindowPart and then casting it) then an 
instance of a QmitkStdMultiWidget can be retrieved (see paragraph above).
With this QmitkStdMultiWidget you can call 
QmitkAbstractMultiWidget::GetMultiWidgetLayoutManager() and you will get an 
instance of a QmitkMultiWidgetLayoutManager. Because each 
QmitkAbstractMultiWidget already comes with a layout manger, see initializer 
list ofQmitkAbstractMultiWidget::Impl::Impl.

Also, you don’t need to call 
QmitkMultiWidgetLayoutManager::SetAll2DLeft3DRightLayout, you can also 
useQmitkMultiWidgetLayoutManager::SetLayoutDesign with the required argument, 
e.g.QmitkMultiWidgetLayoutManager::SetLayoutDesign(LayoutDesign::ALL_2D_LEFT_3D_RIGHT)

Let me know if this helps.

Best,

Amir

Von: Luca Pegolotti <pegolotti.l...@gmail.com<mailto:pegolotti.l...@gmail.com>>
Gesendet: Thursday, 9 March, 2023 01:00
An: mitk-users@lists.sourceforge.net<mailto:mitk-users@lists.sourceforge.net>
Betreff: [mitk-users] Changing layout of central widget to 2X 2D left and 3D 
right

Hi MITK community,

I am dealing with some legacy code that used the function 
changeLayoutTo2x2Dand3DWidget in QmitkStdMultiWidget (not available anymore) to 
change the layout of the 4 window widget at the center of the workbench.

I am trying to update the code to use IRenderWindowPart instead (as suggested 
by this<https://www.mitk.org/wiki/Views_Without_Multi_Widget> documentation 
page). My guess is that the correct way to do this now is to use 
QmitkMultiWidgetLayoutManager<https://docs.mitk.org/nightly/classQmitkMultiWidgetLayoutManager.html>,
 in particular the method SetAll2DLeft3DRightLayout, but I don’t understand how 
to pass the current QmitkAbstractMultiWidget to its constructor or its 
SetCurrentRenderWindowWidget method.

Am I on the right track? If so, what would be the correct way of getting an 
QmitkAbstractMultiWidget object to pass to QmitkMultiWidgetLayoutManage from 
IRenderWindowPart?



Best regards,
Luca Pegolotti

_______________________________________________
mitk-users mailing list
mitk-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mitk-users

Reply via email to