edu.stanford.rsl.konrad.cuda
Class CUDAForwardProjector

java.lang.Object
  extended by edu.stanford.rsl.konrad.cuda.CUDAForwardProjector
All Implemented Interfaces:
Citeable, GUIConfigurable

public class CUDAForwardProjector
extends java.lang.Object
implements GUIConfigurable, Citeable

Forward projection expects input of a volumetric phantom scaled to mass density. Projection result $p(\vec{x})$ is then the accumulated mass along the ray $\vec{x}$ which consists of the line segments $x_i$ in $[\textnormal{cm}]$ with the mass densities $\mu_i$ in $[\frac{\textnormal{g}}{\textnormal{cm}^3}]$. The actual projection is then computed as:
$$p(\vec{x}) = \sum_{i} x_i \cdot \mu_i$$
The projection values are then returned in $[\frac{\textnormal{g}}{\textnormal{cm}^2}]$

Author:
akmaier

Constructor Summary
CUDAForwardProjector()
           
 
Method Summary
 void computeCanonicalProjectionMatrix(float[] canonicalProjMatrix, float[] invARmatrix, float[] srcPoint, Jama.Matrix projectionMatrix)
          Method: computeCanonicalProjectionMatrix
Author: Sungwon Yoon
Description:
 void configure()
          Start GUI configuration.
 java.lang.String getBibtexCitation()
          Returns a reference to literature describing this algorithm in Bibtex format
 java.lang.String getMedlineCitation()
          Returns a reference to literature describing this algorithm in Medline
 ij.ImagePlus getTex3D()
          Gets the volume to project
 boolean isConfigured()
          returns whether the projector was already configured or not.
 ij.ImagePlus project()
          Starts projection and returns Projection Data, as ImagePlus
 void setTex3D(ij.ImagePlus tex3d)
          Sets the volume to project
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CUDAForwardProjector

public CUDAForwardProjector()
Method Detail

getTex3D

public ij.ImagePlus getTex3D()
Gets the volume to project

Returns:
the volume as image plus

setTex3D

public void setTex3D(ij.ImagePlus tex3d)
Sets the volume to project

Parameters:
tex3d -

computeCanonicalProjectionMatrix

public void computeCanonicalProjectionMatrix(float[] canonicalProjMatrix,
                                             float[] invARmatrix,
                                             float[] srcPoint,
                                             Jama.Matrix projectionMatrix)
Method: computeCanonicalProjectionMatrix
Author: Sungwon Yoon
Description:
 
         W -> W projection matrix = [ AR   t ]
         C -> C projection matrix = T0 * [AR  t] * T4
                 
                                 [ [ du(0)  dv(0) ]^-1   -0.5 ]
                where      T0 =  [ [ du(1)  dv(1) ]      -0.5 ]  
                                 [     0      0            1  ]      ,

                                 [  dx   0    0   -(L-1)/2*dx  ]
                           T4 =  [  0   dy    0   -(M-1)/2*dy  ]
                                 [  0    0   dz   -(N-1)/2*dz  ]
                                 [  0    0    0         1      ]
  
C -> C projection matrix can be written as
        C -> C projection matrix = [ T0 * AR * T4(1:3,1:3)    T0 * (AR * T4(1:3,4) + t) ] 
  
  Therefore, the new invARmatrix = T4(1:3,1:3)^-1 * (AR)^-1 * T0^-1
                                   [ 1/dx    0      0   ]             [du(0)  dv(0)  0.5*(du(0)+dv(0))]
                                 = [  0     1/dy    0   ] * (AR)^-1 * [du(1)  dv(1)  0.5*(du(1)+dv(1))]
                                   [  0      0     1/dz ]             [  0      0              1      ]

            and the new srcPoint = -T4(1:3,1:3)^-1 * T4(1:3,4) - T4(1:3,1:3)^-1 * (AR)^-1 * t
                                   [ 0.5 * (L-1) ]     [ 1/dx    0      0   ]
                                 = [ 0.5 * (M-1) ]  +  [  0     1/dy    0   ] * srcPoint^{W}
                                   [ 0.5 * (N-1) ]     [  0      0     1/dz ]
  

Parameters:
canonicalProjMatrix - is filled with a 3x4 projection matrix in this canonical format
invARmatrix - is filled with the inverse of AR in canonical format
srcPoint - is filled with the 3x1 source point in canonical format
projectionMatrix - the Matrix on which the conversion is based.

project

public ij.ImagePlus project()
Starts projection and returns Projection Data, as ImagePlus

Returns:
the projection stack

configure

public void configure()
               throws java.lang.Exception
Start GUI configuration. Reads from global Configuration.

Specified by:
configure in interface GUIConfigurable
Throws:
java.lang.Exception - may happen

isConfigured

public boolean isConfigured()
returns whether the projector was already configured or not.

Specified by:
isConfigured in interface GUIConfigurable
Returns:
configured?

getBibtexCitation

public java.lang.String getBibtexCitation()
Returns a reference to literature describing this algorithm in Bibtex format

Specified by:
getBibtexCitation in interface Citeable
Returns:
citation as String

getMedlineCitation

public java.lang.String getMedlineCitation()
Returns a reference to literature describing this algorithm in Medline

Specified by:
getMedlineCitation in interface Citeable
Returns:
citation as String