Skip to content

Conversation

@sahehb
Copy link
Collaborator

@sahehb sahehb commented Apr 22, 2025

No description provided.

@github-actions
Copy link

github-actions bot commented Apr 22, 2025

A preview of 3aec329 is uploaded and can be seen here:

https://mevislab.github.io/examples/pull/111/

Changes may take a few minutes to propagate. Since this is a preview of production, content with draft: true will not be rendered. The source is here: https://github.com/MeVisLab/examples/tree/gh-pages/pull/111/

## Prepare your network

### Displaying three images in one panel
Add an `ImageLoad` module to your workspace and select 3D image like *./MeVisLab/Resources/DemoData/MRI_Head.tif* from MeVisLab demo data directory. Connect an `OrthoReformat3` module and add three `View2D` modules.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

select a 3D image
from the MeVislab demo data


![Image Display Setup](/images/tutorials/basicmechanics/E6_1.png "Image Display Setup")

Opening the three `View2D` module panels now show the data in 3 orthogonal views. The module `OrthoReformat3` transforms the input image (by rotating and/or flipping) into the three main views commonly used.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

show -> shows


Add a `SoRenderArea` for your final result to the network and connect all three `SoViewportRegion` modules to it.

The result is, that all of your viewers are initially above each other in the bottom right corner.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The result is that (no comma)
are initially above each other -> are initially displayed on top of each other


The result is, that all of your viewers are initially above each other in the bottom right corner.

![All three viewers over each other](/images/tutorials/basicmechanics/E6_4.png "All three viewers over each other")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

over -> on top of


The `SoViewportRegion` module allows to define the X- and Y-position and the width and height of the image in the `SoRenderArea` module.

Values can be in pixels or as fractions from 0 to 1.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

from 0 to 1. -> from 0 to 1:

Values can be in pixels or as fractions from 0 to 1.
* 0 means the start of the render area
* 0.5 means the center of the render area
* 1 means the end of the render area
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not completely correct - it depends on the defined reference


![3D View Layout](/images/tutorials/basicmechanics/E6_11.png "3D View Layout")

These views will be arranged in a single panel, split into two sides, with each side showing two images. To add the 3D view, insert a `View3D` module and connect it to the `ImageLoad` module. Then connect the `View3D` to `SoCameraInteraction`, connect that to another `SoViewportRegion3`, and finally to `SoRenderArea`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to another SoViewportRegion3 -> to another SoViewportRegion

![Final Network](/images/tutorials/basicmechanics/E6_13.png "Final Network")

## Exercise
You can play around the different `SoViewportRegion` modules to create your own layouts by setting the values a little different.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

play around with the ...

@mrbean-bremen mrbean-bremen merged commit da50996 into main May 5, 2025
1 check passed
@sahehb sahehb deleted the MLAB-5611-SoViewPortRegionTutorial branch May 5, 2025 12:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants