View Issue Details

IDProjectCategoryView StatusLast Update
0002267Slicer4Core: MRMLpublic2017-06-10 08:51
Reporterinorton Assigned Tonicole  
PrioritynormalSeverityfeatureReproducibilityN/A
Status closedResolutionfixed 
Product Version 
Target VersionSlicer 4.5.0-1Fixed in VersionSlicer 4.5.0-1 
Summary0002267: Add "SliceIntersectionWidth" property to ModelDisplayNode
Description

Per Andrey's request, he would like to have option to make slice intersections thicker. This is easy to support in DM but needs a new property on the ModelDisplayNode.

Tagshelp-wanted

Relationships

related to 0001536 closedalexy Model slice intersections do not work 
related to 0003980 closedjcfr Slice Intersections Thickness doesn't working 
related to 0002946 closedfinetjul Add Point/Line thickness for models 
child of 0003003 closednicole Screenshots 

Activities

fedorov

fedorov

2013-01-14 17:23

developer   ~0007668

From Xinwei Wang, Stanford:

"Hope that it can be fixed after next major release. Otherwise, it is not convenient.
I think that many people have this issue."

fedorov

fedorov

2013-01-14 17:51

developer   ~0007669

Same issue in Slicer3, that has not been resolved: http://www.na-mic.org/Bug/view.php?id=715

Posts on user list that requested specifically this feature:

2010: http://slicer-users.65878.n3.nabble.com/editor-label-outline-line-thickness-td931595.html
2012: http://slicer-users.65878.n3.nabble.com/Display-thicker-lable-volume-outlines-td3839396.html

pieper

pieper

2013-01-15 03:03

administrator   ~0007671

There are two related issues in terms of making slice overlays thicker:

1) the outline mode of a label map (as set by the button in the slice controller widget). For this, we could add an explicit image dilate step in the slice layer pipeline. Note that there may be issues at the borders of labels. The dilate code would have to be added here:

https://github.com/Slicer/Slicer/blob/master/Libs/MRML/Logic/vtkMRMLSliceLayerLogic.cxx#L563

Alternatively the label outline class could be modified to show pixels that are not just on the border, also one or more pixels in from the border. The most general solution would be to do a localized distance transform of some sort. Probably the dilate is easier.

2) the outlines of models intersected with the slice, as selected in the models module. These can easily be made thicker with a property on the actor:

https://github.com/Slicer/Slicer/blob/master/Libs/MRML/DisplayableManager/vtkMRMLModelSliceDisplayableManager.cxx#L318

http://www.vtk.org/doc/nightly/html/classvtkProperty2D.html

fedorov

fedorov

2013-01-15 15:31

developer   ~0007678

Steve, for (1), maybe we can try to add an option to initialize voxel neighborhood in the output instead of just one voxel here: https://github.com/Slicer/Slicer/blob/master/Libs/MRML/Logic/vtkImageLabelOutline.cxx#L158 ?

For (2), does it make sense to add intersection line thickness to the display node, expose it in the Models widget, and initialize on the actor?

pieper

pieper

2013-01-16 02:33

administrator   ~0007680

For (1), Demian and I talked and he suggested doing an n-pixel erosion and then subtracting it from the label layer. I like this suggestion since we could make the lines arbitrarily thick. Unfortunately we could not find a multi-label erosion filter already implemented in ether vtk or itk, so there some coding to be done to implement that.

For (2), yes, it seems we have some options:
(a) we could expose a per-model slice intersection thickness. Or, (b) we could just change the default thickness from 1 to 3, which would probably always give good results. Or (c) we could make a global thickness setting and use it in the model slice displayable manager. The best overall solution would probably be (a), with an extra option to set the thickness globally on all models in the scene.

BTW, I exchanged email with Xinwei and it seems that issue (1) is the one that causes issues for them right now.

fedorov

fedorov

2013-01-16 03:43

developer   ~0007681

