[Insight-users] Bug in itk::kdTree ?

Luis Ibanez luis.ibanez at kitware.com
Thu Nov 26 13:46:22 EST 2009


Hi Motes,

What is the value of m_radius   ?

Please report this to the mailing list.


     Thanks


           Luis


-----------------------------------------
On Thu, Nov 26, 2009 at 1:32 PM, motes motes <mort.motes at gmail.com> wrote:
> For the last couple of days I have tried to find a solution for a
> segmentation fault that happens when I use the itk::kdTree.
>
> I am using the version of search where the radius is specified:
>
>  /** Searches the neighbors fallen into a hypersphere */
>  void Search(const MeasurementVectorType &query,
>              double radius,
>              InstanceIdentifierVectorType& result) const;
>
>
>
>
> From my function I call it with:
>
>    VectorType vectorPoint;
>    for (int i=0; i<NDimensions; i++) {
>      vectorPoint[i] = point[i];
>    }
>
>    NeighborsType neighbors;
>    tree->Search(vectorPoint, m_radius, neighbors);
>
>
>
>
>
> Where radius is computed like:
>
>  unsigned int FVOrder = 3;
>  double Order = (double)(FVOrder+1.0);
>  double  m_radius =  (1.0*maxValue * Order)/2.0;
>
>
> Now if I do:
>
>    tree->Search(vectorPoint, 5.0, neighbors);
>
> it works fine without any segmentation errors. But if I do:
>
>    tree->Search(vectorPoint, m_radius, neighbors);
>
> where m_radius is compted as above I get the segmentation error (after
> a few thousand calls).
>
> Could this be a bug or am I doing something wrong here?
> _____________________________________
> 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.html
>
> 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