View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0005692ITKpublic2007-09-13 00:412009-06-16 04:05
Reporterdbrussak 
Assigned ToAndinet 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0005692: small problem with BSplineFloor
Description
I am compiling ITK v3.2.0 with VS 2005 V8.0.50727.42

I am working on a Dell Precision 390 with:
-Intel Core2 Duo 6700 (2.66 GHz)
-2 GB of RAM
-Windows XP Professional Version 2002, SP2

BSplineFloor(x) (in particular the version for _M_IX86) returns an incorrect result with numbers within a certain precision of ceil(x). This can cause any number of issues. The one in particular I have had is inside of BSplineInterpolationWeightFunction::Evaluate()

I have a BSplineDeformableTransform<double, 3, 3> grid of size 15x15x15.

The function: BSplineDeformableTransform<double,3,3>::TransformPoint() is called and transforms a point into the following index:
[11.452082865989810, 12.999999197680104, 10.005523428572200]

Then it checks to see if this point is in a valid region. Since this is a 3rd order BSpline, the support grid is 4x4x4. The function only proceeds if this index has full support, i.e. 1<index[j]<13.

Since this index is inside the valid region (albeit barely), the call to m_WeightsFunction->Evaluate() should return
[10 11 9] for the supportIndex. Instead, because of the issue with BSplineFloor, [10 12 9] is returned and, since the assumption that we are inside the region of full support is broken, the iterators are misaligned and continue on well past their boundaries until the program crashes.

Attached is a very simple program illustrating the problem and reproducing this crash:
BSplineFloorIssue.tar.gz
    -CMakeLists.txt
    -BSplineFloorIssue.cxx


Additional Information
I believe this is related to the issue reported here:
http://www.nabble.com/a-strange-error-using-itkBSplineDeformableTransform-t3516947.html [^]

I am aware that there is an already outstanding bug report covering BSplineFloor and its calculation of the correct support region. I think that this is a separate issue as that bug report claimed that everything worked fine with odd-order BSplines.
TagsNo tags attached.
Resolution Date
Sprint
Sprint Status
Attached Filesgz file icon BSplineIssue.tar.gz [^] (1,306 bytes) 2007-09-13 00:41

 Relationships
has duplicate 0002078closeduser390 BSplineFloor in itkBSplineInterpolationWeightFunction.txx is incorrect 

  Notes
(0008966)
dbrussak (reporter)
2007-09-13 01:05
edited on: 2007-09-13 20:53

A possible fix could be the code reported in:
http://ldesoras.free.fr/doc/articles/rounding_en.pdf [^]

A very simple test of speed (running N times) gives the following results:
N x floor() = 24 sec.
N x BSplineFloor = 3 sec. (though faulty output as shown above)
N x floor_int() = 5 sec. (correct output in previous case)

(0016728)
Tom Vercauteren (developer)
2009-06-16 04:05

Fixed in HEAD:
http://www.itk.org/cgi-bin/viewcvs.cgi/Code/Common/itkBSplineInterpolationWeightFunction.txx?root=Insight&r1=1.15&r2=1.16&sortby=date [^]
http://www.itk.org/cgi-bin/viewcvs.cgi/Code/BasicFilters/itkBilateralImageFilter.txx?root=Insight&r1=1.29&r2=1.30&sortby=date [^]

 Issue History
Date Modified Username Field Change
2007-09-13 00:41 dbrussak New Issue
2007-09-13 00:41 dbrussak File Added: BSplineIssue.tar.gz
2007-09-13 01:05 dbrussak Note Added: 0008966
2007-09-13 20:53 dbrussak Note Edited: 0008966
2007-10-08 08:21 Luis Ibanez Relationship added related to 0002078
2008-01-23 15:06 Luis Ibanez Status new => assigned
2008-01-23 15:06 Luis Ibanez Assigned To => Andinet
2009-06-16 04:04 Tom Vercauteren Relationship replaced has duplicate 0002078
2009-06-16 04:05 Tom Vercauteren Note Added: 0016728
2009-06-16 04:05 Tom Vercauteren Status assigned => closed
2009-06-16 04:05 Tom Vercauteren Resolution open => fixed


Copyright © 2000 - 2018 MantisBT Team