View Issue Details

IDProjectCategoryView StatusLast Update
0002380Slicer4Core: Base Codepublic2014-03-06 05:55
Reporterspujol Assigned Tosankhesh  
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionfixed 
Product Version 
Target VersionSlicer 4.2.0Fixed in VersionSlicer 4.4.0 
Summary0002380: Transforms module issue: display of translation component when values exceed default max values
Description

I created the transform below:

#Insight Transform File V1.0

Transform 0

Transform: AffineTransform_double_3_3
Parameters: -1 -5.20417e-17 0 5.20417e-17 -1 -0 0 0 1 -264.36 -281.94 0
FixedParameters: 0 0 0

When I reload it in Slicer, Slicer displays the values of the LR and PA translation components as 200, which is the max value by default and doesn't correspond to the actual values on disk.
(200 is the maximum default value set-up in the module)

Steps To Reproduce

Save the data listed in the description to a file, say xform.tfm and then load it into slicer. Going to the transforms module displays the wrong values (clamped to 200 for translation).

The value of the transform node actually hasn't been changed (it still has values > 200).

Additional Information

07-28-2012 snow leopard

TagsNo tags attached.

Relationships

has duplicate 0002584 closedsankhesh Transform Widget: min/max setting changes the translation values when selecting a new transform 

Activities

2012-07-30 19:23

 

transform_GUI.png (33,013 bytes)
transform_GUI.png (33,013 bytes)

2012-07-30 19:24

 

test_transfo.tfm (170 bytes)
pieper

pieper

2012-07-31 07:54

administrator   ~0005465

I spent some time looking at this and it is a real problem (displaying invalid data is not good).

The issue seems to be somewhere in the range management code of the transform sliders and the way they interact with the matrix widget.

jcfr

jcfr

2012-09-03 05:30

administrator   ~0005930

From Sankhesh: I found that loading a transforms file sets the maximum value of the transforms matrix to maximum value in the loaded file. What should be the maximum value? Is there a theoretical value that we can set?

jcfr

jcfr

2012-09-03 05:30

administrator   ~0005931

What about setting the min and max of the range based on the value found in the file ? May be we could apply a factor to the min/max values found in the file before setting the max and min of the spinboxes.

sankhesh

sankhesh

2012-09-07 12:10

developer   ~0006010

Topic pushed to https://github.com/sankhesh/Slicer/tree/2380-Transforms-module-sliders-issue

finetjul

finetjul

2012-09-11 07:13

administrator   ~0006034

Thanks for your fix. I've just a few comments:
a) it's odd (and not documented) that extractMinMaxTranslationValue uses the values min and max as input as well as output. I would instead initialize min/max in the function.
b) if min is 0, then the padding doesn't work. I would suggest to apply the padding ratio to (max - min) instead.
c) if the matrix translation is 0,0,0, we might still want a better default min/max other than 0,0. Maybe -200, 200 as it used to be
d) the problem is not just when selecting the node for the first time in the panel. What if the node is "selected" in the module and then the matrix values are modified externally e.g. from python/cli/...

sankhesh

sankhesh

2012-09-12 10:39

developer   ~0006043

Hi Julien,

Thanks for the comments.
a) The function is documented in the header. The min-max values are passed by reference to the function.
b) I'll change the padding to be applied to the difference between max and min.
c) The defaults are still the same(-200, 200). The patch that I added makes sure that the min-max values are changed only if the new ones are out of the current range.
d) Could you tell me how should I test this? (Once the transform file is loaded, I can get the node from the python interactor. How do I modify the matrix?)

finetjul

finetjul

2012-09-13 01:26

administrator   ~0006046

Last edited: 2012-09-13 01:27

a) Technically it is only said the values are "filled" and it is not mentioned (and it's a bit strange but it's ok, I can live with it :-) ) that the values are also "used".
d) Look at the Information for Developers section, you can write the same in python (and modify the matrix): http://www.slicer.org/slicerWiki/index.php/Documentation/4.1/Modules/Transforms

sankhesh

sankhesh

2012-09-14 07:02

developer   ~0006069

This commit replaces the pass by reference for better wrapping. I improved the documentation as well.
https://github.com/sankhesh/Slicer/commit/ba2027e5cde61aaec64f4f2d153fd338b90b809b

sankhesh

sankhesh

2012-09-19 06:33

developer   ~0006135

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

These commits fix the issue.

jcfr

jcfr

2014-03-06 05:08

administrator   ~0010967

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

Issue History

Date Modified Username Field Change
2012-07-30 19:23 spujol New Issue
2012-07-30 19:23 spujol Status new => assigned
2012-07-30 19:23 spujol Assigned To => pieper
2012-07-30 19:23 spujol File Added: transform_GUI.png
2012-07-30 19:24 spujol File Added: test_transfo.tfm
2012-07-31 07:54 pieper Note Added: 0005465
2012-07-31 07:54 pieper Assigned To pieper => finetjul
2012-07-31 07:54 pieper Status assigned => confirmed
2012-07-31 07:54 pieper Steps to Reproduce Updated
2012-07-31 08:05 pieper Target Version => Slicer 4.2.0 - October 1st 2012
2012-07-31 08:28 finetjul Status confirmed => assigned
2012-07-31 08:28 finetjul Assigned To finetjul => jcfr
2012-08-29 11:17 jcfr Assigned To jcfr =>
2012-08-29 11:19 jcfr Assigned To => jcfr
2012-08-29 12:03 jcfr Assigned To jcfr => sankhesh
2012-09-03 05:30 jcfr Note Added: 0005930
2012-09-03 05:30 jcfr Note Added: 0005931
2012-09-07 12:10 sankhesh Note Added: 0006010
2012-09-11 07:13 finetjul Note Added: 0006034
2012-09-12 10:39 sankhesh Note Added: 0006043
2012-09-13 01:26 finetjul Note Added: 0006046
2012-09-13 01:27 finetjul Note Edited: 0006046
2012-09-14 07:02 sankhesh Note Added: 0006069
2012-09-19 06:33 sankhesh Note Added: 0006135
2012-09-19 06:33 sankhesh Status assigned => resolved
2012-09-19 06:33 sankhesh Resolution open => fixed
2012-10-02 10:08 sankhesh Relationship added duplicate of 0002584
2012-10-02 10:08 sankhesh Relationship deleted 0002584
2012-10-02 10:08 sankhesh Relationship added has duplicate 0002584
2014-03-06 05:08 jcfr Note Added: 0010967
2014-03-06 05:10 jcfr Status resolved => closed
2014-03-06 05:55 jcfr Fixed in Version => Slicer 4.4.0