View Issue Details

IDProjectCategoryView StatusLast Update
0001910Slicer4Core: CLI infrastructurepublic2017-06-07 23:27
Reporteralmar Assigned Tonicole  
PrioritynormalSeveritymajorReproducibilitysometimes
Status closedResolutionfixed 
Product VersionSlicer 4.1.0 
Target VersionSlicer 4.3.0Fixed in VersionSlicer 4.3.0 
Summary0001910: Problem with fiducial registration
Description

Sometimes when you try to register using fiducials the module gives an faulty registration matrix. Restarting slicer and importing the fiducials in a new scene solves the problem then. Also sometimes the module clears all the input fields when running it, without actually calculating an outcome.

TagsNo tags attached.

Relationships

related to 0003345 closednicole CLI point parameter for markups likely doesn't respect multiple=false attribute. 

Activities

nicole

nicole

2012-08-20 07:49

administrator   ~0005572

Casey: are you available to work on this bug? If not, can Dominik take it?

caseygoodlett

caseygoodlett

2012-08-20 11:32

developer   ~0005621

If Dominik can take this that would be great.

Thank you

jcfr

jcfr

2013-08-02 08:44

administrator   ~0009360

@Dominik: Could you have a look at this in the coming week ? If not we will re-target for 4.4 release. Thanks

pieper

pieper

2013-08-28 13:50

administrator   ~0009686

I could not replicate the reported issue about the fault registration matrix or the issue with clearing the inputs.

I did discover a new issue with the markups CLI interface that I will investigate further.

pieper

pieper

2013-08-28 14:35

administrator   ~0009687

Before the markups were merged [1], the fiducial registration was working well for me (tested on a version of slicer nightly from June 19 2013), so I think the original issue has been fixed.

However, now the issue is that the WriteCLI method [2] is returning all fiducials in a markup list in a single string. So the command line looks right, but actually each command line argument should be a different string in the commandLineAsString vector of strings. If you look at the implementations of the two methods [3] you can see the difference.

If I print the arguments from inside the CLI module like this:

for (int i = 0; i < argc; i++)
{
fprintf(stderr, "%d: %s\n", i, argv[i]);
}

PARSE_ARGS;

The output is:

0: /Users/pieper/slicer4/latest/Slicer-superbuild/Slicer-build/lib/Slicer-4.2/cli-modules/FiducialRegistration
1: --returnparameterfile
2: /var/folders/5g/8696sbjd1blch9pwpqwzq8c40000gn/T/Slicer/14757_VnlbfpvsqE.params
3: --fixedLandmarks 13.6256,62.2038,0 --fixedLandmarks 46.8009,10.6635,0 --fixedLandmarks -36.7299,-10.0711,0
4: --movingLandmarks 0,12.7069,56.1466 --movingLandmarks 0,35.7565,-32.5059 --movingLandmarks 0,-79.4917,-40.1891
5: --saveTransform
6: /var/folders/5g/8696sbjd1blch9pwpqwzq8c40000gn/T/Slicer/BEHFH_vtkMRMLLinearTransformNodeE.txt
7: --transformType
8: Rigid

I would say the right solution for this is to refactor a bit and make the signature of WriteCLI accept a vector of strings as the first argument and then it should push back strings onto that list to represent the command line arguments of the node.

[1] https://github.com/Slicer/Slicer/commit/f834581be82c1a09d2e74b146294965e696faa9d

[2] https://github.com/Slicer/Slicer/blob/master/Modules/Loadable/Markups/MRML/vtkMRMLMarkupsNode.cxx#L1265

[3] https://github.com/Slicer/Slicer/blob/master/Base/QTCLI/vtkSlicerCLIModuleLogic.cxx#L1410-1454

nicole

nicole

2013-08-29 09:29

administrator   ~0009701

From the mailing list, from Brad:
Regarding the CLI interface, I was looking at that to see how a single point was handled there as an example, when the multiple xml attribute was false:

https://github.com/Slicer/Slicer/blob/master/Base/QTCLI/vtkSlicerCLIModuleLogic.cxx#L1410

I didn't see how the marksups WriteCLI method even get's this variable. Does it pass all point to in the Markups node? or did I miss something?

Should be low impact enough while refactoring for this bug to add a singlePoint flag to WriteCLI.

nicole

nicole

2013-08-29 13:03

administrator   ~0009710

Proposed fix:
https://github.com/naucoin/Slicer/commit/825be11d9b1688f814d2ca4a3a39fcc4c3bc051b

jcfr

jcfr

2013-08-29 18:46

administrator   ~0009715

Tested on Ubuntu 10.04 - Here is the output after I added the debug statement in the FiducialRegistration.cxx:

slicer:0x7fdcb22d83a0 --processinformationaddress 0x765d850 --returnparameterfile /tmp/Slicer2/28553_f1OVqjoHRQ.params --fixedLandmarks -25.7469,-9.46105,-10.2143 --fixedLandmarks 6.6209,-44.7714,-10.2143 --fixedLandmarks -35.7515,37.0309,-10.2143 --movingLandmarks -25.7469,-9.46105,-10.2143 --movingLandmarks 6.6209,-44.7714,-10.2143 --movingLandmarks -35.7515,37.0309,-10.2143 --saveTransform /tmp/Slicer2/CIFFD_vtkMRMLLinearTransformNodeE.txt --transformType Rigid

