[Insight-users] 4D Bspline approximation

Nicholas Tustison ntustison at gmail.com
Fri Sep 21 13:06:00 EDT 2012


Hi Mathieu,

I'm having some difficulty compiling your code (see below).  
Considering the errors, I'm wondering if I'm compiling against
the right version of VTK.  Also, what version of ITK are you 
using?

Nick


[ntustison at Nietzschean-Numerics Fri Sep 21 12:58:48] $ make testRegulItkBspline
Scanning dependencies of target testRegulItkBspline
[100%] Building CXX object CMakeFiles/testRegulItkBspline.dir/testRegulItkBspline.o
In file included from /Users/ntustison/Pkg/Utilities/src/testRegulItkBspline.cxx:4:
In file included from /Users/ntustison/Pkg/ANTS/bin/VTK/Filtering/vtkUnstructuredGrid.h:27:
In file included from /Users/ntustison/Pkg/ANTS/bin/VTK/Filtering/vtkPointSet.h:29:
In file included from /Users/ntustison/Pkg/ANTS/bin/VTK/Filtering/vtkDataSet.h:40:
In file included from /Users/ntustison/Pkg/ANTS/bin/VTK/Filtering/vtkDataObject.h:35:
In file included from /Users/ntustison/Pkg/ANTS/bin/VTK/Common/vtkObject.h:41:
In file included from /Users/ntustison/Pkg/ANTS/bin/VTK/Common/vtkObjectBase.h:43:
In file included from /Users/ntustison/Pkg/ANTS/bin/VTK/Common/vtkIndent.h:24:
In file included from /Users/ntustison/Pkg/ANTS/bin/VTK/Common/vtkSystemIncludes.h:40:
In file included from /Users/ntustison/Pkg/ANTS/bin/VTK/Common/vtkIOStream.h:112:
In file included from /usr/include/c++/4.2.1/backward/strstream:51:
/usr/include/c++/4.2.1/backward/backward_warning.h:32:2: warning: This file includes at least one deprecated or antiquated header. Please consider using one of the 32
      headers found in section 17.4.1.2 of the C++ standard. Examples include substituting the <X> header for the <X.h> header for C++ includes, or <iostream> instead of
      the deprecated header <iostream.h>. To disable this warning use -Wno-deprecated. [-W#warnings]
#warning This file includes at least one deprecated or antiquated header. \
 ^
1 warning generated.
Linking CXX executable testRegulItkBspline
Undefined symbols for architecture x86_64:
  "vtkDataSet::GetBounds(double*)", referenced from:
      _main in testRegulItkBspline.o
  "vtkSmartPointerBase::vtkSmartPointerBase(vtkObjectBase*)", referenced from:
      _main in testRegulItkBspline.o
  "vtkSmartPointerBase::vtkSmartPointerBase(vtkObjectBase*, vtkSmartPointerBase::NoReference const&)", referenced from:
      _main in testRegulItkBspline.o
  "vtkSmartPointerBase::vtkSmartPointerBase(vtkSmartPointerBase const&)", referenced from:
      _main in testRegulItkBspline.o
      std::vector<vtkSmartPointer<vtkUnstructuredGrid>, std::allocator<vtkSmartPointer<vtkUnstructuredGrid> > >::_M_insert_aux(__gnu_cxx::__normal_iterator<vtkSmartPointer<vtkUnstructuredGrid>*, std::vector<vtkSmartPointer<vtkUnstructuredGrid>, std::allocator<vtkSmartPointer<vtkUnstructuredGrid> > > >, vtkSmartPointer<vtkUnstructuredGrid> const&) in testRegulItkBspline.o
  "vtkSmartPointerBase::~vtkSmartPointerBase()", referenced from:
      _main in testRegulItkBspline.o
      std::vector<vtkSmartPointer<vtkUnstructuredGrid>, std::allocator<vtkSmartPointer<vtkUnstructuredGrid> > >::_M_insert_aux(__gnu_cxx::__normal_iterator<vtkSmartPointer<vtkUnstructuredGrid>*, std::vector<vtkSmartPointer<vtkUnstructuredGrid>, std::allocator<vtkSmartPointer<vtkUnstructuredGrid> > > >, vtkSmartPointer<vtkUnstructuredGrid> const&) in testRegulItkBspline.o
  "vtkSmartPointerBase::operator=(vtkSmartPointerBase const&)", referenced from:
      std::vector<vtkSmartPointer<vtkUnstructuredGrid>, std::allocator<vtkSmartPointer<vtkUnstructuredGrid> > >::_M_insert_aux(__gnu_cxx::__normal_iterator<vtkSmartPointer<vtkUnstructuredGrid>*, std::vector<vtkSmartPointer<vtkUnstructuredGrid>, std::allocator<vtkSmartPointer<vtkUnstructuredGrid> > > >, vtkSmartPointer<vtkUnstructuredGrid> const&) in testRegulItkBspline.o
  "vtkUnstructuredGrid::New()", referenced from:
      _main in testRegulItkBspline.o
  "vtkUnstructuredGridReader::New()", referenced from:
      _main in testRegulItkBspline.o
  "vtkUnstructuredGridReader::GetOutput()", referenced from:
      _main in testRegulItkBspline.o
  "vtkUnstructuredGridWriter::New()", referenced from:
      _main in testRegulItkBspline.o
  "vtkWriter::SetInput(vtkDataObject*)", referenced from:
      _main in testRegulItkBspline.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[3]: *** [testRegulItkBspline] Error 1
make[2]: *** [CMakeFiles/testRegulItkBspline.dir/all] Error 2
make[1]: *** [CMakeFiles/testRegulItkBspline.dir/rule] Error 2
make: *** [testRegulItkBspline] Error 2









On Sep 20, 2012, at 12:55 PM, "DE CRAENE, MATHIEU" <mathieu.de_craene at philips.com> wrote:

> Hi Nick
> 
> Thanks a lot for the input.
> 
> For the first point, I understand that what matters is the domain as defined from (Origin,Size,Spacing) since I don't want to generate an output image but only the phi lattice. For the second point, I have removed my border control points since this is internally handled.
> 
> When debugging further the code, I noticed the following
> 
> 1) The origin of the lattice as obtained from the bspline projection filter seems to be
> 
>                                latticeOrigin = -latticeSpacing.
>   When I would expect it to be
>                                latticeOrigin = domainOrigin -latticeSpacing.
> 
>   Is it assumed  that the origin of the domain is 0 ?
> 
> 2) When I use a time lower bound equal to the Upper bound equal to 0, I get infinite displacement.
> 
> 3) As a test, I overwrote the result of the projection filter and set all node values to be equal to 10. I was expecting the mesh to be shifted from a constant translation at each time step. But it seems to be moving only at the first time point. Maybe I incorrectly defined the temporal span of the transformation ....
> 
> I reattach the source code to this email. I'm using  ITK 4.2.
> Since this part of the toolkit is under intense development, I maybe should move to a more recent version. Let me know where to download it if that would be the case.
> 
> 
> Thanks a lot!!!!
> 
> 
> Mathieu
> 
> -----Message d'origine-----
> Envoyé : jeudi 20 septembre 2012 13:38
> À : DE CRAENE, MATHIEU
> Objet : Re: 4D Bspline approximation
> 
> Hi Mathieu,
> 
> Perhaps answering your short questions will help us figure out what's going on.
> 
>> - Is it correct to use the same size as the number of control points in itkBSplineScatteredDataPointSetToImageFilter ?
> 
> No, they're distinct.  The spacing and size combination define the sampled parametric domain (I did this primarily since the filter derives from the PointSetToImageFilter base class).  So if I have a 20x20 control point grid defining a b-spline object over a domain of 100mm x 100mm, there are many ways I can define the domain which won't matter for the internal calculations of the final "PhiLattice".
> For example, a size and spacing combination of
> 
> size = 101, spacing = 1
> 
> will define the same parametric domain as
> 
> size = 1001, spacing = 0.1
> 
> The only difference will be the size of the "image", i.e. sampled B-spline object when you call GetOutput() but the GetPhiLattice() will be the same.
> 
>> - Should I take care of having enough border control points around the mesh nodes (padding) ? How many nodes ?
> 
> In the B-spline classes that I've written (including a rewrite of the B-spline transform class), I don't make a distinction between the internal control points and the border control points.  When you specify the parametric domain for the BSplineScattered...Filter (by specifying the origin, size, and spacing), the control points get laid out automatically based on that domain and the spline order(s) including the border ones.
> 
> I hope that helps.  Let me know if it doesn't and I can try running things on my end.
> 
> Nick
> 
> 
> 
> 
> 
> ________________________________
> The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message.
> <testRegulItkBspline.cxx>_____________________________________
> Powered by www.kitware.com
> 
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
> 
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.php
> 
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
> 
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users



More information about the Insight-users mailing list