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> 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> 
> Gesendet: Thursday, 9 March, 2023 01:00
> An: 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