View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0002919 | Slicer4 | Core: Base Code | public | 2013-02-07 06:17 | 2018-03-02 11:06 |
Reporter | wangk | Assigned To | nicole | ||
Priority | normal | Severity | feature | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Product Version | Slicer 4.2.2-1 | ||||
Target Version | Slicer 4.4.0 | Fixed in Version | Slicer 4.4.0 | ||
Summary | 0002919: Add UseColorNameAsLabel for scalar bar widget | ||||
Description | Currently vtk scalarbar widget only shows scalar value as labels. It would be useful in some applications to show the color names as labels. for example: when using the Slicer3_2010_label_Colors color table in slicer, instead of showing the scalar values, it would be nice to show the color names as labels in scalarbar widget. This is not a bug but a feature request. I am currently working on this issue and will submit a patch when it is done. | ||||
Tags | No tags attached. | ||||
related to | 0001918 | closed | mehrtash | Color scale |
has duplicate | 0002563 | closed | nicole | Add the option to display color names instead of lookup table values for scalar bar |
related to | 0003027 | closed | nicole | Scalarbar label opacity, font and style do not update in colors module |
related to | 0003802 | assigned | nicole | Extend label format error checking in vtkSlicerScalarBarActor |
2013-02-08 05:50
|
|
I have pushed topic to https://github.com/kevinwangcanada/Slicer/tree/2919-Add-UseColorNameAsLabel-for-scalarbar-widget All the changes are limited to the colors module. Ideally, these changes should be push to VTK and CTK. |
|
Checked it out and building now. Could you also add a test for the new class? Something simple to start is fine, I just want to have an indicator on the dashboard that the new class is working as expected. |
|
I'd like to see the GUI label text changed to: Adjusting the "Number of labels" spin box in the Scalar Bar GUI widget doesn't seem to be making any difference in the scalar bar VTK widget (tested with the Pelvis Color color node). It does work when you toggle it back to not using the color names, the numbers do adjust. Testing with the Abdomen Colors shows the limitation more clearly, the text is unreadable because the table goes up to 701 even though it's mostly empty. Generic Anatomy Colors also ends up with really tiny fonts. 50 labels max might be a good upper limit/default, as the 64 color non semantic one you can just about make out the text. |
|
Thanks for all your comments. I will address them in the next submission and will let you know when it is ready. |
|
Hi Nicole, Actually vtkScalarBarActor is not in vtk widget directory, it is in Rendering directory. Maybe putting vtkSlicerScalarBarActor in VTKRendering or Rendering subdirectory would make more sense, how do you think? Kevin |
|
For now, I meant to move vtkSlicerScalarBarActor into |
|
Sorry, I did not make it clear. Instead of moving vtkSlicerScalarBarActor into Thanks. |
|
I was going by the placement of the widgets and representations in the Annotations module, but you're right, the scalar bar actor seems to be a class that was left behind in the Rendering library during the transition to the widget/representation framework in VTK. |
|
Hi Nicole, I have finished all the improvements you recommended and have pushed to topic at https://github.com/kevinwangcanada/Slicer/tree/2919-Add-UseColorNameAsLabel-for-scalarbar-widget Let me know what you think about this version. Thanks, Kevin |
|
Minor thing: could you change the test name from Otherwise looks good to me! |
|
Hi Nicole, I have changed the test name and pushed the topic at https://github.com/kevinwangcanada/Slicer/tree/2919-Add-UseColorNameAsLabel-for-scalarbar-widget Thanks, Kevin |
|
Hi Nicole, Thanks for your work. I forgot to check the labelformat. I have made changes to allow labelformat to be used with colornames. You can check out the new code at https://github.com/kevinwangcanada/Slicer/tree/2919-Add-UseColorNameAsLabel-for-scalarbar-widget Regarding the labelformat widget updating issue. As you said it is same no matter usecolornameaslabel is selected or not. I think it is a separate issue and maybe we should create a new ticket for that? also the scalarbarwidget ui is done in CTK so this might have to be fixed in CTK not slicer. Thanks, Kevin |
|
For reference, my report that I sent via email instead of via this bug report was: The colour names are adjusting to the number of labels spin box setting now, looks good. After this latest update, the label format string is updating on the vtk widget as I change it in the CTK widget. Label color, opacity, font, style all require a click in the 3D window to show the updated setting. The problem could either be in the CTK widget when it updates the setting but doesn't trigger an event, or in the way the VTK widget is hooked up to the 3D window (the dipslayable manager not listening for certain events?). I'd say that's a separate bug report, starting here in Slicer and them moving to either VTK or CTK's bug tracker as needed. |
|
Actually on my machine, label color updates properly. The others (opacity, font and style) are having update problems. I have created a new ticket http://na-mic.org/Mantis/view.php?id=3027 Do you want to push the code to slicer trunk and change the status of this ticket to resolved? Thanks |
|
Thanks for creating the new ticket! |
|
One file is in conflict with the trunk: Hang on a bit, I realised there are some differnet ways I can try merging the changes that might avoid the conflict... |
|
I've run into too many conflicts, and can't get it merged tonight: Could you please fix these on your branch and I can try again on Monday? |
|
Hi Nicole, I have updated my branch to the latest Slicer trunk. Can you update your branch to check if you still have many conflicts? Thanks. |
|
I'm still having problems merging it, but think that I'm hitting the limits of my git expertise. I have a couple more things I can try and some experts I can call in, and will give it another shot tomorrow or Monday. |
|
Thanks for your time. Maybe we can wait a bit since we are still seeing build errors on the dashboard and Jc and other experts are probably busy working on those issues. |
|
JC had some comments as I was trying to merge your code: What's your plan wrt getting this change into VTK? I'm okay with the scalar bar actor class name staying as is for Slicer inclusion, but let me know if you want to change it for ease of integration with VTK. |
|
I have read through the comments on github. I am ok with the name change to vtkSlicerScalarActorWithColorNames. It would be nice if this get into VTK if VTK people think this is of value, if not I am fine with it staying slicer. However, I would like to minimize the overhead of integration. if we want to get this into VTK eventually, then making it into slicer and remove it later would be a waste of time. On the other side, if we follow Jc's recommendatioin, get this into the VTK fork of slicer but later the VTK people reject to get this into VTK, then we have to remove it from VTK fork and add it into slicer. What do you guys think? |
|
What's the integration status of this feature? Are you still thinking of going the VTK route? |
|
Sorry I did not have enough time to push this to VTK. It will probably take some time to get this into vtk. so is it possible to mark this feature as future instead of 4.3? |
|
Hi Kevin, There's been some interest in working with color tables again and I wanted to check in with you on the status of putting this feature into VTK. If there's no traction there, should we just put it into Slicer now? |
|
Hi Nicole, This feature is available in VTK6.0. so when Slicer migrate to VTK6 it can start to use this feature. for VTK5.10, I have created a patch to backport the VTK6.0 feature to 5.10. however, since this is a feature patch and VTK5.10 branch only takes bug fixes so it can not go into 5.10 branch. so what I did was to submit a pull request to Slicer's VTK clone [1]. it has not been merged into the trunk yet. I guess Jc was busy working on other projects. let me know if you have more questions. |
|
Hi Kevin, Great news! I'll check in with JC at the winter project week and see if we can get the pull request integrated on the Slicer VTK clone, for now I assigned him so we can get the conversation started. |
|
To be revisited once Slicer switches to VTK6 before the 4.4 release. |
|
VTK6 can be enabled with a CMake flag now, looking at integrating this feature using |
|
Dug into this a little bit: Going forward there are some options:
|
|
2014-05-15 13:28
|
64-color-nonsemantic-annotated.tiff (252,664 bytes) |
VTK bug submitted: CTK issue submitted: |
|
Hi Nicole, I have changed my original vtkSlicerRTScalarBarActor class code to use annotations in VTK6. but instead of using VTK6 drawAnnotation which shows annotation along with labels, I just turn off drawannotation options and instead as a UseAnnotationAsLabel option which shows annotation as labels. this allows to sample the annotation just as we do for labels. You can take a look at the code at : https://www.assembla.com/code/slicerrt/subversion/nodes/1832/trunk/SlicerRt/src/Isodose/Widgets Thanks, |
|
Hi Nicole, a new topic branch was created for the VTK 6 code. patches has been pushed to this branch: https://github.com/kevinwangcanada/Slicer/tree/2919-Add-UseColorNameAsLabel-for-scalarbar-widget-VTK6 Please review it. Thanks, |
|
Took a quick look at the code, will compile and test it this afternoon. The one minor thing that jumped out at me was the use of snprintf, I hadn't noticed it used elsewhere before, but a quick search shows that it's only used in one file: |
|
Testing results:
I'd also like to see a test added, a python self test that does the following: open the colors modulemainWindow.moduleSelector().selectModule('Colors') show the scalar bar widgetctkScalarBarWidget.setDisplay(1) iterate over the color nodes and set each one activenumColorNodes = slicer.mrmlScene.GetNumberOfNodesByClass('vtkMRMLColorNode') use the delay display here to ensure a renderSince the release is tomorrow, I'm going to retarget this and we can get it ready for the next patch release. |
|
Hi Nicole, I just finished fixing the crashes and font too small problem. I have also added a python selftest. please review the new code at https://github.com/kevinwangcanada/Slicer/commit/04f6094a8969fce8510b03647d1fb976009e24bb Thanks, Kevin |
|
The test is missing the delay display line to make sure that the window renders after switching color tables. This should work (didn't test it yet): |
|
I have added delayDisplay and tested it. it worked. code pushed to github already. Thanks. |
|
Thanks! |
|
No, it is not there. as the proper place to put that option is the ctk scalar bar widget which would require to change CTK codebase. another way is to add the option in Slicer GUI but it will look a bit strange. so I took the liberty to not implement it for now. for colorTableNode or FreeSurferColorNode which all have a colorName property, I will display the colorname, for procedurecolornode, just display color value. I hope that is ok. if people want to know the value, then they can check that using the colorname. Thanks, Kevin |
|
True, the CTK widget is missing some options, I'm just leery of turning on a feature like this that people may use as non-developers (ie for pulications) without giving them an option to turn it off. I'll take a look at the user experience and see how it works. |
|
Make sense. you have better understanding with colors module. so please fix wherever you think it fits. Thanks. |
|
I tried a first pass of adding the check box, got a crash when running the self test, in snprintf again. Todo: isolate the crash, test my logic for switching between names and indices. The FS continuous tables are showing the generated RGB names and need to be a special case. |
|
Crash is due to invalid format string plus number combo with the checkbox changes. |
|
Kevin added support for batch setting the annotations to avoid a performance problem: I incorporated that in my addition of the check box to toggle between names and values (with simple format string checking): I think that branch is ready to test elsewhere and integrate. |
|
pull request: |
|
Reponding to comments on the pull request: TODO: in the slicer scalar bar actor, make a more strict regular expression to check for strings vs numbers in the label format. |
|
Updated pull request: |
|
Fixed in r23566 |
|
Hi Nicole, I just updated my slicer and now I can see the checkbox you added above the scalarbar. that is a very smart place to put the checkbox for now. Do you have a plan to relocate the checkbox into the ctk widget? I think that would be a more logic place to put the checkbox. Thanks, Kevin |
|
Slicer: 2145-support-for-installing-extension-from-file 8f47cb25 2013-03-22 18:47:05 naucoin Details Diff |
BUG: add a dir in SVN for the git svn commit from kevin wang Kevin is adding a scalar bar actor with extra features, it will go in the VTKRendering subdir Issue 0002919 git-svn-id: http://svn.slicer.org/Slicer4/trunk@21833 3bd1e089-480b-0410-8dfb-8563597acbee |
||
Slicer: 2145-support-for-installing-extension-from-file 65a57f8c 2013-03-22 18:55:02 naucoin Details Diff |
BUG: adding the dir in svn not working with git svn dcommit, removing it Issue 0002919 git-svn-id: http://svn.slicer.org/Slicer4/trunk@21834 3bd1e089-480b-0410-8dfb-8563597acbee |
||
Import 2017-06-07 23:51:09: master 6dd8a342 2014-08-14 14:10:10 Details Diff |
ENH: Add enhanced scalarbar actor class based on VTK6. Fixes 0002919 The VTK6 vtkScalarBarActor class allows displaying annotations in conjunction with labels. However, in Slicer we want to sample the annotations for display just like color values since some color tables have more than 10000 values and annotations. The vtkSlicerScalarBarActor is based on vtkScalarBarActor class and only overrides its LayoutTicks method to slightly modify the method to enable sampling the annotations and display it as labels. Additional remarks: * Change colors module logic using the new class. * Keep backward compatibility to VTK5. * Added a python selftest based on scripted module superclass. * Added a check box to toggle using the color names as labels, and set default label formats when it's toggled to support strings or numbers. * Added simple label format testing to avoid crashes that were seen when using a string format with a number value. * Regular expression associated with LabelFormat could be improved. This is tracked by issue 3802 Co-authored-by: Nicole Aucoin <nicole@bwh.harvard.edu> From: Kevin Wang <kevin.wang@rmp.uhn.ca> git-svn-id: http://svn.slicer.org/Slicer4/trunk@23566 3bd1e089-480b-0410-8dfb-8563597acbee |
||
mod - Modules/Loadable/Colors/CMakeLists.txt | Diff File | ||
mod - Modules/Loadable/Colors/Resources/UI/qSlicerColorsModuleWidget.ui | Diff File | ||
mod - Modules/Loadable/Colors/Testing/CMakeLists.txt | Diff File | ||
add - Modules/Loadable/Colors/Testing/Python/CMakeLists.txt | Diff File | ||
add - Modules/Loadable/Colors/Testing/Python/ColorsScalarBarSelfTest.py | Diff File | ||
add - Modules/Loadable/Colors/VTKWidgets/CMakeLists.txt | Diff File | ||
add - Modules/Loadable/Colors/VTKWidgets/vtkSlicerScalarBarActor.cxx | Diff File | ||
add - Modules/Loadable/Colors/VTKWidgets/vtkSlicerScalarBarActor.h | Diff File | ||
mod - Modules/Loadable/Colors/qSlicerColorsModuleWidget.cxx | Diff File | ||
mod - Modules/Loadable/Colors/qSlicerColorsModuleWidget.h | Diff File |
Date Modified | Username | Field | Change |
---|---|---|---|
2013-02-07 06:17 | wangk | New Issue | |
2013-02-07 06:17 | wangk | Status | new => assigned |
2013-02-07 06:17 | wangk | Assigned To | => pieper |
2013-02-07 06:39 | pieper | Assigned To | pieper => nicole |
2013-02-07 06:39 | pieper | Severity | minor => feature |
2013-02-08 05:50 | wangk | File Added: UseColorNameAsLabel.png | |
2013-02-08 05:51 | wangk | Note Added: 0007841 | |
2013-02-12 09:30 | nicole | Note Added: 0007901 | |
2013-02-13 05:33 | nicole | Note Added: 0007914 | |
2013-02-13 05:33 | nicole | Status | assigned => feedback |
2013-02-13 05:33 | nicole | Target Version | => Slicer 4.3.0 |
2013-02-13 06:39 | wangk | Note Added: 0007915 | |
2013-02-13 08:45 | wangk | Note Added: 0007918 | |
2013-02-13 09:02 | nicole | Note Added: 0007919 | |
2013-02-13 09:06 | wangk | Note Added: 0007920 | |
2013-02-13 09:17 | nicole | Note Added: 0007921 | |
2013-03-19 09:31 | wangk | Note Added: 0008147 | |
2013-03-19 11:18 | nicole | Note Added: 0008161 | |
2013-03-20 11:39 | wangk | Note Added: 0008180 | |
2013-03-21 06:26 | wangk | Note Added: 0008188 | |
2013-03-21 07:11 | nicole | Note Added: 0008189 | |
2013-03-22 09:31 | wangk | Relationship added | related to 0003027 |
2013-03-22 09:33 | wangk | Note Added: 0008206 | |
2013-03-22 11:09 | nicole | Note Added: 0008208 | |
2013-03-22 13:01 | nicole | Note Added: 0008210 | |
2013-03-22 13:43 | nicole | Note Edited: 0008210 | |
2013-03-22 14:57 | nicole | Note Added: 0008214 | |
2013-03-27 12:44 | wangk | Note Added: 0008252 | |
2013-03-28 13:01 | nicole | Note Added: 0008262 | |
2013-04-02 06:07 | wangk | Note Added: 0008281 | |
2013-04-04 10:40 | nicole | Note Added: 0008312 | |
2013-04-05 06:57 | wangk | Note Added: 0008318 | |
2013-07-09 07:12 | nicole | Relationship added | parent of 0001918 |
2013-07-09 07:21 | nicole | Note Added: 0008935 | |
2013-07-09 08:19 | nicole | Relationship added | has duplicate 0002563 |
2013-07-09 10:24 | wangk | Note Added: 0008967 | |
2013-07-09 12:57 | nicole | Status | feedback => assigned |
2013-07-09 12:57 | nicole | Target Version | Slicer 4.3.0 => Slicer 4.4.0 |
2013-12-20 10:58 | nicole | Note Added: 0010457 | |
2013-12-23 05:50 | wangk | Note Added: 0010464 | |
2013-12-23 06:06 | nicole | Note Added: 0010465 | |
2014-03-11 13:17 | nicole | Note Added: 0011422 | |
2014-05-14 13:19 | nicole | Note Added: 0011858 | |
2014-05-15 13:27 | nicole | Note Added: 0011864 | |
2014-05-15 13:28 | nicole | File Added: 64-color-nonsemantic-annotated.tiff | |
2014-05-15 13:28 | nicole | Status | assigned => feedback |
2014-05-22 12:58 | nicole | Note Added: 0011944 | |
2014-05-22 13:05 | nicole | Note Edited: 0011944 | |
2014-07-02 09:45 | wangk | Note Added: 0012124 | |
2014-07-02 10:56 | wangk | Status | feedback => acknowledged |
2014-07-29 08:19 | wangk | Note Added: 0012266 | |
2014-07-29 10:20 | nicole | Note Added: 0012269 | |
2014-07-29 14:03 | nicole | Note Added: 0012279 | |
2014-07-29 14:04 | nicole | Status | acknowledged => feedback |
2014-07-29 14:08 | nicole | Target Version | Slicer 4.4.0 => Slicer 4.4.1 |
2014-08-01 11:06 | wangk | Note Added: 0012331 | |
2014-08-01 11:06 | wangk | Status | feedback => assigned |
2014-08-01 11:24 | nicole | Note Added: 0012332 | |
2014-08-01 11:37 | wangk | Note Added: 0012333 | |
2014-08-01 11:52 | nicole | Note Added: 0012334 | |
2014-08-01 11:58 | wangk | Note Added: 0012335 | |
2014-08-01 12:01 | nicole | Note Added: 0012336 | |
2014-08-01 12:06 | wangk | Note Added: 0012337 | |
2014-08-01 14:34 | nicole | Note Added: 0012339 | |
2014-08-01 14:54 | nicole | Note Added: 0012340 | |
2014-08-05 12:42 | nicole | Note Added: 0012352 | |
2014-08-05 13:06 | nicole | Note Added: 0012353 | |
2014-08-12 14:19 | nicole | Note Added: 0012361 | |
2014-08-14 07:54 | nicole | Note Added: 0012367 | |
2014-08-14 10:03 | nicole | Relationship added | related to 0003802 |
2014-08-14 10:31 | jcfr | Note Added: 0012368 | |
2014-08-14 10:31 | jcfr | Status | assigned => resolved |
2014-08-14 10:31 | jcfr | Fixed in Version | => Slicer 4.4.0 |
2014-08-14 10:31 | jcfr | Resolution | open => fixed |
2014-08-14 10:32 | jcfr | Relationship replaced | related to 0001918 |
2014-08-14 10:33 | jcfr | Target Version | Slicer 4.4.1 => Slicer 4.4.0 |
2014-08-15 10:04 | wangk | Note Added: 0012381 | |
2017-06-07 23:27 | Changeset attached | => Slicer 2145-support-for-installing-extension-from-file 65a57f8c | |
2017-06-07 23:27 | Changeset attached | => Slicer 2145-support-for-installing-extension-from-file 8f47cb25 | |
2017-06-10 08:51 | jcfr | Changeset attached | => Slicer master 6dd8a342 |
2018-03-02 11:06 | jcfr | Status | resolved => closed |