[vtkusers] Reverse perspective for vtkGPUVolumeRayCastMapper
Simon ESNEAULT
simon.esneault at gmail.com
Mon May 6 07:41:13 EDT 2013
Hi all
In one of our application, we need to perform a fusion between
interventional fluoroscopic images and preoperative CT scan.
In order to achieve this, a reverse perspective ray cast volume rendering
is needed. This means we have to reverse the way x-ray are thrown (from the
focal point to the camera, and not the opposite).
The main principle is explained on this figure
<http://imgur.com/SmnDwPn> (found
on this article:
http://link.springer.com/content/pdf/10.1007%2F978-3-642-21504-9_2.pdf )
We were able to achieve this with the vtkFixedVolumeRayCastMapper,
by switching the lines 1788 and 1792 on the file
vtkFixedVolumeRayCastMapper.cxx of vtk 5.10.1
the code :
/*********************************************************************/
viewRay[2] = 0.0;
vtkVRCMultiplyPointMacro( viewRay, rayStart,
this->ViewToVoxelsArray );
viewRay[2] = this->RayCastImage->GetZBufferValue(x,y);
/*********************************************************************/
became :
/*********************************************************************/
viewRay[2] = this->RayCastImage->GetZBufferValue(x,y);
vtkVRCMultiplyPointMacro( viewRay, rayStart,
this->ViewToVoxelsArray );
viewRay[2] = 0.0;
/*********************************************************************/
The resulting images are these ones :
* Normal-Perspective View 1<http://imgur.com/Aoe9VxV,HfiwFU3,uaki4f6,UFXS9pH#0>
* Reverse-Perspective View 1<http://imgur.com/Aoe9VxV,HfiwFU3,uaki4f6,UFXS9pH#1>
* Normal-Perspective View 2<http://imgur.com/Aoe9VxV,HfiwFU3,uaki4f6,UFXS9pH#2>
* Reverse-Perspective View 2<http://imgur.com/Aoe9VxV,HfiwFU3,uaki4f6,UFXS9pH#3>
Which is exactly what we are trying to do.
Now we want to do the same with the vtkGPUVolumeRayCastMapper. I've tried
to hack the following files, especially the function trace() and
incrementalRayDirection() without success
vtkGPUVolumeRayCastMapper_CompositeFS.glsl
vtkGPUVolumeRayCastMapper_HeaderFS.glsl
vtkGPUVolumeRayCastMapper_PerspectiveProjectionFS.glsl
Does anyone has a clue on this ?
Thanks for reading, sorry for the frenglish
Simon
--
------------------------------------------------------------------
Simon Esneault - Therenva
Centre d'Innovation Technologique
Centre Cardio-Pneumologique
CHU Pontchaillou
Rennes, France
Tel : +33 (0)6 64 61 30 94
Mail : simon.esneault at therenva.com
------------------------------------------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20130506/205ad8a7/attachment.htm>
More information about the vtkusers
mailing list