0: slicer:0x7fdcb22d83a0
1: --processinformationaddress
2: 0x765d850
3: --returnparameterfile
4: /tmp/Slicer2/28553_f1OVqjoHRQ.params
5: --fixedLandmarks -25.7469,-9.46105,-10.2143
6: --fixedLandmarks 6.6209,-44.7714,-10.2143
7: --fixedLandmarks -35.7515,37.0309,-10.2143
8: --movingLandmarks -25.7469,-9.46105,-10.2143
9: --movingLandmarks 6.6209,-44.7714,-10.2143
10: --movingLandmarks -35.7515,37.0309,-10.2143
11: --saveTransform
12: /tmp/Slicer2/CIFFD_vtkMRMLLinearTransformNodeE.txt
13: --transformType
14: Rigid

nicole

nicole

2013-08-30 06:52

administrator   ~0009721

Last edited: 2013-08-30 07:47

Should the flag and the value should be on separate lines? When I put in the debugging statement and run the test I get:

EDIT (Jc): Having one argument per line is right

475: 0: ModuleEntryPoint
475: 1: --returnparameterfile
475: 2: /Users/nicole/Slicer4/Slicer-build-Summer2013PW/Slicer-build/Testing/Temporary/FiducialRegistration.params
475: 3: --fixedLandmarks
475: 4: 37.5615,82.3156,0
475: 5: --fixedLandmarks
475: 6: -26.373,81.5164,0
475: 7: --fixedLandmarks
475: 8: -2.39754,-21.5779,0
475: 9: --movingLandmarks
475: 10: 39.959,59.9385,30
475: 11: --movingLandmarks
475: 12: -24.7746,62.3361,30
475: 13: --movingLandmarks
475: 14: 0.79918,-52.7459,33.75
475: 15: --saveTransform
475: 16: /Users/nicole/Slicer4/Slicer-build-Summer2013PW/Slicer-build/Testing/Temporary/FiducialRegistration_vtkMRMLLinearTransformNodeE.txt
475: 17: --transformType
475: 18: Rigid

While from the GUI I get the same as JC posted:
0: slicer:0x13453b570
1: --processinformationaddress
2: 0x7fc71c4af490
3: --returnparameterfile
4: /var/folders/d3/kqchv64d52b96rqq1jw9d0ch0000gn/T/Slicer/2787_ynMSKQHXWn.params
5: --fixedLandmarks 259.367,-1.69371,68.1582
6: --fixedLandmarks 271.769,0.943111,-20.4029
7: --fixedLandmarks 221.251,4.89234,-40.0864
8: --movingLandmarks -152.626,-10.9951,71.0258
9: --movingLandmarks -149.723,-2.77275,24.065
10: --movingLandmarks -168.75,5.82482,-23.818
11: --saveTransform
12: /var/folders/d3/kqchv64d52b96rqq1jw9d0ch0000gn/T/Slicer/CHIH_vtkMRMLLinearTransformNodeE.txt
13: --transformType
14: Rigid

Putting a print statement after the PARSE_ARGS command to print out the fixed landmarks (just the x coord), running the test I get valid points:
475: fixedLandmarks size: 3
475: fixedLandmarks: 0: 37.5615
475: fixedLandmarks: 1: -26.373
475: fixedLandmarks: 2: -2.39754

Running from the GUI, I also get valid points:
fixedLandmarks size: 3
fixedLandmarks: 0: 159.244
fixedLandmarks: 1: 156.383
fixedLandmarks: 2: 155.43

Looks like PARSE_ARGS is smart enough to deal with both cases, but in vtkSlicerCLIModuleLogic, it does add the flag and the parameter as separate strings. I'm updating the WriteCLI implementations.

nicole

nicole

2013-08-30 07:28

administrator   ~0009724

Rats, wasn't thinking and squashed the two commits so I lost comments on the original one, sorry! Here's the updated topic:
https://github.com/naucoin/Slicer/commit/4de1afa86a9659ebeaccfdd3eb7c5dcfd2387c87

jcfr

jcfr

2013-08-30 07:49

administrator   ~0009727

Where did you put your debug statement to get the two output reported in note c9721 ?

nicole

nicole

2013-08-30 07:55

administrator   ~0009728

