|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.stanford.rsl.konrad.volume3d.VolumeOperator
edu.stanford.rsl.konrad.cuda.CUDAVolumeOperator
public class CUDAVolumeOperator
Class to implement all functions of VolumeOperator on CUDA hardware. Code is made CUDA compatible by replacing the VolumeOperator with CUDAVolumeOperator. As a result all code is executed on CUDA instead of the CPU. On good hardware usually a substantial speed-up is achieved. Development and debugging should be done using Volume3D, as CUDA problems are usually hard to debug.
VolumeOperator
Nested Class Summary |
---|
Nested classes/interfaces inherited from class edu.stanford.rsl.konrad.volume3d.VolumeOperator |
---|
VolumeOperator.FILTER_TYPE |
Constructor Summary | |
---|---|
CUDAVolumeOperator()
|
Method Summary | |
---|---|
int |
abs(Volume3D vol)
Determines the absolute volume of the input volume. If the input volume is real Math.abs() is called for each element. If the input volume is complex the power spectrum is computed. |
int |
addScalar(Volume3D vol,
float realPart,
float imagPart)
Adds a scalar to the Volume3D. |
int |
addVolume(Volume3D vol1,
Volume3D vol2)
Adds the second volume to the first volume. |
int |
addVolume(Volume3D vol1,
Volume3D vol2,
double weight)
Adds the second volume $y_j$ multiplied by the scalar weight $s$ to the first volume $x_j$. The first volume is overwritten. |
void |
cleanup()
|
Volume3D |
createDirectionalWeights(int dimensions,
int[] size,
float[] dim,
float[] dir,
int A,
VolumeOperator.FILTER_TYPE t_filt)
Creates an anisotropic, i.e. |
Volume3D |
createExponentialDirectionalHighPassFilter(int dimensions,
int[] size,
float[] dim,
float[] dir,
int A,
float B,
float ri,
VolumeOperator.FILTER_TYPE t_filt)
Creates an radially symetric anisotropic quadrature filter according to this definition: %preamble{\\usepackage{amsmath}} \\begin{align*} F(\\mathbf{u}) & = \\left \\{ \\begin{array}{ll} \\left(\\frac{\\displaystyle (\\mathbf{u} \\cdot \\hat{\\mathbf{n}}_k)}{\\displaystyle |\\rho|}\\right)^{2A} \\cdot R(\\rho)& \\text{if}\\qquad\\mathbf{u} \\cdot \\hat{\\mathbf{n}}_k >0 \\\\ 0 & \\text{else} \\end{array} \\right . |
Volume3D |
createGaussLowPassFilter(int dimensions,
int[] size,
float[] dim,
float alpha)
Creates an isotropic, i.e. |
Volume3D |
createHighPassFilter(int dimensions,
int[] size,
float[] dim,
int filt_loop,
float lp_upper)
Creates a directional high pass filter $F_{\displaystyle\text{HP}_k}(\mathbf{u}) = 1 - (R_\text{LP}(\rho) \cdot D_k(\mathbf{u}))$. |
Volume3D |
createLowPassFilter(int dimensions,
int[] size,
float[] dim,
float lp_upper)
Creates an isotropic low-pass filter, i.e. |
Volume3D |
createVolume(ij.ImagePlus image,
int mirror,
int cuty,
boolean uneven)
Creates a Volume3D Object from an ImagePlus. |
Volume3D |
createVolume(int[] size,
float[] dim,
int in_dim)
Creates a new empty volume according to the parameters. |
int |
divideByVolume(Volume3D vol1,
Volume3D vol2)
Divides the first volume by the second volume element by element |
int |
fftShift(Volume3D vol)
Performs the shift required for the FFT, i.e. |
void |
fill(Volume3D vol,
float number)
|
int |
imag(Volume3D vol)
Maps a complex volume onto its imaginary part. |
void |
initCUDA()
|
void |
makeComplex(Volume3D vol)
Makes the volume complex, i.e. |
float |
max(Volume3D vol)
Determines the maximum intensity of a pixel in the given volume. |
float |
mean(Volume3D vol)
Determines the arithmetic average $\mu$ of all $N = \prod_i d_i$ voxels $x_j$. |
float |
min(Volume3D vol)
Determines the minimum intensity of the volume. |
int |
minOfTwoVolumes(Volume3D vol1,
Volume3D vol2)
Determines the minimal volume element by element. The output is stored in the first volume. |
int |
multiply(Volume3D vol1,
Volume3D vol2)
Multiplies two volumes element by element. |
int |
multiplyScalar(Volume3D vol,
float realPart,
float imagPart)
Multiplies the volume by a scalar. |
int |
real(Volume3D vol)
Maps volume onto its real part. |
int |
sigmoid(Volume3D vol,
float smoothing,
float lowValue,
float highValue,
float highPassLowerLevel,
float highPassUpperLevel)
Remaps gray values using a sigmoid function. |
Volume3D |
solveMaximumEigenvalue(Volume3D[][] structureTensor)
Method to compute the maximal eigenvalue $\lambda_1$ per volume element for a volume structure tensor. |
int |
sqrt(Volume3D vol)
Replaces every element in the volume with the output of Math.sqrt(), i.e. |
int |
upperLimit(Volume3D vol,
float max)
Iterates the volume and replaces all entries greater than max with max. |
Methods inherited from class edu.stanford.rsl.konrad.volume3d.VolumeOperator |
---|
divideScalar, getFrequencyBoundings, subtractVolume |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CUDAVolumeOperator()
Method Detail |
---|
public void initCUDA()
public void cleanup()
public void fill(Volume3D vol, float number)
public int divideByVolume(Volume3D vol1, Volume3D vol2)
VolumeOperator
divideByVolume
in class VolumeOperator
vol1
- the first volumevol2
- the second volume
public Volume3D solveMaximumEigenvalue(Volume3D[][] structureTensor)
VolumeOperator
solveMaximumEigenvalue
in class VolumeOperator
structureTensor
- the structure tensor as 2D array of volumes.
public Volume3D createDirectionalWeights(int dimensions, int[] size, float[] dim, float[] dir, int A, VolumeOperator.FILTER_TYPE t_filt)
VolumeOperator
createDirectionalWeights
in class VolumeOperator
dimensions
- dimension should be 3size
- number of pixels per dimensiondim
- resolutiondir
- direction vector $\hat{\mathbf{n}}_k$A
- parameter At_filt
- filter type
public Volume3D createVolume(int[] size, float[] dim, int in_dim)
VolumeOperator
createVolume
in class VolumeOperator
size
- the sizes in each direction as arraydim
- the dimension of the pixel in mm in each directionin_dim
- the internal dimension (1 = real, 2 = complex)
public Volume3D createExponentialDirectionalHighPassFilter(int dimensions, int[] size, float[] dim, float[] dir, int A, float B, float ri, VolumeOperator.FILTER_TYPE t_filt)
VolumeOperator
createExponentialDirectionalHighPassFilter
in class VolumeOperator
dimensions
- dimension should be 3size
- number of pixels per dimensiondim
- resolutiondir
- the filter direction $\hat{\mathbf{n}}_k$A
- factor AB
- the relative bandwith of the filter Bri
- $\rho_i$t_filt
- parameter to
VolumeOperator.fftShift(Volume3D)
public int fftShift(Volume3D vol)
VolumeOperator
fftShift
in class VolumeOperator
vol
- the volume
public Volume3D createHighPassFilter(int dimensions, int[] size, float[] dim, int filt_loop, float lp_upper)
VolumeOperator
createHighPassFilter
in class VolumeOperator
dimensions
- dimension should be 3size
- number of pixels per dimensiondim
- resolutionfilt_loop
- $k$ for the creation of $\hat{\mathbf{n}}_k$lp_upper
- $\rho_\text{LP}$
VolumeOperator.fftShift(Volume3D)
,
VolumeOperator.createDirectionalWeights(int, int[], float[], float[], int, FILTER_TYPE)
public int multiply(Volume3D vol1, Volume3D vol2)
VolumeOperator
multiply
in class VolumeOperator
vol1
- the first volumevol2
- the second volume
public Volume3D createVolume(ij.ImagePlus image, int mirror, int cuty, boolean uneven)
VolumeOperator
createVolume
in class VolumeOperator
image
- the ImagePlus with the image datamirror
- the number of pixels which are mirrored at the boundarycuty
- number of pixels to be cut from the ImagePlus (in order to remove emtpy areas at the top and the bottom of the imageuneven
- true if the original number of slices was uneven (may have been altered by cutting y)
Volume3D#Volume3D(ImagePlus, double, double, double, int, int, boolean)
public void makeComplex(Volume3D vol)
VolumeOperator
makeComplex
in class VolumeOperator
vol
- the volumepublic Volume3D createLowPassFilter(int dimensions, int[] size, float[] dim, float lp_upper)
VolumeOperator
createLowPassFilter
in class VolumeOperator
dimensions
- dimension should be 3size
- number of pixels per dimensiondim
- resolutionlp_upper
- $\rho_\text{LP}$
VolumeOperator.fftShift(Volume3D)
public Volume3D createGaussLowPassFilter(int dimensions, int[] size, float[] dim, float alpha)
VolumeOperator
createGaussLowPassFilter
in class VolumeOperator
VolumeOperator.fftShift(Volume3D)
public int sigmoid(Volume3D vol, float smoothing, float lowValue, float highValue, float highPassLowerLevel, float highPassUpperLevel)
VolumeOperator
sigmoid
in class VolumeOperator
vol
- the volumesmoothing
- slope of sigmoidlowValue
- the lower input limithighValue
- the upper input limithighPassLowerLevel
- the lower output valuehighPassUpperLevel
- the upper output value
public int addVolume(Volume3D vol1, Volume3D vol2)
VolumeOperator
addVolume
in class VolumeOperator
vol1
- the first volumevol2
- the second volume
public int real(Volume3D vol)
VolumeOperator
real
in class VolumeOperator
vol
- the volume to be mapped.
public int imag(Volume3D vol)
VolumeOperator
imag
in class VolumeOperator
vol
- the volume
public int addVolume(Volume3D vol1, Volume3D vol2, double weight)
VolumeOperator
addVolume
in class VolumeOperator
vol1
- the first volume $x_j$vol2
- the second volume $y_j$weight
- the weighting factor $s$
public float min(Volume3D vol)
VolumeOperator
min
in class VolumeOperator
vol
- the volume
public int minOfTwoVolumes(Volume3D vol1, Volume3D vol2)
VolumeOperator
minOfTwoVolumes
in class VolumeOperator
vol1
- the first volumevol2
- the second volume
public float mean(Volume3D vol)
VolumeOperator
mean
in class VolumeOperator
vol
- the volume
public float max(Volume3D vol)
VolumeOperator
max
in class VolumeOperator
vol
- the volume
public int addScalar(Volume3D vol, float realPart, float imagPart)
VolumeOperator
addScalar
in class VolumeOperator
vol
- the volumerealPart
- the real partimagPart
- the imaginary part
VolumeOperator.makeComplex(Volume3D)
public int abs(Volume3D vol)
VolumeOperator
abs
in class VolumeOperator
vol
- the input volume.
public int multiplyScalar(Volume3D vol, float realPart, float imagPart)
VolumeOperator
multiplyScalar
in class VolumeOperator
vol
- the volumerealPart
- the real part of the scalarimagPart
- the imaginary part of the scalar
VolumeOperator.makeComplex(Volume3D)
public int sqrt(Volume3D vol)
VolumeOperator
sqrt
in class VolumeOperator
vol
- the volume to be processed.
public int upperLimit(Volume3D vol, float max)
VolumeOperator
upperLimit
in class VolumeOperator
vol
- the volumemax
- the maximum
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |