View Issue Details

IDProjectCategoryView StatusLast Update
0004139Slicer4Module BRAINSpublic2018-03-02 11:06
Reportercriskross Assigned Tojcfr  
PriorityhighSeveritycrashReproducibilityalways
Status closedResolutionfixed 
PlatformWindows and MAC OS XOSOS Version
Product VersionSlicer 4.5.0-1 
Target VersionSlicer 4.6.0Fixed in VersionSlicer 4.6.0 
Summary0004139: Slicer crashes while doing registration using BrainsFit and creating transform output
Description

When executing registration by using BrainsFit, slicer crashes

Steps To Reproduce

download sample data (MRBrainTumor1, MRBrainTumor2)
go to General Registration module
select fixed and moving volume
create new output transform (Linear)
create new output volume
select rigid registration phase
apply

Additional Information

=============================== ITKv4 Registration: Starting Transform Estimations for Rigid(1 of 1).===============================

0 -1.65112 [ 0.000149534 -5.78744e-05 0.000330727 0.0241069 -0.0209527 -0.0384617 ]
1 -1.64384 [ -0.000462023 0.000198653 -0.000755735 0.00826481 -0.011392 -0.0218442 ]
2 -1.63207 [ 0.00373025 -0.00199081 0.00529977 0.0146312 0.000250389 -0.00725763 ]
3 -1.30567 [ 9.06967e-05 0.000235563 0.00120716 0.0111653 -0.000833774 -0.00906031 ]
4 -1.62178 [ -0.00012783 3.22027e-06 -0.00156953 0.000154057 2.97351e-05 -0.00732568 ]
5 -1.605 [ 1.78733e-05 -0.000162583 0.000261651 0.00508012 -0.00105589 -0.00722583 ]
6 -1.64893 [ -3.12422e-05 0.000267151 -0.000365168 0.00251964 -0.00149182 -0.00638941 ]
7 -1.64587 [ -4.90179e-08 -8.15117e-05 7.88412e-05 0.00352411 -0.00180327 -0.00615128 ]
Stop condition from optimizer.RegularStepGradientDescentOptimizerv4: Step too small after 8 iterations. Current step (0.00078125) is less than minimum step (0.001).

General Registration (BRAINS) completed without errors

CreateVTKTransformFromITK - SetVTKLinearTransformFromITK conversionSuccess:0
Segmentation fault: 11

TagsNo tags attached.

Activities

pieper

pieper

2016-01-26 16:32

administrator   ~0013766

Is this in the nightly or in the 4.5 release (or both?)

criskross

criskross

2016-01-26 16:43

developer   ~0013768

Actually is in the nightly. There was no selector for nightly. Last stable version of Slicer works fine

jcfr

jcfr

2016-01-26 16:44

administrator   ~0013769

Regression most likely introduced by the recent update of ITK/BRAINS.

jcfr

jcfr

2016-01-26 17:26

administrator   ~0013770

Last edited: 2016-01-26 17:26

View 3 revisions

I was able to reproduce the problem.
Note: I edited the description to provide more details.

jcfr

jcfr

2016-01-26 22:35

administrator   ~0013779

To reproduce, open the python interpreter and copy the following:

<pre>
import SampleData
from SampleData import SampleDataLogic
logic = SampleDataLogic()

fixed = logic.downloadMRBrainTumor1()
moving = logic.downloadMRBrainTumor2()

slicer.util.selectModule("BRAINSFit")

widget = slicer.modules.brainsfit.widgetRepresentation()
cmdLineNode = widget.currentCommandLineModuleNode()

cmdLineNode.SetParameterAsNode("fixedVolume", fixed)
cmdLineNode.SetParameterAsNode("movingVolume", moving)

outputTransform = slicer.vtkMRMLLinearTransformNode()
slicer.mrmlScene.AddNode(outputTransform)

cmdLineNode.SetParameterAsNode("linearTransform", outputTransform)

outputVolume = slicer.vtkMRMLScalarVolumeNode()
slicer.mrmlScene.AddNode(outputVolume)

cmdLineNode.SetParameterAsNode("outputVolume", outputVolume)

cmdLineNode.SetParameterAsBool("useRigid", True)

widget.apply()
</pre>

jcfr

jcfr

2016-01-27 00:40

administrator   ~0013784

Commit r24875 introduced the regression.

See http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&amp;revision=24875

Will work on a fix later.

jcfr

jcfr

2016-01-27 00:42

administrator   ~0013785

Last edited: 2016-01-27 00:42

View 2 revisions

Without this commit .. i get the following output:

Note: I added few extra print statements

SetVTKBSplineParametersFromITKGeneric - bsplineItk NULL
SetVTKBSplineParametersFromITKGeneric - bsplineItk NULL
SetVTKLinearTransformFromITK - transformItk_LPS:VersorRigid3DTransform
SetVTKLinearTransformFromITK - dlt:VersorRigid3DTransform
CreateVTKTransformFromITK - SetVTKLinearTransformFromITK conversionSuccess:1

jcfr

jcfr

2016-01-27 00:44

administrator   ~0013786

The issue is that the corresponding static cast didn't account for all type of linear transform.

