[Insight-users] Storing non-coordinate information on a mesh

nadan zhu nadan.zhu at gmail.com
Mon Aug 31 21:39:42 EDT 2009


The simplest way is to define your pixel type as
    class PTXPoint
    {
        public:
            typedef itk::RGBPixel<unsigned char> ColorType; //note: the ptx
format uses unsigned chars for color

            ColorType Color;
            double Intensity;
    };

And you instantiate a new meshtraits, like
typedef itk::DefaultStaticMeshTraits<PTXPoint, 3, 3, double, double>
MeshTraits;// since you want the coordinates type is double

then you define your mesh as
typedef itk::Mesh<PTXPoint, 3, MeshTraits>    MeshType;





On Tue, Sep 1, 2009 at 5:27 AM, David Doria
<daviddoria+itk at gmail.com<daviddoria%2Bitk at gmail.com>
> wrote:

> I was going to do something like this:
>
>     class PTXPoint
>     {
>         public:
>             typedef itk::Point<double, 3> PointType;
>             typedef itk::RGBPixel<unsigned char> ColorType; //note: the ptx
> format uses unsigned chars for color
>
>             PointType Point;
>             ColorType Color;
>             double Intensity;
>
>     };
>
> And then create a mesh of the new PTXPoint type:
> typedef itk::Mesh<PTXPoint, 3>  MeshType;
>
> But that doesn't make sense, because the dimensionality of the coordinates
> is already defined inside PTXPoint. I really just want a
> typedef itk::Mesh<double, 3>  MeshType;
>
> but where each point in the mesh has a Color and Intensity associated with
> it. What's the best way to do that?
>
> Thanks,
>
> David
>
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20090901/3b8ad9cc/attachment-0001.htm>


More information about the Insight-users mailing list