Good idea. I looked around but could not find a filter for (1) either. I will see if I have some down-time during the case to look into this. I would think taking ITK erosion filter, adding extra checks and wrapping ITKVTK should not be very hard, but maybe I am missing something.

For (2), I agree it does not resolve directly the request, but I think would be nice to have this feature anyway, especially since it enables visualization of multiple contours.

pieper

pieper

2013-01-16 04:02

administrator   ~0007682

It would be great if you could look into (1) Andrey. I agree that writing the vtkITK wrapper would be the right thing, and it could be integrated in the display pipeline. What Demian and I looked for was a filter that would erode all label values in one pass rather than requiring that the image be decomposed into multiple images, one per unique label value to erode. So maybe this requires a custom ITK filter (also possible, but more coding).

fedorov

fedorov

2013-02-13 04:21

developer   ~0007912

This might be relevant, need to investigate: http://old.nabble.com/Multilabel-dilation-td34995623.html

nicole

nicole

2013-02-15 11:05

administrator   ~0007959

It seems like we could use the slice intersection width parameter being added to the vtkMRMLDisplayNode so that we can support it as a configurable option for volumes and models and other displayable nodes rather than just for model nodes. SliceIntersectionVisibility is already defined there. Adding it as an integer denoting number of voxels in width that the intersection should be.

nicole

nicole

2013-02-15 12:21

administrator   ~0007963

On my github:
https://github.com/naucoin/Slicer/commit/3cdf2e92f8fb7fa041cbd1896e53027fb62a39cc

nicole

nicole

2013-03-22 12:25

administrator   ~0008209

svn 21832[1] adds the SliceIntersectionThickness to the vtkMRMLDisplayNode. The widget elements are disabled, please enable them when they're being used.

http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&revision=21832

pieper

pieper

2013-03-23 05:33

administrator   ~0008215

That's a great addition - thanks Nicole! Can you elaborate on "please enable them when they're being used." ? Is that something the user needs to do or is there still some programming to do?

pieper

pieper

2013-03-24 14:56

administrator   ~0008228

I just tried this and was able to set the width with python and the spin box updated (still grayed out) but the width did not change in the slice view. What else needs to be done on this?

nicole

nicole

2013-03-25 06:35

administrator   ~0008229

Enable the spin box when the updating of the width is done in the slice view (all I did was provide the variable to save the width and the widget to set it). My understanding was that Andrey was going to do the filter update.

fedorov

fedorov

2013-03-25 06:57

developer   ~0008230

Nicole, I thought you are adding model slice intersection thickness. Based on the comment 0007671 from Steve, no additional filter is needed, it should just pass the value to the actor.

pieper

pieper

2013-03-25 07:00

administrator   ~0008231

Okay - I see - this was actually a simple change so I went ahead and did it. This will be very useful for making image for publication and presentation.

Committed r21840

http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&revision=21840

nicole

nicole

2013-03-25 07:00

administrator   ~0008232

Oops, sorry, I didn't read the previous comments closely enough! Thanks Steve!

pieper

pieper

2013-03-25 07:01

administrator   ~0008233

Referring back to the earlier notes on this bug, we have now implemented the fix for (2), which was the model intersections.

We still need to work on (1) which was the outline width of the labels.

pieper

pieper

2013-08-28 12:19

administrator   ~0009670

This would be a perfect task for someone who wants to learn a little vtk coding - the fix is probably pretty simple but will require C++ and some testing.

lassoan

lassoan

2014-04-17 12:18

developer   ~0011603

There is a "Slice intersection thickness" display option in the model module. I think it does what is needed.

nicole

nicole

2014-04-17 13:49

administrator   ~0011606

I don't think the label map outline mode line thickness has been implemented yet though, just the model slice intersections.

fedorov

fedorov

2014-06-04 06:22

developer   ~0012014

Alireza, can you look into this issue of adding the capability to control line thickness for label outline?

This feature was specifically requested by Reinhard, and also by many other users. Thanks.

pieper

pieper

2014-06-04 06:33

administrator   ~0012016

I agree - this is a doable project and would be helpful for people. Alireza, let me know if you need suggestions on how to approach it. -Steve

