View Issue Details

IDProjectCategoryView StatusLast Update
0003776Slicer4Module Volumespublic2017-06-10 08:51
Reportersafir Assigned Topieper  
PrioritynormalSeverityminorReproducibilitysometimes
Status closedResolutionfixed 
Product VersionSlicer 4.3.1 
Target VersionSlicer 4.4.0Fixed in VersionSlicer 4.7.0 
Summary0003776: CheckForLabelVolumeValidity compares float points and it says: IJKToRAS mismatch at [0, 3] (-89.6207 != -89.6207)
Description

Calling CheckForLabelVolumeValidity with two volumes that have the same dimension returns a wrong warning, e.g. "IJKToRAS mismatch at [0, 3] (-89.6207 != -89.6207)", "IJKToRAS mismatch at [1, 1] (0.000542851 != 0.000542851)", and "IJKToRAS mismatch at [2, 0] (4.32616e-09 != 4.32616e-09) IJKToRAS mismatch at [2, 2] (0.0752821 != 0.0752821)", and "IJKToRAS mismatch at [2, 3] (176.197 != 176.197)".

I think the comparison at line 929 in "vtkSlicerVolumesLogic.cxx": "if (volumeValue != labelValue)", must be to a certain floating point, e.g. if "abs(volumeValue - labelValue > 0.001)".

TagsNo tags attached.

Activities

jcfr

jcfr

2014-07-28 05:24

administrator   ~0012253

@safir: Thanks for reporting the problem and suggesting a solution. Could you test the following patch:

https://github.com/jcfr/Slicer/tree/3776-CheckForLabelVolumeValidity-fix-double-compare

jcfr

jcfr

2014-07-28 06:08

administrator   ~0012257

Fixed in r23488
See http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&revision=23488

@Steve: Thanks for reviewing.

@Safir: Thanks for contributing. After testing it works out as expected, make sure to close the issue.

Thanks

safir

safir

2014-07-29 00:38

reporter   ~0012264

Thanks @jscfr for looking into this issue. The issue remains the same for me, with these two files: https://db.tt/YNaGQblq and https://db.tt/goyDta8k I get this "Warning: IJKToRAS mismatch at [1, 3] (45.929 != 45.929)" and "IJKToRAS mismatch at [2, 3] (176.197 != 176.197)".

/Arash

_-_-_

_-_-_

2017-05-19 09:34

reporter   ~0014488

I think this problem still exist.

I've changed the format of a label map from nrrd to mha.

After opening the scene and the editor with the label map saved in mha format I receive the same warning.

pieper

pieper

2017-05-19 09:40

administrator   ~0014489

What version of Slicer are you using? (is it something newer that 4.4?)

Can you share a small example dataset that demonstrates the problem?

_-_-_

_-_-_

2017-05-30 04:06

reporter   ~0014494

Last edited: 2017-05-30 04:08

View 2 revisions

Here is an example: http://www13.zippyshare.com/v/bW3crAV2/file.html

The same label map stored as nrrd and mha.

If I switch from nrrd to mha in the Editor, i get the error:
http://imgur.com/a/d1MdR

I use version 4.6.2.

pieper

pieper

2017-05-30 12:43

administrator   ~0014501

Thanks for reporting - I'd like to try with the sample data you provided, but the zippyshare.com link has so many ads with download buttons that I cannot tell which one actually links to the data. Can you try again with dropbox or google drive? Or even just upload to the bug tracker if the file is small enough.

_-_-_

_-_-_

2017-05-30 14:38

reporter  

Slicer_Bug3776_Example.zip (3,667,585 bytes)
_-_-_

_-_-_

2017-05-30 14:39

reporter   ~0014503

Last edited: 2017-05-30 14:52

View 2 revisions

^^^^ done

Attached Files:
Slicer_Bug3776_Example.zip [^] (3,667,585 bytes) 2017-05-30 14:38

_-_-_

_-_-_

2017-05-30 14:39

reporter  

Slicer_Bug3776_Example.JPG (244,143 bytes)
Slicer_Bug3776_Example.JPG (244,143 bytes)
pieper

pieper

2017-05-30 18:06

administrator   ~0014504

Last edited: 2017-05-30 18:06

View 2 revisions

Thanks for the data - I was able to replicate the issue.

There is a truncation issue where the original data from the NRRD file:

space directions: (1.26953125,0,0) (0,1.26953125,0) (0,0,0.5)

Contains more digits than the Meta file:

ElementSpacing = 1.26953 1.26953 0.5

So the detection was correct, but the error message was incorrect because the error message only displayed 6 significant digits, but this included 3 before the decimal point while the code checks only the fractional part.

If I fix the error message I get this:

