[Insight-users] Compilation error for TCoordRep=float in MeshTraits
Dan Mueller
dan.muel at gmail.com
Thu Oct 9 06:26:18 EDT 2008
Ah ha. Thanks nadan.
Now to the Insight Developers: why are the values in
SimplexMeshGeometry::PointType hard-coded?
I guess due to backwards compatibility it's too late to fix this (ie.
introduce a templated version). However, as I've shown, it's pretty
easy to encounter compilation errors, even more so if you use the
default TMeshTraits in itkSimplexMesh.h with TPixelType=float!
I'm not sure the other solution suggested by nadan (overloading
operator=) is the best approach either, because it requires double to
be hard coded into itk::Point.
Any thoughts, or are we stuck with TCoordRep=double for simplex meshes?
Regards, Dan
2008/10/9 nadan zhu <nadan.zhu at gmail.com>:
> As SimplexMeshGeometry::PointType is defined as itk::Point<double,3>
> in itkDeformableSimplexMesh3DFilter.txx(164)
> data->pos = points.Value(); //error because itk::Point<double,3> =
> itk::Point<float,3>
>
> One possible way to solve it is to make class SimplexMeshGeometry template
> or
> overload function operator= in itk::Point
> template<class PointValueType>
> Point& operator= (const Point<PointValueType,NPointDimension> & r)
> {
> const FixedArray<PointValueType, NPointDimension> & fa = r;
> BaseArray::operator=(fa);
> return *this;
> }
>
>
>
> regards
>
> nadan
>
> On Thu, Oct 9, 2008 at 7:52 PM, Dan Mueller <dan.muel at gmail.com> wrote:
>>
>> Hi Insight Users,
>>
>> I am trying to use itk::DeformableSimplexMesh3DFilter with a specific
>> mesh trait. However I am encountering compilation errors. Can someone
>> point out what I am doing wrong?
>>
>> Changing TCoordRep (below) from float to double makes the error go
>> away. However, I would like the pixel type and coord rep type to be
>> the same (ie. float). Why is this not allowed?
>>
>
>
More information about the Insight-users
mailing list