MantisBT - ITK
View Issue Details
0010633ITKpublic2010-04-28 09:422011-06-17 12:53
jneuhaus 
Nick Tustison 
normalmajoralways
closedwon't fix 
Windows/x64Windows Vista x64
ITK-3-18 
 
backlog
0010633: itk::NonUniformBSpline can not be instantiated
I try to compile a very simple test program (see section "Steps To Reproduce") that basically defines a variable of type itk::NonUniformBSpline<3>.

Visual Studio 2008 produces the following complier error:

Compiling...
mitkSplineTest.cpp
v:\windows\source\itk318\code\common\itkNonUniformBSpline.h(83) : error C2679: binary '<<' : no operator found which takes a right-hand operand of type 'const std::vector<_Ty>' (or there is no acceptable conversion)
        with
        [
            _Ty=itk::Point<itk::NonUniformBSpline<3>::ScalarType,3>
        ]
[... <-- lot of output with possible types that do not match...]

The same code was working on ITK 3.16.
I suppose, the problem is, that this class is not used anywhere in ITK and that there is no unit test for the class, therefore changes to the class were never really compiled (e.g. bug 0010458).
#include <itkNonUniformBSpline.h>

int main(int /* argc */, char* /*argv*/[])
{
  typedef itk::NonUniformBSpline<3> SplineType;
  SplineType::Pointer mySpline;

  return 0;
}
No tags attached.
patch NonUniformBSpline.patch (4,130) 2010-04-28 12:47
https://public.kitware.com/Bug/file/3073/NonUniformBSpline.patch
cxx itkNonUniformBSplineTest.cxx (5,957) 2010-04-28 12:47
https://public.kitware.com/Bug/file/3074/itkNonUniformBSplineTest.cxx
Issue History
2010-04-28 09:42jneuhausNew Issue
2010-04-28 10:13jneuhausNote Added: 0020461
2010-04-28 11:48jneuhausNote Added: 0020462
2010-04-28 12:26Luis IbanezStatusnew => assigned
2010-04-28 12:26Luis IbanezAssigned To => Luis Ibanez
2010-04-28 12:47Luis IbanezFile Added: NonUniformBSpline.patch
2010-04-28 12:47Luis IbanezFile Added: itkNonUniformBSplineTest.cxx
2010-04-28 12:52Luis IbanezNote Added: 0020464
2010-11-07 02:00Luis IbanezNote Added: 0022994
2011-06-17 12:31Hans JohnsonAssigned ToLuis Ibanez => Nick Tustison
2011-06-17 12:45Nick TustisonNote Added: 0026899
2011-06-17 12:53Hans JohnsonSprint Status => backlog
2011-06-17 12:53Hans JohnsonNote Added: 0026901
2011-06-17 12:53Hans JohnsonStatusassigned => closed
2011-06-17 12:53Hans JohnsonResolutionopen => won't fix

Notes
(0020461)
jneuhaus   
2010-04-28 10:13   
An important note: This compiler error only occurs in DEBUG mode!

Digging deeper, I found that the problem is the use of the
itkGetConstReferenceMacro() to return the non-ITK type PointListType which is a stl container:
typedef std::vector < PointType > PointListType;

the macro tries to pipe the vector into an output stream, which fails because there is no operator to pipe stl vectors:
itkDebugMacro("returning " << #name " of " << this->m_##name ); \

(this syntax is strange, I would expect either << before AND after #name or not at all, but this is not part of this bug report)
(0020462)
jneuhaus   
2010-04-28 11:48   
I also posted this to the mailing list and got a reply from Luis Ibanez:

http://www.itk.org/pipermail/insight-users/2010-April/036546.html [^]
(0020464)
Luis Ibanez   
2010-04-28 12:52   
The patch has been committed to the CVS Head.

In includes a unit test for the NonUniformBSpline class.
The test still needs some work on verifying the correctness of its numerical outputs.

http://public.kitware.com/cgi-bin/viewcvs.cgi/Code/Common/itkNonUniformBSpline.h?root=Insight&r1=1.6&r2=1.7&sortby=date [^]

http://public.kitware.com/cgi-bin/viewcvs.cgi/Code/Common/itkNonUniformBSpline.txx?root=Insight&r1=1.8&r2=1.9&sortby=date [^]

http://public.kitware.com/cgi-bin/viewcvs.cgi/Testing/Code/Common/itkCommonTests2.cxx?root=Insight&r1=1.30&r2=1.31&sortby=date [^]

http://public.kitware.com/cgi-bin/viewcvs.cgi/Testing/Code/Common/CMakeLists.txt?root=Insight&r1=1.253&r2=1.254&sortby=date [^]

New File
http://public.kitware.com/cgi-bin/viewcvs.cgi/Testing/Code/Common/itkNonUniformBSplineTest.cxx?root=Insight&sortby=date&view=log [^]

We will wait to see tomorrow's Dashboard.
If it is green we will commit the same patch to the ITK 3.18 branch.
(0022994)
Luis Ibanez   
2010-11-07 02:00   
The class does compile now,
but its implementation is not completed.

This class should be removed from ITK,
or at least, be moved to a module in the periphery.
(0026899)
Nick Tustison   
2011-06-17 12:45   
This class is in ITK-deprecated. Doesn't this mean it's slated to be removed and/or we don't have to provide support? I agree with Luis in that I think this class should be removed. It's functionality and usability is rather limited.
(0026901)
Hans Johnson   
2011-06-17 12:53   
This class has been deprecated.