IJKToRAS mismatch at [0, 0] (-1.269531 != -1.269530)
IJKToRAS mismatch at [0, 3] (-420.214844 != -420.215000)
IJKToRAS mismatch at [1, 1] (-1.269531 != -1.269530)
IJKToRAS mismatch at [1, 3] (-264.062500 != -264.063000)

which is technically correct but still probably over sensitive for the nature of the problem.

pieper

pieper

2017-05-30 18:23

administrator   ~0014505

Fix is committed so the dialog box accurately reports the numbers that are different:

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

It may still be the case that the test is overly sensitive, but I think that should be filed as an independent issue.

_-_-_

_-_-_

2017-05-31 03:45

reporter   ~0014506

But if I understand correctly, the reason for the difference is the conversion from nrrd to mha, right?

pieper

pieper

2017-05-31 07:42

administrator   ~0014507

Right - the mha file doesn't preserve all the significant digits. Probably this could be addressed by changing the print format in the Meta image code.

Related Changesets

Import 2017-06-07 23:51:09: master 41ee3bdf

2014-07-28 09:56:08

jcfr

Details Diff
BUG: Fix CheckForLabelVolumeValidity warning. Fixes 0003776

This commit fixes a regression introduced in r23406 [1]
where calling CheckForLabelVolumeValidity with two volumes that have
the same dimension was returning a wrong warning, e.g. "IJKToRAS mismatch
at [0, 3] (-89.6207 != -89.6207)", "IJKToRAS mismatch
at [1, 1] (0.000542851 != 0.000542851)", and "IJKToRAS mismatch
at [2, 0] (4.32616e-09 != 4.32616e-09) IJKToRAS mismatch
at [2, 2] (0.0752821 != 0.0752821)", and "IJKToRAS mismatch
at [2, 3] (176.197 != 176.197)".

Thanks to "safir" for reporting the problem and suggesting a solution.

[1] http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&revision=23406

git-svn-id: http://svn.slicer.org/Slicer4/trunk@23488 3bd1e089-480b-0410-8dfb-8563597acbee
mod - Modules/Loadable/Volumes/Logic/vtkSlicerVolumesLogic.cxx Diff File

Import 2017-06-07 23:51:09: master ef7d83d3

2017-05-30 17:56:45

pieper

Details Diff
BUG: 0003776 warning dialog gave useless/misleading information

The fuzzy compare of image geometry looks at the difference
between two values, but the printing of the warning set the
precision based on the whole number including the digits
left of the decimal point. The result was a message that showed
identical numbers and reported them as different (understandably
confusing).

https://www.na-mic.org/Bug/view.php?id=3776

From: Steve Pieper <pieper@isomics.com>

git-svn-id: http://svn.slicer.org/Slicer4/trunk@26061 3bd1e089-480b-0410-8dfb-8563597acbee
mod - Modules/Loadable/Volumes/Logic/vtkSlicerVolumesLogic.cxx Diff File

Issue History

Date Modified Username Field Change
2014-07-24 05:16 safir New Issue
2014-07-28 05:23 jcfr Status new => assigned
2014-07-28 05:23 jcfr Assigned To => pieper
2014-07-28 05:23 jcfr Target Version => Slicer 4.4.0
2014-07-28 05:24 jcfr Note Added: 0012253
2014-07-28 06:08 jcfr Note Added: 0012257
2014-07-28 06:08 jcfr Status assigned => resolved
2014-07-28 06:08 jcfr Fixed in Version => Slicer 4.4.0
2014-07-28 06:08 jcfr Resolution open => fixed
2014-07-29 00:38 safir Note Added: 0012264
2017-05-19 09:34 _-_-_ Note Added: 0014488
2017-05-19 09:40 pieper Note Added: 0014489
2017-05-30 04:06 _-_-_ Note Added: 0014494
2017-05-30 04:08 _-_-_ Note Edited: 0014494 View Revisions
2017-05-30 12:43 pieper Note Added: 0014501
2017-05-30 14:38 _-_-_ File Added: Slicer_Bug3776_Example.zip
2017-05-30 14:39 _-_-_ Note Added: 0014503
2017-05-30 14:39 _-_-_ File Added: Slicer_Bug3776_Example.JPG
2017-05-30 14:52 _-_-_ Note Edited: 0014503 View Revisions
2017-05-30 18:06 pieper Note Added: 0014504
2017-05-30 18:06 pieper Note Edited: 0014504 View Revisions
2017-05-30 18:23 pieper Note Added: 0014505
2017-05-30 18:23 pieper Status resolved => closed
2017-05-30 18:23 pieper Fixed in Version Slicer 4.4.0 => Slicer 4.7.0
2017-05-31 03:45 _-_-_ Note Added: 0014506
2017-05-31 07:42 pieper Note Added: 0014507
2017-06-08 01:51 pieper Changeset attached => Slicer master ef7d83d3
2017-06-10 08:51 jcfr Changeset attached => Slicer master 41ee3bdf