lassoan

lassoan

2014-06-04 11:21

developer   ~0012021

The vtkImageLabelOutline filter is a simplified clone of VTK's vtkImageDilateErode3D filter.

The original vtkImageDilateErode3D filter contains a kernel size parameter, so I guess we could just use the original VTK filter or copy the kernel size parameter handling from vtkImageDilateErode3D to vtkImageLabelOutline.

pieper

pieper

2014-06-04 11:43

administrator   ~0012023

I like the suggestion from Andras. One complication is lightbox mode, where you get 'bleed' from adjacent slices due to the way the slices are extracted. It looks like setting the kernel size to 1 in the slice axis (z) would handle this case. Hopefully this turns out to be an easy fix!

http://www.vtk.org/doc/nightly/html/classvtkImageDilateErode3D.html

nicole

nicole

2015-04-21 15:10

administrator   ~0013016

I'm looking into implementing this as part of the Radiomics project.

nicole

nicole

2015-04-30 07:19

administrator   ~0013026

Topic for review (it seems to work not badly in a quick lightbox test):
https://github.com/naucoin/Slicer/tree/2267-Add-line-thickness-for-label-outline

I added using and setting the kernel size on the current filter, cued off of the SliceIntersectionThickness defined on the vtkMRMLDisplayNode (same variable as used with models). That's set by default to 1 in the node constructor.

Two related questions:
Do you want me to change the GUI spin box label to something other than:
Slice Intersections Thickness
And if we change the default for the label maps, will that still work with the models? Or do I need to add a new variable so we can have two different defaults? Or just have the subclasses set it as necessary?

nicole

nicole

2015-04-30 07:19

administrator   ~0013027

Responding to questions from Andrey via email:

The way the classes are set up, SliceIntersectionThickness is defined on the superclass, vtkMRMLDisplayNode, and it seems to be a general enough name to support an argument to use it in both the model display node and the label map volume display node for showing outlines on the slices. If we decide to update the API to separate the concepts, it would mean:

  • removing SliceIntersectionThickness and SliceIntersectionVisibility from the display node
    • double checking that it's not used by any other subclasses (like fiber bundle display)
  • adding ModelSliceIntersectionThickness and ModelSliceIntersectionVisibility to the model display node
    • updating uses for models
  • adding LabelOutlineThickness to the label map display node (the visibility is defined by a GUI check button right now, so possibly updating that to be a per volume setting rather than just a GUI setting - or deciding if we want to shift the model outline visibility to be a GUI concept rather than a per model concept)
    • updating uses for label volumes
  • update the testing macros
  • other?

I'm inclined to leave it as is, with setting the higher default for the label volume display node in that constructor, since the current changes resolve the reported feature request. I'm willing to do the work, but would rather get the GUI change checked in now and then update it later on the API side after resolving the questions above.

nicole

nicole

2015-04-30 11:49

administrator   ~0013028

Pull request:
https://github.com/Slicer/Slicer/pull/266

pieper

pieper

2015-04-30 12:08

administrator   ~0013029

I didn't try building it but the pull request looks good to me. I'd say go ahead and merge.

nicole

nicole

2015-04-30 12:47

administrator   ~0013030

Last edited: 2015-04-30 12:48

Andrey's building it to test, I didn't do extensive testing so I'd like to wait on his report to see if there are outstanding bugs.
And he posted that it works for him as I was posting this, so I'll get it merged.

nicole

nicole

2015-04-30 13:18

administrator   ~0013031

Fixes commited as
http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&revision=24203
https://github.com/Slicer/Slicer/commit/cd654faa89279694af12f5d7bbaa053281594881

fedorov

fedorov

2015-05-14 06:32

developer   ~0013047

Nicole, as discussed in the email thread, line thickness is not uniform over the countour. Can you update on the status?

2015-05-14 14:28

 

single-pixel.png (325,830 bytes)
single-pixel.png (325,830 bytes)
pieper

pieper

2015-05-14 14:29