Before and after PARSE_ARGS:
int main(int argc, char* argv[])
{
for (int i = 0; i < argc; i++)
{
fprintf(stderr, "%d: %s\n", i, argv[i]);
}

PARSE_ARGS;

for (int i = 0; i < fixedLandmarks.size(); ++i)
{
fprintf(stderr, "fixedLandmarks: %d: %g %g %g\n", i,
fixedLandmarks[i][0],
fixedLandmarks[i][1],
fixedLandmarks[i][2]);
}
double invalidRMS = -1;

nicole

nicole

2013-08-30 10:42

administrator   ~0009730

Fixed in svn 22369:
http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&amp;revision=22369

jcfr

jcfr

2014-03-06 05:00

administrator   ~0010848

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

Related Changesets

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

2013-08-30 14:41:01

naucoin

Details Diff
BUG: update WriteCLI to fill a vector of strings, honor mutiple = false

Because Markups define multiple markups (with potentially multiple points) in one node,
it was writting multiple instances of a string + coordinates to the string stream passed
in to WriteCLI. This causes a problem for the parsing of the arguments in CLIs such as
FiducialRegistration which needed a separate string for each point.
With this change, the markup points are writen into a vector of strings, one string
for each point in each Markup.
Added the multipleFlag to be passed to WriteCLI, and if it's false, only write the
first selected markup to the output vector. If that markup has multiple points, it will
write all of those points.
Updated the Annotation control point to use the new WriteCLI signature, but because
of the way the points are written, it will only write the first point in a multi point
annotation (such as a ruler) if multiple is false, so it ignores it and the
CLI module logic takes care of ensuring that only the first child in an
annotation hierachy is written out. Write out a warning message if this is the case.
Added a test for FiducialRegistration, updated the Markups node test 1 to test the single point flag.
Removed trailing white spaces.

Issue 0001910 0003345 0003340



git-svn-id: http://svn.slicer.org/Slicer4/trunk@22369 3bd1e089-480b-0410-8dfb-8563597acbee
mod - Base/QTCLI/vtkSlicerCLIModuleLogic.cxx Diff File
mod - Libs/MRML/Core/vtkMRMLDisplayableNode.h Diff File
mod - Modules/CLI/FiducialRegistration/FiducialRegistration.cxx Diff File
mod - Modules/CLI/FiducialRegistration/Testing/CMakeLists.txt Diff File
add - Modules/CLI/FiducialRegistration/Testing/FiducialRegistrationTest.cxx Diff File
mod - Modules/Loadable/Annotations/MRML/vtkMRMLAnnotationControlPointsNode.cxx Diff File
mod - Modules/Loadable/Annotations/MRML/vtkMRMLAnnotationControlPointsNode.h Diff File
mod - Modules/Loadable/Markups/MRML/vtkMRMLMarkupsNode.cxx Diff File
mod - Modules/Loadable/Markups/MRML/vtkMRMLMarkupsNode.h Diff File
mod - Modules/Loadable/Markups/Testing/Cxx/vtkMRMLMarkupsNodeTest1.cxx Diff File

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

2013-09-03 18:52:59

naucoin

Details Diff
BUG: fix failing test

Fix the write CLI test for the markpus node by adjusting the expected number
of arguments to be 2 times the number of points, as the flag is written
separately now.

Related to fixes for issue 0001910


git-svn-id: http://svn.slicer.org/Slicer4/trunk@22399 3bd1e089-480b-0410-8dfb-8563597acbee
mod - Modules/Loadable/Markups/Testing/Cxx/vtkMRMLMarkupsNodeTest1.cxx Diff File

Issue History

Date Modified Username Field Change
2012-04-16 23:11 almar New Issue
2012-08-20 07:49 nicole Assigned To => caseygoodlett
2012-08-20 07:49 nicole Status new => assigned
2012-08-20 07:49 nicole Target Version => Slicer 4.3.0
2012-08-20 07:49 nicole Note Added: 0005572
2012-08-20 11:32 caseygoodlett Note Added: 0005621
2013-08-02 08:44 jcfr Assigned To caseygoodlett => DMeier
2013-08-02 08:44 jcfr Note Added: 0009360
2013-08-27 12:21 jcfr Assigned To DMeier => pieper
2013-08-28 13:50 pieper Note Added: 0009686
2013-08-28 14:23 pieper Assigned To pieper => nicole
2013-08-28 14:35 pieper Note Added: 0009687
2013-08-29 09:29 nicole Note Added: 0009701
2013-08-29 11:16 blowekamp Relationship added related to 0003345
2013-08-29 13:03 nicole Note Added: 0009710
2013-08-29 18:46 jcfr Note Added: 0009715
2013-08-30 06:52 nicole Note Added: 0009721
2013-08-30 07:03 nicole Note Edited: 0009721
2013-08-30 07:13 nicole Note Edited: 0009721
2013-08-30 07:28 nicole Note Added: 0009724
2013-08-30 07:47 jcfr Note Edited: 0009721
2013-08-30 07:49 jcfr Note Added: 0009727
2013-08-30 07:55 nicole Note Added: 0009728
2013-08-30 10:42 nicole Note Added: 0009730
2013-08-30 10:42 nicole Status assigned => resolved
2013-08-30 10:42 nicole Fixed in Version => Slicer 4.3.0
2013-08-30 10:42 nicole Resolution open => fixed
2014-03-06 05:00 jcfr Note Added: 0010848
2014-03-06 05:02 jcfr Status resolved => closed
2017-06-07 23:27 Changeset attached => Slicer 2145-support-for-installing-extension-from-file b4c3236c
2017-06-07 23:27 Changeset attached => Slicer 2145-support-for-installing-extension-from-file 20882931