[ITK-users] EuclideanDistancePointMetric: Error when comparing Mesh to QuadEdgeMesh

DVigneault davis.vigneault at gmail.com
Wed May 20 12:04:41 EDT 2015


All--

I'm attempting to use itk::EuclideanDistancePointMetric to compare an
itk::Mesh to an itk::QuadEdgeMesh.  This works as expected if templated over
two meshes of the same type (i.e., itk::Mesh and itk::Mesh or
itk::QuadEdgeMesh and itk::QuadEdgeMesh).  However, if I attempt to mix the
two, and compare an itk::Mesh and an itk::QuadEdgeMesh, I get a build error,
copied below, along with a minimal example of the problem.

I'm having some trouble decoding the error, but it looks to me as though the
filter is having trouble converting between iterator types.  Does this have
something to do with a difference between how itk::Mesh and
itk::QuadEdgeMesh define their iterators?

Thank you in advance for your help!

Best,

--Davis

#include "itkQuadEdgeMesh.h"
#include "itkRegularSphereMeshSource.h"
#include "itkEuclideanDistancePointMetric.h"
#include "itkIdentityTransform.h"

typedef itk::Mesh< double, 3 > TFMesh; // If you change this to
itk::QuadEdgeMesh, it works
typedef itk::QuadEdgeMesh< double, 3 > TMMesh; // Or if you change this to
itk::Mesh, it also works
typedef itk::RegularSphereMeshSource< TFMesh > TFSource;
typedef itk::RegularSphereMeshSource< TMMesh > TMSource;
typedef itk::EuclideanDistancePointMetric< TFMesh, TMMesh > TMetric;
typedef itk::IdentityTransform< double, 3 > TIdentity;

int main(int argc, char ** argv)
{

  TFSource::Pointer fixed = TFSource::New();
  fixed->Update();

  TMSource::Pointer moving = TMSource::New();
  moving->Update();

  TIdentity::Pointer identity = TIdentity::New();

  TMetric::Pointer metric = TMetric::New();
  metric->SetFixedPointSet( fixed->GetOutput() );
  metric->SetMovingPointSet( moving->GetOutput() );
  metric->SetTransform( identity );
  std::cout << metric->GetValue(identity->GetParameters()) << std::endl;

  return EXIT_SUCCESS;

}


$ make
Scanning dependencies of target AmoebaOptimization
[100%] Building CXX object
CMakeFiles/AmoebaOptimization.dir/AmoebaOptimization.cxx.o
In file included from
/usr/local/include/ITK-4.7/itkEuclideanDistancePointMetric.h:125:0,
                 from
/home/davis/Developer/oxford/Stebbing_Method/Test/src/AmoebaOptimization.cxx:3:
/usr/local/include/ITK-4.7/itkEuclideanDistancePointMetric.hxx: In
instantiation of ‘itk::EuclideanDistancePointMetric<TFixedPointSet,
TMovingPointSet, TDistanceMap>::MeasureType
itk::EuclideanDistancePointMetric<TFixedPointSet, TMovingPointSet,
TDistanceMap>::GetValue(const TransformParametersType&) const [with
TFixedPointSet = itk::Mesh<double, 3u>; TMovingPointSet =
itk::QuadEdgeMesh<double, 3u>; TDistanceMap = itk::Image<short unsigned int,
3u>; itk::EuclideanDistancePointMetric<TFixedPointSet, TMovingPointSet,
TDistanceMap>::MeasureType = itk::Array<double>;
itk::EuclideanDistancePointMetric<TFixedPointSet, TMovingPointSet,
TDistanceMap>::TransformParametersType = itk::OptimizerParameters<double>]’:
/home/davis/Developer/oxford/Stebbing_Method/Test/src/AmoebaOptimization.cxx:28:58:  
required from here
/usr/local/include/ITK-4.7/itkEuclideanDistancePointMetric.hxx:74:63: error:
conversion from ‘itk::MapContainer<long unsigned int,
itk::QuadEdgeMeshPoint<float, 3u, itk::GeometricalQuadEdge<long
unsigned int, long unsigned int, bool, bool, true> > >::ConstIterator’ to
non-scalar type ‘itk::EuclideanDistancePointMetric<itk::Mesh<double, 3u>,
itk::QuadEdgeMesh<double, 3u> >::PointIterator {aka
itk::VectorContainer<long unsigned int, itk::Point<float, 3u>
>::ConstIterator}’ requested
   PointIterator pointItr = movingPointSet->GetPoints()->Begin();
                                                               ^
/usr/local/include/ITK-4.7/itkEuclideanDistancePointMetric.hxx:75:61: error:
conversion from ‘itk::MapContainer<long unsigned int,
itk::QuadEdgeMeshPoint<float, 3u, itk::GeometricalQuadEdge<long
unsigned int, long unsigned int, bool, bool, true> > >::ConstIterator’ to
non-scalar type ‘itk::EuclideanDistancePointMetric<itk::Mesh<double, 3u>,
itk::QuadEdgeMesh<double, 3u> >::PointIterator {aka
itk::VectorContainer<long unsigned int, itk::Point<float, 3u>
>::ConstIterator}’ requested
   PointIterator pointEnd = movingPointSet->GetPoints()->End();
                                                             ^
make[2]: *** [CMakeFiles/AmoebaOptimization.dir/AmoebaOptimization.cxx.o]
Error 1
make[1]: *** [CMakeFiles/AmoebaOptimization.dir/all] Error 2
make: *** [all] Error 2




--
View this message in context: http://itk-insight-users.2283740.n2.nabble.com/EuclideanDistancePointMetric-Error-when-comparing-Mesh-to-QuadEdgeMesh-tp7587372.html
Sent from the ITK Insight Users mailing list archive at Nabble.com.


More information about the Insight-users mailing list