Hi Steffen,

> Ok. I can easily setup such a LUT. I know as well how to assign it as
a
> property to the rendering node. What would be interesting to me is,
how
> to tell the mapper, which would be the "mitk::PointSetVtkMapper3D" in
> my
> case, that it should use point IDs as indices to the LUT.

In the current implementation of PointSetVtkMapper3D, a sphere is
generated for each point of the PointSet, and the PolyData of all
spheres are put together into large chunks of PolyData
(m_vtkSelectedPointList etc.). One such chunk exists for each of the
three types of points, "unselected", "selected", and "contour". 

VTK differentiates between coloring by scalars (using a lookup table to
map the scalars) and explicit coloring (by vtkActor properties). The
PointSet mapper uses the direct coloring by vtkActor.

One way to get the desired behavior would be to assign each of the
sphere's points a scalar which corresponds to the IDs stored in the
PointData of the PointSet (have a look at the PointDataType in
mitkPointSet.h). This could be done by manipulating the poly data
generated by the vtkSphereSource objects (you'd have to find a suitable
way to do this... a starting point would be to look at the
implementation of PolyData and its base classes). Then the
vtkPolyDataMapper could be configured to use the LookupTable to map the
scalars directly to colors, instead of using an explicitly specified
color, by calling vtkMapper::SetColorModeToMapScalars().

Another method would be to create one actor for each sphere, and color
these actors explicitly, by taking the colors out of the lookup table
according to the points' IDs. However, this would require many changes
in the PointSet mapper if the original functionality is to be
retained...


Hope this helps to get you started, just ask if you need further info...

Have a nice weekend,
Mathias



> -----Original Message-----
> From: Steffen Oeltze [mailto:[EMAIL PROTECTED]
> Sent: Friday, February 29, 2008 12:40 PM
> To: Seitel Mathias; [email protected]
> Subject: Re: [mitk-users] mitkPointSet
> 
> Hi,
> 
> Seitel Mathias schrieb:
> > Hi Steffen,
> >
> > The colors used for rendering PointSets are currently hard-coded in
> the
> > mitk::PointSetVtkMapper3D and mitk::PointSetMapper2D classes,
> > respectively. The mappers currently differentiate between
unselected,
> > selected, and contour points, and color the accordingly.
> >
> > An option to customize these color schemes would surely be
helpful...
> > The best way to do this would be via Properties (i.e. specifying the
> > information how a PointSet should be colored as a mitk::Property of
> its
> > DataTreeNode). I assume that you want to specify for each point of a
> > PointSet a user-defined color.
> 
> This is exactly what I have in mind.
> 
> 
> To achieve this, you could create a color
> > lookup table and store it in a property (see
> mitk::LookupTableProperty).
> > The above mapper classes could then be adopted so that this lookup
> table
> > is retrieved and (if present) is used to color the points. Each
point
> in
> > the PointSet can be assigned an ID, which could then be used as a
> point
> > into this lookup table.
> 
> Ok. I can easily setup such a LUT. I know as well how to assign it as
a
> property to the rendering node. What would be interesting to me is,
how
> to tell the mapper, which would be the "mitk::PointSetVtkMapper3D" in
> my
> case, that it should use point IDs as indices to the LUT.
> 
> Cheers,
> Steffen
> 
> 
> >
> > Please let us know if this is what you want to do, so we could
> discuss
> > this in more detail!
> >
> > Regards,
> > Mathias
> >
> >
> >
> >> -----Original Message-----
> >> From: [EMAIL PROTECTED] [mailto:mitk-users-
> >> [EMAIL PROTECTED] On Behalf Of Steffen Oeltze
> >> Sent: Friday, February 29, 2008 9:49 AM
> >> To: [email protected]
> >> Subject: [mitk-users] mitkPointSet
> >>
> >> Hi,
> >>
> >> first of all, thanks to the MITK guys for the useful hints in the
> > past,
> >> especially concerning the event handling.
> >>
> >> My new question is, whether I can manipulate the color of the
points
> >> (spheres) in a mitkPointSet individually?
> >>
> >> Cheers,
> >> Steffen
> >>
> >>
> >>
> >>
> >>
> >>
> >
---------------------------------------------------------------------
> --
> >> --
> >> This SF.net email is sponsored by: Microsoft
> >> Defy all challenges. Microsoft(R) Visual Studio 2008.
> >> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> >> _______________________________________________
> >> mitk-users mailing list
> >> [email protected]
> >> https://lists.sourceforge.net/lists/listinfo/mitk-users
> >
> >
> >
> 


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
mitk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mitk-users

Reply via email to