View Issue Details

IDProjectCategoryView StatusLast Update
0001921Slicer4Core: GUIpublic2012-08-21 09:46
Reporterpinter Assigned Tofinetjul  
PrioritynormalSeverityfeatureReproducibilityN/A
Status closedResolutionfixed 
Product VersionSlicer 4.1.0 
Target VersionSlicer 4.1.1Fixed in VersionSlicer 4.1.1 
Summary0001921: Attribute list in MRML Node Inspector in Data module
Description

I extended the Data module with a table widget that displays the attributes of the selected MRML node, and allows adding, editing and removing attributes.

I forked the Slicer trunk just now, you can find it here:
https://github.com/cpinter/Slicer

Please review the code and merge it if you find it worthy.
Thanks!

TagsNo tags attached.

Relationships

related to 0002258 closedpinter Add button in Data module / Node inspector overwrites attribute if its name is selected 

Activities

pieper

pieper

2012-04-19 10:11

administrator   ~0004046

Julien - could you have a look at this code? It's from the Slicer RT project, but could be useful for many applications.

Screenshot of the interface:

https://www.assembla.com/spaces/slicerrt/documents/dKjtn6Ijyr4BT-acwqjQWU/download/dKjtn6Ijyr4BT-acwqjQWU

Commit diff:

https://github.com/cpinter/Slicer/commit/9edb32c18ac9a71462a8ac745bd92a575b5ab689

finetjul

finetjul

2012-04-19 11:10

administrator   ~0004047

Last edited: 2012-04-19 11:11

Looks very nice !
It's a great addition.
I commented on your github commit diff.

2 important points summarized here:

1)

a) A lot of logic is added to the Data module.
b) The Attribute table widget can be reused somewhere else.
-> I would extract all the code from data module and creat ea qMRMLNodeAttributeTableWidget instead.
With the following API:
class qMRMLNodeAttributeTableWidget
: public qMRMLWidget // takes care of the setMRMLScene() for you
{
qMRMLNodeAttributeTableWidget::setMRMLNode(...)
... all the methods you already have...
}

My preference (not 100% mandatory):
Ideally I could also see a qMRMLNodeAttributeTableView that is just the table and all utility functions. And qMRMLNodeAttributeTableWidget that is the table and some buttons such as add attribute, remove attribute...
This is what is done for the Annotation table if I'm not mistaken.

2) I would make the use of QTimer optional.
Using a timer has the drawback of having the state of the widget being inconsistent for a slight moment which can be a problem. Moreover the timing of the repopulating can fall at a bad moment (maybe the node deleted already ? ...)
Populating the tree widget is a quick action. I wouldn't bother with a Timer. The only optimization I can see is to block updates as long as the widget is not visible to the user and refresh it when it gets visible.

pinter

pinter

2012-04-20 15:35

developer   ~0004054

I made the changes you suggested in these commits:
https://github.com/cpinter/Slicer/commit/090b4b9ad3ce00ab9bfbc5143641ad2301f13c53
https://github.com/cpinter/Slicer/commit/af8703aaa0c4de8359093da3772a88432270897f

It seems to work fine, although I don't really like the automatic column resize setting of the table. It resizes itself to the actually visible content, and when I scroll to a view that contains longer attribute values, it remains small. Maybe we can come up with something else.

Please take a look at the code and let me know if anything needs to be changed.

finetjul

finetjul

2012-04-23 05:05

administrator   ~0004056

Looks good (haven't compiled nor run it though). Please see my few comments.
Consider also adding unit test for the 2 Qt widgets. See qMRMLCheckableNodeComboBoxTest.cxx for an example.
After that, feel free to push.
Thanks for your contribution !

pinter

pinter

2012-04-23 13:28

developer   ~0004064

I made the changes you requested, thanks for reviewing the code!
https://github.com/cpinter/Slicer/commit/d27dc435c121aa327582e62f940f81ecb3b3b1d2

I added the tests for the widgets:
https://github.com/cpinter/Slicer/commit/e4e5a867aeea103d4a93f57a7450467aaf1551da
I have questions though. How should I check the results without exposing some functions only for the test? See commented rows in the test cxx's.

I'm going on holiday tomorrow, so I might react slowly.
Thanks!

finetjul

finetjul

2012-04-23 14:08

administrator   ~0004065

Writting unit test is a good technique to ensure your API is good and usable.
Here, it probably means you need to expose more functions in your API.

pinter

pinter

2012-05-04 01:57

developer   ~0004157

I finished the tests (https://github.com/cpinter/Slicer/commit/b52c52a21c6b274b10eb174c937f12612d2d9b1b).
What would be the best way to integrate it?

finetjul

finetjul

2012-05-04 04:49

administrator   ~0004158

I wrote some minor comments.
To integrate, if you have svn access to the repo, it's
git svn dcommit
Otherwise you need someone with rights to commit for you.
Unfortunately, svn doesn't make a difference between committer (the one who integrates into svn) and author (the one who wrote the code).

  • So you either get svn write access, but we don't give them to sporadic commiters anymore (we limit write access).
  • or you ask someone with write access to integrate your work (git pull request on its Slicer github fork). That person will get the credits so he/she should mention you in the commit message.
    I would suggest to have Andras to integrate your work. I can also do it if you prefer.
    However, because all those commits are semantically only 1, maybe you could squash them in 1 commit to commit.
pinter

pinter

2012-05-15 15:02

developer   ~0004420

I addressed most of what you wrote:
https://github.com/cpinter/Slicer/commit/f0d2ef77bf86da31350e38be3d0deed7761827d3
If you agree with what I wrote on line 350 9https://github.com/cpinter/Slicer/commit/b52c52a21c6b274b10eb174c937f12612d2d9b1b#commitcomment-1316698), then I start integrating.

finetjul

finetjul

2012-05-15 15:17

administrator   ~0004423

Sounds good.
Before integrating, please squash all your commits in 1 commit.

pinter

pinter

2012-05-16 09:27

developer   ~0004434

I commited my changes in the SVN repo as revision 20089.
Thank you for your kind help!

Issue History

Date Modified Username Field Change
2012-04-19 08:44 pinter New Issue
2012-04-19 10:11 pieper Note Added: 0004046
2012-04-19 10:11 pieper Assigned To => finetjul
2012-04-19 10:11 pieper Status new => assigned
2012-04-19 10:11 pieper Category MRML => GUI
2012-04-19 11:10 finetjul Note Added: 0004047
2012-04-19 11:11 finetjul Note Edited: 0004047
2012-04-20 15:35 pinter Note Added: 0004054
2012-04-23 05:05 finetjul Note Added: 0004056
2012-04-23 13:28 pinter Note Added: 0004064
2012-04-23 14:08 finetjul Note Added: 0004065
2012-05-04 01:57 pinter Note Added: 0004157
2012-05-04 04:49 finetjul Note Added: 0004158
2012-05-15 15:02 pinter Note Added: 0004420
2012-05-15 15:17 finetjul Note Added: 0004423
2012-05-16 09:27 pinter Note Added: 0004434
2012-05-17 19:55 finetjul Status assigned => resolved
2012-05-17 19:55 finetjul Fixed in Version => Slicer 4.2.0 AHM Summer 2012
2012-05-17 19:55 finetjul Resolution open => fixed
2012-05-17 20:33 pinter Status resolved => closed
2012-05-17 20:33 pinter Fixed in Version Slicer 4.2.0 AHM Summer 2012 => Slicer 4.1.1
2012-06-26 08:04 pinter Relationship added related to 0002258
2012-08-21 09:46 jcfr Target Version => Slicer 4.1.1