Page MenuHomePhabricator

Offset in cross of QmitkStdMultiWidget
Closed, InvalidPublic

Description

The cross of the transversal/coronla/axial 2D view (red green and blue line) should be in the middle of the image pixels but they aren't (see screenshot).

My tested CT image has a spacing of 0.9 x 0.9 x 2 mm.

Event Timeline

Could you please try whether the following helps: re-initialize the display geometry by right-clicking on the image node in the "DataManager" and clicking on "Reinit".

yes, that works.

I load a mitk::Surface after loading the image. This surface seems to change some widget settings so that the slice cross is not centered any more.

Any ideas where this comes from?

(In reply to comment #2)

yes, that works.

I load a mitk::Surface after loading the image. This surface seems to change
some widget settings so that the slice cross is not centered any more.

Any ideas where this comes from?

This happens at the end of QmitkFileOpenAction::Run() (in /CoreUI/Bundles/org.mitk.gui.qt.common/src/QmitkFileOpenAction.cpp), where a bounding geometry around all data objects, which are currently included in the data storage, is calculated and used to initialize the views.

We had some discussions in the past whether this is reasonable. If we omit the re-initialization, newly loaded data may not appear.

You can use something like mitk::RenderingManager::GetInstance()->InitializeViews(your_image->GetGeometry()) to initialize the views according to your image (this is essentially what the "Reinit" button does).
Caution: This will show the slices of the image in the upper left view, Thus, in case you have a dataset where the slices are not transversal, the upper left view will not show transversal slices anymore.

I have a question to the last part of your comment:

My mitk::Surface object includes a set of polygons which are all isoplanar which means parallell to the xy plane. Therefore a cutter cannot cut such a planar polygon and the transversal view is always empty. Is there a way to say the transversal widget that it should render such polygons?

best regards

(In reply to comment #3)

(In reply to comment #2)

yes, that works.

I load a mitk::Surface after loading the image. This surface seems to change
some widget settings so that the slice cross is not centered any more.

Any ideas where this comes from?

This happens at the end of QmitkFileOpenAction::Run() (in
/CoreUI/Bundles/org.mitk.gui.qt.common/src/QmitkFileOpenAction.cpp), where a
bounding geometry around all data objects, which are currently included in the
data storage, is calculated and used to initialize the views.
We had some discussions in the past whether this is reasonable. If we omit the
re-initialization, newly loaded data may not appear.
You can use something like
mitk::RenderingManager::GetInstance()->InitializeViews(your_image->GetGeometry())
to initialize the views according to your image (this is essentially what the
"Reinit" button does).
Caution: This will show the slices of the image in the upper left view, Thus,
in case you have a dataset where the slices are not transversal, the upper left
view will not show transversal slices anymore.

(In reply to comment #4)

I have a question to the last part of your comment:

My mitk::Surface object includes a set of polygons which are all isoplanar
which means parallell to the xy plane. Therefore a cutter cannot cut such a
planar polygon and the transversal view is always empty. Is there a way to say
the transversal widget that it should render such polygons?

best regards

Does your set of polygons need to be stored in a mitk::Surface/vtkPolyData? There are other datastructures for sets of contours, but I am not up-to-date on how to use them. Maybe you ask the question on the mailinglist again.

My already programmed algorithms (before i used MITK) returns their results in vtkPolyDatas. And as i know the only data object which takes vtkPolyData as input is the surface.

I also thested the ContourSet class and wrote a converter, but the problem was that this visualization was extremely slow.... (i have a lot of contours and contour points)

Currently i wrote my own mapper which checks for planar polygons on same z coordinates and paints it. I did not thought that writing a mapper and adding it to mitk is so easy :-) ....

so my problem seems to be solved yet, thanks a lot for support

According to comment #2 and comment #3, it seems that this is not a bug - maybe a feature request to find a better way for view re-initialization after loading additional data. I tentatively change the status to "resolved/worksforme". Please reopen, if you do not agree or add a new one with a respective feature request.

kislinsk changed the task status from Invalid to Spite.Jun 27 2018, 1:32 PM
kislinsk added a project: Bulk Edit.
kislinsk changed the task status from Spite to Invalid.Jun 27 2018, 1:36 PM
kislinsk removed a project: Bulk Edit.