Page MenuHomePhabricator

Also print out properties in BaseData::PrintSelf()
Closed, ResolvedPublic

Description

In mitk::BaseData::PrintSelf the properties are not added to the stream to be displayed.
To reproduce: DataManager, context menu, item "Details". Here no properties are listed.

If one adds properties to a BaseData then it would be nice to make them visible in Details section.

Implementation is attached below and straight forward.

Basically it adds the following lines to mitk::BaseData::PrintSelf():

// print out all properties

PropertyList::Pointer propertyList = this->GetPropertyList();
if (propertyList.IsNotNull() && ! propertyList->IsEmpty() ) 
{
    //general headline 
    os << "Properties of BaseData:" << std::endl;

    const PropertyList::PropertyMap* map = propertyList->GetMap();
    for (PropertyList::PropertyMap::const_iterator iter = map->begin(); iter != map->end(); iter++) 
    {
        os << "  " << (*iter).first << "   "  << (*iter).second->GetValueAsString() << std::endl;
    }
}

Event Timeline

patch for feature request 16811

I have setup a branch on github to integrate into MITK if possible.

https://github.com/iwegner/MITK/tree/bug-16811-PrintOutBaseDataProperties

I have created a pull request:
https://github.com/MITK/MITK/pull/91

and I will write an email to the users list.

;) Ingmar

Not contained in 2015.05.0.
I was trying to create a new pull request but deleted it again because it was based on v2015.05.0 and should be integrated in master.
But changes are straight forward and still the same. Only the file was moved.

Cheers!

User goch has pushed new remote branch:

bug-16811-print-base-data-properties

Requesting core flag.

Changed files:
Modules/Core/src/DataManagement/mitkBaseData.cpp

What was changed:
PrintSelf now also prints GetValueAsString of each property in the base data property list

How is it tested:
Tested it manually.

[3f4835]: Merge branch 'bug-16811-print-base-data-properties'

Merged commits:

2014-11-19 12:15:44 Ingmar Wegner [ac9acb]
Adding feature to also print out the base data properties. E.g. usefull when viewing details in DataManagerPlugin of a node that contains BaseData properties.

Signed-off-by: Ingmar Wegner iwegner<[at]>gmx.de