[Insight-users] Re: [vtkusers] getting the brightest pixel?

Benjamin King king . benjamin at mh-hannover . de
Tue, 26 Aug 2003 08:52:54 +0100


Hi Nico,

> I am using vtkVolumeRayCastMIPFunction and that shows the maximum values 
> nicely, but...

Do you use it alone or together with a vtkVolumeRayCastMapper? The mapper 
uses the function's CastRay(vtkVolumeRayCastDynamicInfo *dynamic, 
vtkVolumeRayCastStaticInfo *static) method on each pixel. You'll be 
interested in the dynamic info. dynamic->NumberOfStepsTaken * dynamic- 
>TransformedIncrement + dynamic->TransformedStart will probably be what you 
want, but I'm not quite sure, because I worked with 
vtkVolumeRayCastCompositeFunction.


Another option might be using the Z-Buffer. vtkRenderer implements the 
following methods:

	float GetZ(int pixelX, int pixelY)
or
	PickProp(float x, float y)
	GetPickedZ()
and also
	SetDisplayPoint(...)
	DisplayToWorld(...)
	GetWorldPoint(...)

If you don't mind to let the vtkVolumeRayCastMapper do the cumbersome 
handling of the vtkVolumeRayCastMIPFunction, you can use some combination 
of these methods to get the world coordinates for the pixel you want.


Best regards,
  Benjamin

-- 
Benjamin King
Institut für Medizinische Informatik
Medizinische Hochschule Hannover
Tel.: +49  511  532-2663