Page MenuHomePhabricator

helper object nodes are not shown although the preference "show helper object nodes" is enabled
Closed, ResolvedPublic

Description

steps to reproduce:

1 start extapp
2 go to preferences > datamanager
3 enable the option "show helper object nodes"

expected behaviour: all helper object should show up (e.g. the widget planes which are always visible are helper objects)

unfortunately, i can found a bug that is associated with the work on that special preference. it is just not working... the behaviour can be changed in the DataStorageTreeModel class: the class uses a composite predicate to decide what is shown in the datamanager

Event Timeline

correction:

it may be that only helper objects that contain data are really shown. well, then its more or less a matter of definition what should be shown or not

tested it again with the current HEAD ExtApp. the widget planes are not shown although they have a data object.

so the expected behaviour when enabling the "show helper objects" preference:
show all helper objects that do have a data object (see QmitkDataStorageTreeModel). the preference setting does not seem to have an effect

The reason why the widget planes are not shown when activating "Show helper objects" ist that the corresponding nodes are actually helper objects with a parent node that does not contain data.
Thus, the hierarchical check prevents adding them to the current DataStorage.

To provide full flexibility a preference "Show nodes containing no data" could be added to the preference page of the DataStorage.

Sounds ok and I don't see a reason why we should not store empty DataNodes in a storage.
You should check the rest of DataStorage for any code that relies on the assumtion that each DataNode has data associated. Your removing of a the check for this detail could lead to errors elsewhere.

[0f6e41]: Merge branch 'bug-8920-AllowShowingNodesContainingNoData'

Merged commits:

2011-08-10 15:39:58 Alexander Seitel [9e0a2a]
Added method UpdateNodeVisibility() that handles whether nodes defined as helper objects or nodes containing no data are shown in the DataStorage or not.


2011-08-10 15:38:54 Alexander Seitel [a2094e]
Add preference to allow showing nodes that contain no data.

It works well, thanks!

Some comments:

  • There are still messages in the output like this:

#43.870# ERROR: WARNING: No image, too many (>2) or two equal images were selected. This should be fixed, I think.

  • If you consider it safe, the preference could be on by default. This is a minor thing, since I can turn it on programmatically, and turning it on is not backwards compatible with previous MITK versions. (Maybe somebody relies on not showing nodes withot data in default.)

Can you please specify how to reproduce this error message?

For the default value: I think the default should be set to off to stay consistent with the previous versions. But when you change the preference once, this configuration should be safed in the application data and be loaded on the next startup.

Yes, I know that the setting is preserved. OK, I am fine with that.

About the error message:
I just click on an image that contains a node and then on another that does not. I am rechecking my code, if you did not see the message then the problem will be here. I will write soon if I had found it.

The message is given by the Segmentation View. To reproduce it you have to enable the view from the menu.

QmitkSegmentationView.cpp, line 501.

The plugins that override the "OnSelectionChanged" function could be affected. The complete list:

QmitkPropertyListView
QmitkSimpleMeasurement
QmitkSegmentationView
QmitkImageStatistics
QmitkVolumeVisualizationView
QmitkImageCropper
QmitkRegionGrowingView
QmitkFiberBundleOperationsView
QmitkPointSetInteractionView
QmitkMITKSurfaceMaterialEditorView
QmitkMeasurement
QmitkPythonConsoleView
QmitkBasicImageProcessing

This error message is intended. If you don't have image data assigned to your image node, segmenting this "image" is kind of unusual.

I'll close this bug now, since the problem it describes is resolved. Please file other problems eiter to the mailing list or to a new bug.

Patch for showing nodes without data if helper object are off

I checked the fix and I found some problems with it.

I simplified the logic expressions in your code using some classical logical laws. E.g. in the first branch (show helper objects and show nodes with no data) the expression looks like this:

mitk::NodePredicateOr::Pointer tempPredicate = mitk::NodePredicateOr::New(isNotHelperObjectAndContainsData,isHelperObjectAndContainsNoData);
m_Predicate = mitk::NodePredicateOr::New(tempPredicate,isHelperObjectAndContainsData);

With a simpler notation:
((!h & d) | (h & !d)) | (h & d)
that is equivalent with
h | d

However, this is not the intended behavior, because if both helper objects and nodes with no data are enabled then every (!) node should be shown. Indeed, nodes with no data are not shown if the helper objects are on.

The second branch is OK, but can be simplified:
(!h & d) | (h & d)
that is equivalent with
d

The third branch is also OK, but can be simplified:
(!h & d) | (!h & !d)
that is equivalent with
!h

The last branch is OK.
I attached a patch.

[041fba]: Merge branch 'bug-8920-SimplifyPredicateLogicForNodeVisibility'

Merged commits:

2011-08-17 14:01:07 Alexander Seitel [c4a23b]
Apply patch to simplify predicate logic for node visibility