[vtkusers] Reverse Perspective
Simon ESNEAULT
simon.esneault at gmail.com
Tue May 14 03:56:43 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 Esneault
13 rue Vasselot
35000 Rennes, France
Tel : 06 64 61 30 94
Mail : simon.esneault at gmail.com
------------------------------------------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20130514/2eb1e2a9/attachment.htm>
More information about the vtkusers
mailing list