View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0004065 | Slicer4 | Module SimpleFilters | public | 2015-10-15 06:39 | 2018-03-02 11:06 |
Reporter | llaurenn | Assigned To | blowekamp | ||
Priority | normal | Severity | crash | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Product Version | Slicer 4.4.0 | ||||
Target Version | Slicer 4.6.0 | Fixed in Version | Slicer 4.5.0-1 | ||
Summary | 0004065: Crash when trying to apply simple itk filter after changing some parameters | ||||
Description | I implemented IsolatedWatershedImageFilter (simple itk filter in filtering module). | ||||
Tags | No tags attached. | ||||
I was able to reproduce the problem using r24686 |
|
I am trying this on the 4.4.0-2015-10-30 nightly and have not been able to reproduce. When the filter is executed, there should be python code printed to the console about what is being run. Please include that so that I can easily determine if the problem lies in pure SimpleITK/ITK or if its with the GUI. Additionally, I noticed that the default Seeds are all zeros, this may be a problem in ITK if they are both the same. An error should be generated for this case. Are you using the default seeds? |
|
Hi Brad, The following snippet allow to reproduce the crash: 8<----8<----8<----8<----8<----8<----8<----8<----8<----8<----8<---- slicer.util.moduleSelector().selectModule('SimpleFilters') filterName = 'IsolatedWatershedImageFilter' slicer.modules.SimpleFiltersWidget.filterParameters.filter.SetThreshold(1) slicer.modules.SimpleFiltersWidget.applyButton.click() Associated output: myFilter = IsolatedWatershedImageFilter() And as you expected, the seeds are both set to (0, 0, 0) Side remarks: Setting value on the filter using: slicer.modules.SimpleFiltersWidget.filterParameters.filter.SetThreshold(1) doesn't update the UI. |
|
I have note confirmed this is a problem in pure SimpleITK and likely in ITK. I will implement a check to the error condition in ITK. Will also look into the GUI update issue. Thank you for the Slicer code to do use the GUI; I should integrate some of that into a test. |
|
Here is the commit to resolve the segmentation fault in ITK:http://review.source.kitware.com/#/c/20348/1 The cause is that the Threshold and the UpperValueLimit produced and empty range (1,1). From the ITK Doxygen: The user supplies a Watershed threshold. The algorithm uses a binary search to adjust the upper waterlevel, starting at UpperValueLimit. UpperValueLimit defaults to the 1.0. Unfortunately the Simple Filters modules doesn't know about the tight interaction between parameters and what a good step size should be; this module is a little simplistic in this regards. |
|
Hi Brad, Thanks for the patch. I cherry-picked [1], then rebuild ITK, SimpleITK and Slicer. But there are still a seg fault. I attached the backtrace to the issue. |
|
2015-11-03 12:47
|
|
With the proposed ITK patch the following SimpleITK code now runs: In [1]: import SimpleITK as sitk In [2]: img = sitk.Image(512,512,sitk.sitkFloat32) In [3]: myFilter = sitk.IsolatedWatershedImageFilter() In [4]: myFilter.SetDebug(False) In [5]: myFilter.SetIsolatedValueTolerance(0.001) In [6]: myFilter.SetNumberOfThreads(8) In [7]: myFilter.SetReplaceValue1(1) In [8]: myFilter.SetReplaceValue2(2) In [9]: myFilter.SetSeed1((0, 0, 0)) In [10]: myFilter.SetSeed2((0, 0, 0)) In [11]: myFilter.SetThreshold(1.0) In [12]: myFilter.SetUpperValueLimit(1.0) In [13]: myFilter.Execute(img) |
|
Opps, test is still failing I had uncommitted changes effect the filter. |
|
Fixed in r24715 after backporting InsightSoftwareConsortium/ITK@abda78c Change-Id: I607a8fbbc49279f394fd14c241e4ef32c62a1820 See http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&revision=24715 Thanks Brad. It doesn't crash any more. Here is what I tried: (a) Select MRHead + leave all parameter to the default, click Apply. It seems to be Running fever. Clicking on Cancel go into Aborting mode. But it never finishes. (b) Select MRHead, threshold of 1, both seeds to 0,0,0. After 1 sec .. it fails with:
itk::ERROR: itk::watershed::SegmentTreeGenerator::MergeSegments:: An unexpected and fatal error has occurred. This is probably the result of overthresholding of the input image (c) Select MRHead, threshold at 0, one value of one seed at 5000. Click Apply. It fails immediately with: Exception thrown in SimpleITK IsolatedWatershedImageFilter_Execute: /home/jcfr/Projects/Slicer-Debug/ITKv4/Modules/Segmentation/Watersheds/include/itkIsolatedWatershedImageFilter.hxx:119: Possible tweaks: (1) A possible improvement could be to detect if seeds are very close within an epsilon and error out faster. Currently, it takes 1 or 2 seconds before reporting that . (2) The exception are not logged. It would probably make sense to also use "logging.error()" when an exception is intercepted. See http://wiki.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/Style_Guide#Logging (3) The two list of fiducial should be exclusive. I initially created one. Added two fiducials .. since they were in the same list ("F"), it ran the watershed with two seeds at the same location. Or may be the interface should detect that the same list has been selected and it it is the case ... take the first two value of the list. |
|
For reference: I created an "issue" to keep track of possible tweaks. |
|
Import 2017-06-07 23:51:09: master 0374ab49 2015-11-09 20:25:00 Details Diff |
BUG: Update ITK to fix segmentation fault in 2 filters. Fixes 0004065 This commit integrates fixes backported from the ITK release branch: $ git shortlog 0f346bf7..8989fda --no-merges Bradley Lowekamp (1): BUG: Fix segfault when with empty IsolatedWatershed Threshold range Mikhail Isakov (1): BUG: DiffusionTensor3DReconstruction segfault if no baseline image Tested-by: Jean-Christophe Fillion-Robin <jchris.fillionr@kitware.com> git-svn-id: http://svn.slicer.org/Slicer4/trunk@24715 3bd1e089-480b-0410-8dfb-8563597acbee |
||
mod - SuperBuild/External_ITKv4.cmake | Diff File |
Date Modified | Username | Field | Change |
---|---|---|---|
2015-10-15 06:39 | llaurenn | New Issue | |
2015-10-15 06:39 | llaurenn | Status | new => assigned |
2015-10-15 06:39 | llaurenn | Assigned To | => millerjv |
2015-11-02 13:12 | jcfr | Assigned To | millerjv => blowekamp |
2015-11-02 13:14 | jcfr | Category | Core: Command Line Modules (Modules/CLI) => Module SimpleFilters |
2015-11-02 13:14 | jcfr | Target Version | => Slicer 4.5.1 |
2015-11-02 13:15 | jcfr | Note Added: 0013502 | |
2015-11-03 04:22 | blowekamp | Note Added: 0013520 | |
2015-11-03 06:25 | jcfr | Note Added: 0013523 | |
2015-11-03 06:27 | blowekamp | Note Edited: 0013520 | |
2015-11-03 06:35 | blowekamp | Note Added: 0013524 | |
2015-11-03 12:15 | blowekamp | Note Added: 0013535 | |
2015-11-03 12:47 | jcfr | Note Added: 0013536 | |
2015-11-03 12:47 | jcfr | File Added: 4065-remaining-issue-with-ITK-patch-20348-1.png | |
2015-11-04 05:14 | blowekamp | Note Added: 0013554 | |
2015-11-04 06:42 | blowekamp | Note Added: 0013555 | |
2015-11-09 16:34 | jcfr | Note Added: 0013578 | |
2015-11-09 16:34 | jcfr | Status | assigned => resolved |
2015-11-09 16:34 | jcfr | Fixed in Version | => Slicer 4.5.0-1 |
2015-11-09 16:34 | jcfr | Resolution | open => fixed |
2015-11-09 16:39 | jcfr | Note Added: 0013579 | |
2015-11-09 16:40 | jcfr | Note Edited: 0013578 | |
2015-12-10 11:54 | nicole | Relationship added | related to 0004104 |
2016-10-13 01:28 | jcfr | Target Version | Slicer 4.5.1 => Slicer 4.6.0 |
2017-06-10 08:51 | jcfr | Changeset attached | => Slicer master 0374ab49 |
2018-03-02 11:06 | jcfr | Status | resolved => closed |