View Issue Details

IDProjectCategoryView StatusLast Update
0003524Slicer4Module Editorpublic2017-06-10 08:51
Reporterblowekamp Assigned Topieper  
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionfixed 
Product VersionSlicer 4.3.1 
Target VersionSlicer 4.4.0Fixed in VersionSlicer 4.4.0 
Summary0003524: Editor effects produce to output due to unexpected image
Description

Some times an editor effect will fail to execute and confuse users with only a error message in the log.

This is really confusing to my users here. And I have to go into the python console to fix things up.

I have seen two causes of this:

1) The label image is of an unexpected type, such as uint8, and the effect doesn't support it
2) The label image and primary image have slightly different spacing/origin/orientation

An example of case 1:
$img = sitk.GaborSource(sitk.sitkFloat32)
$sitkUtils.PushForeground(img,"I")
$sitkUtils.PushLabel(img>0,"L")

Load I, and L into editor and the ChangeIslandEffect produces the following error:

ERROR: In /Users/kitware/Dashboards/Nightly/Slicer4/Modules/Scripted/EditorLib/Logic/vtkImageConnectivity.cxx, line 855
vtkImageConnectivity (0x140cb11e0): Warning: Input scalars are type 3 instead of 4

An Example of case 2:
$ img = sitk.GaborSource(sitk.sitkFloat32)
$ sitkUtils.PushForeground(img,"I")
$ l = sitk.Image(img.GetSize(), sitk.sitkInt16)
$ l.CopyInformation(img)
$ l.SetSpacing([img.GetSpacing()[0]+1e-2, img.GetSpacing()[1], img.GetSpacing()[2]])
$ sitkUtils.PushLabel(l,"L2")

Then load I and L2 into the editor. Draw a couple of labels. Running Watersheds from markers produce the following ITK error:
File "/Users/blowekamp/Desktop/Slicer Nightly/Slicer-4.3.1-2013-12-05.app/Contents/lib/Python/lib/python2.7/site-packages/SimpleITK-0.7.1.post1-py2.7-macosx-10.6-x86_64.egg/SimpleITK.py", line 29285, in Execute
return _SimpleITK.MorphologicalWatershedFromMarkersImageFilter_Execute(self, *args)
RuntimeError: Exception thrown in SimpleITK MorphologicalWatershedFromMarkersImageFilter_Execute: /Users/kitware/Dashboards/Nightly/Slicer-build-64bits-QT4.8.5-PythonQt-With-Tcl-CLI-Release-nightly/ITKv4/Modules/Core/Common/include/itkImageToImageFilter.hxx:248:
itk::ERROR: MorphologicalWatershedFromMarkersImageFilter(0x140c24970): Inputs do not occupy the same physical space!
InputImage Spacing: [1.0000000e+00, 1.0000000e+00, 1.0000000e+00], InputImage_1 Spacing: [1.0100000e+00, 1.0000000e+00, 1.0000000e+00]
Tolerance: 1.0000000e-06

This type of change can in info can easily happened when saving to a file type which used test representation of floating point number.

Case 3: Image are different resolutions or regions. I haven't directly tried this recently, but I know some editor effect have segfaulted when the image don't match up.

=====
RECOMMENDATION
When the label image is loaded, a certain amount of validation should occur. An pop up error should be generated if the image are hopelessly in compatible. If the type is a little off or the meta-data is just a little off the editor should offer to fix those these.

TagsNo tags attached.

Activities

pieper

pieper

2013-12-11 11:33

administrator   ~0010426

Edited examples for easy cut/paste

img = sitk.GaborSource(sitk.sitkFloat32)
sitkUtils.PushForeground(img,"I")
sitkUtils.PushLabel(img>0,"L")

img = sitk.GaborSource(sitk.sitkFloat32)
sitkUtils.PushForeground(img,"I")
l = sitk.Image(img.GetSize(), sitk.sitkInt16)
l.CopyInformation(img)
l.SetSpacing([img.GetSpacing()[0]+1e-2, img.GetSpacing()[1], img.GetSpacing()[2]])
sitkUtils.PushLabel(l,"L2")

pieper

pieper

2013-12-11 11:54

administrator   ~0010427

Fixed in r22772.

commit 7d2b554b5ee30c110f0cf66ac8170abc653fa140
Author: pieper <pieper@3bd1e089-480b-0410-8dfb-8563597acbee>
Date: Wed Dec 11 21:52:13 2013 +0000

BUG: 0003524 check for valid images in Editor

This generates a warning for situations that are thought to be
invalid.  Since some tools may still be workable, we let the user
go ahead, but include some suggestions in the warnings about how
to fix the volumes.

http://na-mic.org/Bug/view.php?id=3524

git-svn-id: http://svn.slicer.org/Slicer4/trunk@22772 3bd1e089-480b-0410-8dfb-856359
jcfr

jcfr

2014-03-06 05:25

administrator   ~0011221

Closing resolved issues that have not been updated in more than 3 months

Related Changesets

Slicer: 2145-support-for-installing-extension-from-file 7d2b554b

2013-12-11 16:52:13

pieper

Details Diff
BUG: 0003524 check for valid images in Editor

This generates a warning for situations that are thought to be
invalid. Since some tools may still be workable, we let the user
go ahead, but include some suggestions in the warnings about how
to fix the volumes.

http://na-mic.org/Bug/view.php?id=3524

git-svn-id: http://svn.slicer.org/Slicer4/trunk@22772 3bd1e089-480b-0410-8dfb-8563597acbee
mod - Modules/Scripted/EditorLib/HelperBox.py Diff File

Import 2017-06-07 23:51:09: master 7d2b554b

2013-12-11 16:52:13

pieper

Details Diff
BUG: 0003524 check for valid images in Editor

This generates a warning for situations that are thought to be
invalid. Since some tools may still be workable, we let the user
go ahead, but include some suggestions in the warnings about how
to fix the volumes.

http://na-mic.org/Bug/view.php?id=3524

git-svn-id: http://svn.slicer.org/Slicer4/trunk@22772 3bd1e089-480b-0410-8dfb-8563597acbee
mod - Modules/Scripted/EditorLib/HelperBox.py Diff File

Issue History

Date Modified Username Field Change
2013-12-06 10:15 blowekamp New Issue
2013-12-06 10:15 blowekamp Status new => assigned
2013-12-06 10:15 blowekamp Assigned To => pieper
2013-12-06 10:27 jcfr Target Version => Slicer 4.4.0
2013-12-11 11:33 pieper Note Added: 0010426
2013-12-11 11:54 pieper Note Added: 0010427
2013-12-11 11:54 pieper Status assigned => resolved
2013-12-11 11:54 pieper Fixed in Version => Slicer 4.3.2
2013-12-11 11:54 pieper Resolution open => fixed
2014-03-06 05:25 jcfr Note Added: 0011221
2014-03-06 05:28 jcfr Status resolved => closed
2014-03-06 10:17 nicole Fixed in Version Slicer 4.3.2 => Slicer 4.4.0
2017-06-07 23:27 pieper Changeset attached => Slicer 2145-support-for-installing-extension-from-file 7d2b554b
2017-06-10 08:51 pieper Changeset attached => Slicer master 7d2b554b