jcfr

jcfr

2016-01-27 22:31

administrator   ~0013790

Issue fixed in the following topic: https://github.com/jcfr/Slicer/tree/4139-fix-crash-vtkITKTransformConverter

Now integrating the python snipped in a test and will integrate.

jcfr

jcfr

2016-01-27 23:23

administrator   ~0013791

Fix integrated in r24902
See http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&amp;revision=24902

For future reference, a simpler version of the python code has been
used in the associated self-test:

<pre>
import SampleData
from SampleData import SampleDataLogic
sampleDatalogic = SampleDataLogic()

fixed = sampleDatalogic.downloadMRBrainTumor1()
moving = sampleDatalogic.downloadMRBrainTumor2()

outputTransform = slicer.vtkMRMLLinearTransformNode()
slicer.mrmlScene.AddNode(outputTransform)

outputVolume = slicer.vtkMRMLScalarVolumeNode()
slicer.mrmlScene.AddNode(outputVolume)

parameters = {
'fixedVolume' : fixed,
'movingVolume' : moving,
'linearTransform' : outputTransform,
'outputVolume' : outputVolume,
'useRigid' : True
}
cmdLineNode = slicer.cli.runSync(slicer.modules.brainsfit, parameters=parameters)
</pre>

Related Changesets

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

2016-01-27 23:21:57

jcfr

Details Diff
BUG: Fix registration addressing regression in vtkITKTransformConverter.

Fixes 0004139

This commit allows BRAINSFit registration to complete by addressing
a regression introduced in r24875 (BUG: Fix transform tests by not
using dynamic_cast in vtkITKTransformConverter)

It basically ensure the comparison of transform name includes
all derived type associated with itk::MatrixOffsetTransformBase

The python code allowing to reproduce the issue is reported below
and has been integrated into a self-test named "BRAINSFitRigidRegistrationCrashIssue4139"

8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---
import SampleData
from SampleData import SampleDataLogic
sampleDatalogic = SampleDataLogic()

fixed = sampleDatalogic.downloadMRBrainTumor1()
moving = sampleDatalogic.downloadMRBrainTumor2()

outputTransform = slicer.vtkMRMLLinearTransformNode()
slicer.mrmlScene.AddNode(outputTransform)

outputVolume = slicer.vtkMRMLScalarVolumeNode()
slicer.mrmlScene.AddNode(outputVolume)

parameters = {
'fixedVolume' : fixed,
'movingVolume' : moving,
'linearTransform' : outputTransform,
'outputVolume' : outputVolume,
'useRigid' : True
}
cmdLineNode = slicer.cli.runSync(slicer.modules.brainsfit, parameters=parameters)
8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---

Reported-by: Christian Herz <christian.herz@mevis.fraunhofer.de>
Suggested-by: Hans Johnson <hans-johnson@uiowa.edu>

git-svn-id: http://svn.slicer.org/Slicer4/trunk@24902 3bd1e089-480b-0410-8dfb-8563597acbee
add - Applications/SlicerApp/Testing/Python/BRAINSFitRigidRegistrationCrashIssue4139.py Diff File
mod - Applications/SlicerApp/Testing/Python/CMakeLists.txt Diff File
mod - Libs/MRML/Core/vtkITKTransformConverter.h Diff File

Issue History

Date Modified Username Field Change
2016-01-26 16:07 criskross New Issue
2016-01-26 16:07 criskross Status new => assigned
2016-01-26 16:07 criskross Assigned To => hjmjohnson
2016-01-26 16:32 pieper Note Added: 0013766
2016-01-26 16:41 jcfr Assigned To hjmjohnson => jcfr
2016-01-26 16:41 jcfr Target Version => Slicer 4.6.0
2016-01-26 16:43 criskross Note Added: 0013768
2016-01-26 16:44 jcfr Note Added: 0013769
2016-01-26 17:26 jcfr Note Added: 0013770
2016-01-26 17:26 jcfr Note Edited: 0013770 View Revisions
2016-01-26 17:26 jcfr Note Edited: 0013770 View Revisions
2016-01-26 17:28 jcfr Steps to Reproduce Updated View Revisions
2016-01-26 17:28 jcfr Steps to Reproduce Updated View Revisions
2016-01-26 22:35 jcfr Note Added: 0013779
2016-01-27 00:40 jcfr Note Added: 0013784
2016-01-27 00:42 jcfr Note Added: 0013785
2016-01-27 00:42 jcfr Note Edited: 0013785 View Revisions
2016-01-27 00:44 jcfr Note Added: 0013786
2016-01-27 22:31 jcfr Note Added: 0013790
2016-01-27 23:23 jcfr Note Added: 0013791
2016-01-27 23:23 jcfr Status assigned => resolved
2016-01-27 23:23 jcfr Fixed in Version => Slicer 4.6.0
2016-01-27 23:23 jcfr Resolution open => fixed
2016-01-28 14:47 pieper Relationship added duplicate of 0004141
2016-01-29 14:29 pieper Relationship deleted 0004141
2017-06-10 08:51 jcfr Changeset attached => Slicer master 7e41e8af
2018-03-02 11:06 jcfr Status resolved => closed