edu.stanford.rsl.konrad.filtering.multiprojection.anisotropic
Class AnisotropicFilterFunction

java.lang.Object
  extended by edu.stanford.rsl.konrad.filtering.multiprojection.anisotropic.AnisotropicFilterFunction

public class AnisotropicFilterFunction
extends java.lang.Object

Class to process a Volume3D with an anisotropic structure tensor filter.

Author:
akmaier

Field Summary
static int MAX_FILTERS
           
 
Constructor Summary
AnisotropicFilterFunction(FFTVolumeHandle fft, VolumeOperator op)
           
 
Method Summary
 Volume3D[] computeAnisotropicFilteredVolume(Volume3D volume, float low, float high, float hp_lower_level, float hp_upper_level, float smth, int A, float B, float ri, float a, float lpUpper)
           
 Volume3D[][] computeStructureTensor(Volume3D vol, int A, float B, float ri)
           
static int filt_calc_Nk_I(int dimensions, int k, float[][] t_coeff)
          Computes the orientation tensor $\mathbf{M}_k = l\mathbf{\hat{n}}_k\mathbf{\hat{n}}_k^\top-m\mathbf{I}$, where k is the index of the filter direction, $\mathbf{I}$ is the identity matrix, $\mathbf{\hat{n}}_k$ the orientation of the filter.
 void filt_gauss_relax_tensors(Volume3D[][] vol, float a)
           
static int filt_get_filt_dirs(int dimensions, float[][] fd)
          Computes the filter directions.
static int filt_get_n_filters(int dimensions)
           
 Volume3D filt_normalize_tensors(Volume3D[][] structureTensor, int eig)
          Normalizes the tensors and computes the tensor nor.
 Volume3D[] filt_pre_enhance(Volume3D volume, int A, float B, float ri, float a, float lpUpper)
          Computes an array of filtered images.
 VolumeOperator getVolumeOperator()
          Returns the VolumeOperator of the filter.
 void setShowStatus(boolean showStatus)
           
 void setThreadNumber(int number)
          Method to limit the number of threads used by the FFT of the filter.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAX_FILTERS

public static final int MAX_FILTERS
See Also:
Constant Field Values
Constructor Detail

AnisotropicFilterFunction

public AnisotropicFilterFunction(FFTVolumeHandle fft,
                                 VolumeOperator op)
Method Detail

setShowStatus

public void setShowStatus(boolean showStatus)

setThreadNumber

public void setThreadNumber(int number)
Method to limit the number of threads used by the FFT of the filter.

Parameters:
number -

filt_gauss_relax_tensors

public void filt_gauss_relax_tensors(Volume3D[][] vol,
                                     float a)

computeStructureTensor

public Volume3D[][] computeStructureTensor(Volume3D vol,
                                           int A,
                                           float B,
                                           float ri)

filt_get_n_filters

public static int filt_get_n_filters(int dimensions)

filt_get_filt_dirs

public static int filt_get_filt_dirs(int dimensions,
                                     float[][] fd)
Computes the filter directions. Result is written into @param fd

Parameters:
dimensions - the number of dimensions
fd - the result
Returns:
a return variable

filt_calc_Nk_I

public static int filt_calc_Nk_I(int dimensions,
                                 int k,
                                 float[][] t_coeff)
Computes the orientation tensor $\mathbf{M}_k = l\mathbf{\hat{n}}_k\mathbf{\hat{n}}_k^\top-m\mathbf{I}$, where k is the index of the filter direction, $\mathbf{I}$ is the identity matrix, $\mathbf{\hat{n}}_k$ the orientation of the filter. l is 4/3 for 2D and 5/4 for 3D, m is 1/3 for 2D and 1/4 for 3D.

Parameters:
dimensions - the filter dimension
k - the filter index
t_coeff - the orientation tensor.
Returns:
0

filt_normalize_tensors

public Volume3D filt_normalize_tensors(Volume3D[][] structureTensor,
                                       int eig)
Normalizes the tensors and computes the tensor nor. Note that the norm is computed BEFORE the normalization. Computes $\mathbf{\hat{T}} = \frac{\mathbf{T}}{{\lambda_1}}$ with ${\lambda_1}$ begin the normalization factor. It is the either the trace or the largest eigenvalue of the vector. Furthermore, the method returns the L2-norm of the tensor $|\mathbf{T}|$

Parameters:
structureTensor - the reference to the structure tensor
eig - if eig == 1 the maximal eigenvalue is used for normalization else the norm is performed using the tensor trace.
Returns:
the tensor norm before normalization.

filt_pre_enhance

public Volume3D[] filt_pre_enhance(Volume3D volume,
                                   int A,
                                   float B,
                                   float ri,
                                   float a,
                                   float lpUpper)
Computes an array of filtered images. The entry at [0] contains the low pass filtered image. The entry at [1] contains the largest eigenvalues of the structure tensors computed at each voxel of the volume. Enrty [2] contains the directional high pass filtered image.

Parameters:
volume - the volume to process
A -
B -
ri -
a -
lpUpper - low pass frequency.
Returns:
the array of volumes.

computeAnisotropicFilteredVolume

public Volume3D[] computeAnisotropicFilteredVolume(Volume3D volume,
                                                   float low,
                                                   float high,
                                                   float hp_lower_level,
                                                   float hp_upper_level,
                                                   float smth,
                                                   int A,
                                                   float B,
                                                   float ri,
                                                   float a,
                                                   float lpUpper)

getVolumeOperator

public VolumeOperator getVolumeOperator()
Returns the VolumeOperator of the filter.

Returns:
the VolumeOperator