administrator   ~0013050

There's clearly something wrong with the underlying filter. See attached image single-pixel.png

pieper

pieper

2015-05-14 14:53

administrator   ~0013052

Looks better to me now:

http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&revision=24256

pieper

pieper

2015-05-14 15:13

administrator   ~0013053

Another issue fixed in r24257. The outline really does look correct now.

People will love this feature ; )

nicole

nicole

2015-05-15 06:59

administrator   ~0013065

Wow, good catches, thanks!

pieper

pieper

2015-05-15 07:03

administrator   ~0013066

Thanks!

Alas on testing this morning I found some odd behavior--(if you zoom in and look at the boundaries of the view there are some asymmetries that are troubling. Particularly noticable when the outlines are very thick.

It seems to be related to the kernel size, kernel middle, and the neighborhood size. I'll hook up a debugger and check the assumptions.

I'll need to re-open the issue.

pieper

pieper

2015-05-15 07:03

administrator   ~0013067

See notes

pieper

pieper

2015-05-15 12:22

administrator   ~0013072

Okay, now this one is finally looking correct as of r24260. Pointer arithmetic going on in the guts of this one. I also cleaned up the style a bit to make things easier to debug.

fedorov

fedorov

2015-05-27 13:39

developer   ~0013108

Thanks for working on this Steve

Related Changesets

Slicer: 2145-support-for-installing-extension-from-file d6b09116

2013-03-22 16:23:48

naucoin

Details Diff
BUG: add a way to set the slice intersection thickness

Add the SliceIntersectionThickeness property to vtkMRMLDisplayNode and test it.
Add a label and spin box to the qMRMLDisplayNodeWidget but keep it disabled for now.

Issue 0002267



git-svn-id: http://svn.slicer.org/Slicer4/trunk@21832 3bd1e089-480b-0410-8dfb-8563597acbee
mod - Libs/MRML/Core/vtkMRMLCoreTestingMacros.h Diff File
mod - Libs/MRML/Core/vtkMRMLDisplayNode.cxx Diff File
mod - Libs/MRML/Core/vtkMRMLDisplayNode.h Diff File
mod - Libs/MRML/Widgets/Resources/UI/qMRMLDisplayNodeWidget.ui Diff File
mod - Libs/MRML/Widgets/Testing/qMRMLDisplayNodeWidgetEventTranslatorPlayerTest1.xml Diff File
mod - Libs/MRML/Widgets/qMRMLDisplayNodeWidget.cxx Diff File
mod - Libs/MRML/Widgets/qMRMLDisplayNodeWidget.h Diff File

Import 2017-06-07 23:51:09: master cd654faa

2015-04-30 16:50:50

naucoin

Details Diff
BUG: add outline thickness for label map outlines

Use the Outline setting on the image label outline filter to increase the
outline thickness.
The label outline value is used as the kernel size radius.
Added a GUI for the label outline integer, copied from the Models display GUI,
still using SliceIntersectionThickness as that's the display node setting that's
used by the filter.
Set the default slice intersection thickenss to 3 for label map volume
display nodes.

Issue 0002267

git-svn-id: http://svn.slicer.org/Slicer4/trunk@24203 3bd1e089-480b-0410-8dfb-8563597acbee
mod - Libs/MRML/Core/vtkMRMLLabelMapVolumeDisplayNode.cxx Diff File
mod - Libs/MRML/Logic/vtkImageLabelOutline.cxx Diff File
mod - Libs/MRML/Logic/vtkImageLabelOutline.h Diff File
mod - Libs/MRML/Logic/vtkMRMLSliceLayerLogic.cxx Diff File
mod - Modules/Loadable/Volumes/Widgets/Resources/UI/qSlicerLabelMapVolumeDisplayWidget.ui Diff File
mod - Modules/Loadable/Volumes/Widgets/qSlicerLabelMapVolumeDisplayWidget.cxx Diff File
mod - Modules/Loadable/Volumes/Widgets/qSlicerLabelMapVolumeDisplayWidget.h Diff File

Import 2017-06-07 23:51:09: master 44328a78

2015-05-05 15:40:32

naucoin

Details Diff
STYLE: update Volumes documentation to include outline thickness

Add a parameter description of the label outline thickness option
for label map volume display.

Issue 0002267


git-svn-id: http://svn.slicer.org/Slicer4/trunk@24213 3bd1e089-480b-0410-8dfb-8563597acbee
mod - Modules/Loadable/Volumes/Documentation/Volumes.xml Diff File

Import 2017-06-07 23:51:09: master 92d7129b

2015-05-14 18:26:08

pieper

Details Diff
BUG: 0002267 image label outline incorrect

There was a logic error in the outline kernel calculation
from a previous commit.

https://github.com/Slicer/Slicer/commit/cd654faa89279694af12f5d7bbaa053281594881

From: Steve Pieper <pieper@bwh.harvard.edu>

git-svn-id: http://svn.slicer.org/Slicer4/trunk@24256 3bd1e089-480b-0410-8dfb-8563597acbee
mod - Libs/MRML/Logic/vtkImageLabelOutline.cxx Diff File

Import 2017-06-07 23:51:09: master 1e52c8fb

2015-05-14 18:46:36

pieper

Details Diff
BUG: 0002267 - remove mask code from vtkImageLabelOutline

Since vtkImageLabelOutline inherits from vtkImageNeighborhoodFilter
it has a fixed size mask for defining 4-connect vs 8-connect
kernels. When we tried to use bigger kernels this caused overstepping
outside the mask which can lead to an access violation.

From: Steve Pieper <pieper@bwh.harvard.edu>

git-svn-id: http://svn.slicer.org/Slicer4/trunk@24257 3bd1e089-480b-0410-8dfb-8563597acbee
mod - Libs/MRML/Logic/vtkImageLabelOutline.cxx Diff File

Import 2017-06-07 23:51:09: master f99c9f00

2015-05-15 15:54:58

pieper

Details Diff
BUG: 0002267 fix symmetry of label outline thickness

There was a miscalculation of the array indices that caused
the lines to be wider and thicker on the left and top of a
label region.

From: Steve Pieper <pieper@isomics.com>

git-svn-id: http://svn.slicer.org/Slicer4/trunk@24260 3bd1e089-480b-0410-8dfb-8563597acbee
mod - Libs/MRML/Logic/vtkImageLabelOutline.cxx Diff File

Issue History

Date Modified Username Field Change
2012-06-26 21:07 inorton New Issue
2012-06-26 21:08 inorton Relationship added related to 0001536
2012-08-20 07:30 nicole Assigned To => nicole
2012-08-20 07:30 nicole Status new => assigned
2012-08-20 10:35 nicole Target Version => Slicer 4.3.0
2013-01-14 17:23 fedorov Note Added: 0007668
2013-01-14 17:51 fedorov Note Added: 0007669
2013-01-15 03:03 pieper Note Added: 0007671
2013-01-15 15:31 fedorov Note Added: 0007678
2013-01-16 02:33 pieper Note Added: 0007680
2013-01-16 03:43 fedorov Note Added: 0007681
2013-01-16 04:02 pieper Note Added: 0007682
2013-02-13 04:18 finetjul Relationship added related to 0002946
2013-02-13 04:21 fedorov Note Added: 0007912
2013-02-15 11:05 nicole Note Added: 0007959
2013-02-15 12:21 nicole Note Added: 0007963
2013-03-12 09:06 pieper Relationship added child of 0003003
2013-03-22 12:24 nicole Assigned To nicole => fedorov
2013-03-22 12:25 nicole Note Added: 0008209
2013-03-23 05:33 pieper Note Added: 0008215
2013-03-24 14:56 pieper Note Added: 0008228
2013-03-25 06:35 nicole Note Added: 0008229
2013-03-25 06:57 fedorov Note Added: 0008230
2013-03-25 07:00 pieper Note Added: 0008231
2013-03-25 07:00 nicole Note Added: 0008232
2013-03-25 07:01 pieper Note Added: 0008233
2013-08-28 12:13 pieper Target Version Slicer 4.3.0 => Slicer 4.4.0
2013-08-28 12:18 pieper Assigned To fedorov =>
2013-08-28 12:18 pieper Tag Attached: I-want-to-contribute
2013-08-28 12:19 pieper Note Added: 0009670
2014-03-06 08:47 nicole Status assigned => new
2014-04-17 12:18 lassoan Note Added: 0011603
2014-04-17 12:18 lassoan Status new => resolved
2014-04-17 12:18 lassoan Resolution open => fixed
2014-04-17 12:18 lassoan Assigned To => lassoan
2014-04-17 13:49 nicole Note Added: 0011606
2014-05-12 23:20 jcfr Tag Renamed I-want-to-contribute => help-wanted
2014-06-04 06:22 fedorov Note Added: 0012014
2014-06-04 06:22 fedorov Assigned To lassoan => mehrtash
2014-06-04 06:22 fedorov Status resolved => acknowledged
2014-06-04 06:33 pieper Note Added: 0012016
2014-06-04 11:21 lassoan Note Added: 0012021
2014-06-04 11:43 pieper Note Added: 0012023
2014-07-29 11:55 jcfr Target Version Slicer 4.4.0 => Slicer 4.5.0-1
2015-04-21 15:10 nicole Status acknowledged => assigned
2015-04-21 15:10 nicole Assigned To mehrtash => nicole
2015-04-21 15:10 nicole Note Added: 0013016
2015-04-30 07:19 nicole Note Added: 0013026
2015-04-30 07:19 nicole Note Added: 0013027
2015-04-30 11:49 nicole Note Added: 0013028
2015-04-30 12:08 pieper Note Added: 0013029
2015-04-30 12:47 nicole Note Added: 0013030
2015-04-30 12:48 nicole Note Edited: 0013030
2015-04-30 13:18 nicole Note Added: 0013031
2015-04-30 13:18 nicole Status assigned => resolved
2015-04-30 13:18 nicole Fixed in Version => Slicer 4.4.1
2015-05-14 06:32 fedorov Note Added: 0013047
2015-05-14 06:32 fedorov Status resolved => feedback
2015-05-14 06:32 fedorov Resolution fixed => reopened
2015-05-14 14:28 pieper File Added: single-pixel.png
2015-05-14 14:29 pieper Note Added: 0013050
2015-05-14 14:53 pieper Note Added: 0013052
2015-05-14 14:53 pieper Status feedback => resolved
2015-05-14 14:53 pieper Resolution reopened => fixed
2015-05-14 15:13 pieper Note Added: 0013053
2015-05-15 06:59 nicole Note Added: 0013065
2015-05-15 07:03 pieper Note Added: 0013066
2015-05-15 07:03 pieper Note Added: 0013067
2015-05-15 07:03 pieper Status resolved => feedback
2015-05-15 07:03 pieper Resolution fixed => reopened
2015-05-15 12:22 pieper Note Added: 0013072
2015-05-15 12:22 pieper Status feedback => resolved
2015-05-15 12:22 pieper Resolution reopened => fixed
2015-05-27 13:30 nicole Relationship added related to 0003980
2015-05-27 13:39 fedorov Note Added: 0013108
2015-07-10 09:46 fedorov Status resolved => closed
2015-09-09 08:29 jcfr Fixed in Version Slicer 4.4.1 => Slicer 4.5.0-1
2017-06-07 23:27 Changeset attached => Slicer 2145-support-for-installing-extension-from-file d6b09116
2017-06-10 08:51 pieper Changeset attached => Slicer master f99c9f00
2017-06-10 08:51 pieper Changeset attached => Slicer master 1e52c8fb
2017-06-10 08:51 pieper Changeset attached => Slicer master 92d7129b
2017-06-10 08:51 Changeset attached => Slicer master 44328a78
2017-06-10 08:51 Changeset attached => Slicer master cd654faa