public class VolumeOperator
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
VolumeOperator.FILTER_TYPE
Sets the behavior of the filter.
|
Constructor and Description |
---|
VolumeOperator() |
Modifier and Type | Method and Description |
---|---|
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
![]() ![]() ![]() The first volume is overwritten. |
Volume3D |
createDirectionalWeights(int dimensions,
int[] size,
float[] spacing,
float[] dir,
int A,
VolumeOperator.FILTER_TYPE t_filt)
Creates an anisotropic, i.e.
|
Volume3D |
createExponentialDirectionalHighPassFilter(int dimensions,
int[] size,
float[] spacing,
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[] spacing,
float alpha)
Creates an isotropic, i.e.
|
Volume3D |
createHighPassFilter(int dimensions,
int[] size,
float[] spacing,
int filt_loop,
float lp_upper)
Creates a directional high pass filter
![]() |
Volume3D |
createLowPassFilter(int dimensions,
int[] size,
float[] spacing,
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[] spacing,
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 |
divideScalar(Volume3D vol,
float realPart,
float imagPart)
Divides the volume by a scalar.
|
int |
fftShift(Volume3D vol)
Performs the shift required for the FFT, i.e.
|
static void |
getFrequencyBoundings(int dimensions,
int[] size,
float[] spacing,
float[] f_max,
float[] f_delta)
Computes the maximal frequency for each dimension as
![]() ![]() ![]() ![]() ![]() ![]() Method currently applies C-style passing of return values. |
int |
imag(Volume3D vol)
Maps a complex volume onto its imaginary part.
|
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
![]() ![]() ![]() |
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
![]() |
int |
sqrt(Volume3D vol)
Replaces every element in the volume with the output of Math.sqrt(), i.e.
|
int |
subtractVolume(Volume3D vol1,
Volume3D vol2)
Subtracts the second volume from the first volume.
|
int |
upperLimit(Volume3D vol,
float max)
Iterates the volume and replaces all entries greater than max with max.
|
public static void getFrequencyBoundings(int dimensions, int[] size, float[] spacing, float[] f_max, float[] f_delta)
dimensions
- the number of dimension of the volumesize
- an array containing spacing
- an array containing f_max
- the return values for f_delta
- the return values for public Volume3D solveMaximumEigenvalue(Volume3D[][] structureTensor)
structureTensor
- the structure tensor as 2D array of volumes.public Volume3D createDirectionalWeights(int dimensions, int[] size, float[] spacing, float[] dir, int A, VolumeOperator.FILTER_TYPE t_filt)
dimensions
- dimension should be 3size
- number of pixels per dimensionspacing
- resolutiondir
- direction vector A
- parameter At_filt
- filter typepublic Volume3D createVolume(int[] size, float[] spacing, int in_dim)
size
- the sizes in each direction as arrayspacing
- the spacing of the pixels in mm in each directionin_dim
- the internal dimension (1 = real, 2 = complex)public Volume3D createVolume(ij.ImagePlus image, int mirror, int cuty, boolean uneven)
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, int, int, boolean)
public Volume3D createExponentialDirectionalHighPassFilter(int dimensions, int[] size, float[] spacing, float[] dir, int A, float B, float ri, VolumeOperator.FILTER_TYPE t_filt)
dimensions
- dimension should be 3size
- number of pixels per dimensionspacing
- resolutiondir
- the filter direction A
- factor AB
- the relative bandwith of the filter Bri
- t_filt
- parameter tofftShift(Volume3D)
public Volume3D createHighPassFilter(int dimensions, int[] size, float[] spacing, int filt_loop, float lp_upper)
dimensions
- dimension should be 3size
- number of pixels per dimensionspacing
- resolutionfilt_loop
- lp_upper
- fftShift(Volume3D)
,
createDirectionalWeights(int, int[], float[], float[], int, FILTER_TYPE)
public Volume3D createLowPassFilter(int dimensions, int[] size, float[] spacing, float lp_upper)
dimensions
- dimension should be 3size
- number of pixels per dimensionspacing
- resolutionlp_upper
- fftShift(Volume3D)
public Volume3D createGaussLowPassFilter(int dimensions, int[] size, float[] spacing, float alpha)
fftShift(Volume3D)
public float mean(Volume3D vol)
vol
- the volumepublic float max(Volume3D vol)
vol
- the volumepublic float min(Volume3D vol)
vol
- the volumepublic int multiplyScalar(Volume3D vol, float realPart, float imagPart)
vol
- the volumerealPart
- the real part of the scalarimagPart
- the imaginary part of the scalarmakeComplex(Volume3D)
public void makeComplex(Volume3D vol)
vol
- the volumepublic int divideScalar(Volume3D vol, float realPart, float imagPart)
vol
- the volumerealPart
- the real part of the scalarimagPart
- the imaginary part of the scalarmakeComplex(Volume3D)
public int addScalar(Volume3D vol, float realPart, float imagPart)
vol
- the volumerealPart
- the real partimagPart
- the imaginary partmakeComplex(Volume3D)
public int multiply(Volume3D vol1, Volume3D vol2)
vol1
- the first volumevol2
- the second volumepublic int divideByVolume(Volume3D vol1, Volume3D vol2)
vol1
- the first volumevol2
- the second volumepublic int addVolume(Volume3D vol1, Volume3D vol2)
vol1
- the first volumevol2
- the second volumepublic int addVolume(Volume3D vol1, Volume3D vol2, double weight)
vol1
- the first volume vol2
- the second volume weight
- the weighting factor public int subtractVolume(Volume3D vol1, Volume3D vol2)
vol1
- the first volumevol2
- the second volumepublic int minOfTwoVolumes(Volume3D vol1, Volume3D vol2)
vol1
- the first volumevol2
- the second volumepublic int abs(Volume3D vol)
vol
- the input volume.public int sqrt(Volume3D vol)
vol
- the volume to be processed.public int real(Volume3D vol)
vol
- the volume to be mapped.public int fftShift(Volume3D vol)
vol
- the volumepublic int sigmoid(Volume3D vol, float smoothing, float lowValue, float highValue, float highPassLowerLevel, float highPassUpperLevel)
vol
- the volumesmoothing
- slope of sigmoidlowValue
- the lower input limithighValue
- the upper input limithighPassLowerLevel
- the lower output valuehighPassUpperLevel
- the upper output valuepublic int upperLimit(Volume3D vol, float max)
vol
- the volumemax
- the maximumpublic int imag(Volume3D vol)
vol
- the volume