[Insight-developers] [Insight-users] Compilation error for TCoordRep=float in MeshTraits

Dan Mueller dan.muel at gmail.com
Fri Oct 10 09:22:51 EDT 2008


Hi Luis,

I have submitted the bug:
    http://www.itk.org/Bug/view.php?id=7798
though I'm not clear how you plan to fix it (while maintaining
backwards compatibility).

For the time being I'm simply using simplex meshes with TCoordRep = double.

Cheers, Dan

2008/10/10 Luis Ibanez <luis.ibanez at kitware.com>:
>
> Hi Dan,
>
> Thanks for pointing this out.
>
> This looks like a bug, and something we could fix,
> while still keeping backward compatibility.
>
> Could you please log this as a bug ?
>
>
>   Thanks
>
>
>     Luis
>
>
> -----------------------------
> Dan Mueller wrote:
>>
>> 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?
>>>>
>>>
>>>
>> _______________________________________________
>> Insight-users mailing list
>> Insight-users at itk.org
>> http://www.itk.org/mailman/listinfo/insight-users


More information about the Insight-developers mailing list