Functions

Discrete Radon Transforms

Functions

NTTW_DLL_SYM nttw_integer getIsum (nttw_integer *radon, const size_t n)
 Returns the Isum of the FRT space.
NTTW_DLL_SYM double getIsum_double (double *radon, const size_t n)
 Returns the Isum of the FRT space as a double.
NTTW_DLL_SYM nttw_integer getIsum_Integer (nttw_integer *radon, const size_t n, const nttw_integer modulus)
 Returns the Isum (modulo the given modulus) of the FRT space.
NTTW_DLL_SYM void drt (const nttw_integer *field, nttw_integer *bins, const int p)
 The Discrete Radon Transform (DRT) of Matus & Flusser, 1993 for 2D arrays. O(n^3).
NTTW_DLL_SYM void drt_dyadic (const nttw_integer *field, nttw_integer *bins, const int n)
 The Dyadic Discrete Radon Transform (DRT) of Hsung et al, 1996 for 2D arrays. O(n^3).
NTTW_DLL_SYM void drt_blockcopy (nttw_integer *datain, nttw_integer *dataout, const int p)
 The Discrete Radon Transform (FRT) of Matus & Flusser, 1993 for 2D arrays. This function uses the intelligent block copy method developed by Imants Svalbe.
NTTW_DLL_SYM void frt (nttw_integer *field, nttw_integer *bins, const int p)
 The Fast Radon Transform (FRT) of Matus & Flusser, 1993 for 2D arrays. Fourier Slice Theorem version. Complexity is linear logarithmic in time (same as a 2D FFT). This is for prime lengths.
NTTW_DLL_SYM void frt_double (double *field, double *bins, const int p)
 The Fast Radon Transform (FRT) of Matus & Flusser, 1993 for 2D arrays. Fourier Slice Theorem version. Complexity is linear logarithmic in time (same as a 2D FFT). This is for prime lengths.
NTTW_DLL_SYM void frt_dyadic (nttw_integer *field, nttw_integer *bins, const int n)
 The Dyadic Fast Radon Transform (FRT) of Hsung et al, 1996 for 2D arrays. Fourier Slice Theorem version. Complexity is linear logarithmic in time (same as a 2D FFT).
NTTW_DLL_SYM void frt_dyadic_double (double *field, double *bins, const int n)
 The Dyadic Fast Radon Transform (FRT) of Hsung et al, 1996 for 2D arrays. Fourier Slice Theorem version. Complexity is linear logarithmic in time (same as a 2D FFT).
NTTW_DLL_SYM void frt_dyadic_signed (long *field, long *bins, const int n)
 The Dyadic Fast Radon Transform (FRT) of Hsung et al, 1996 for 2D arrays. Fourier Slice Theorem version. Complexity is linear logarithmic in time (same as a 2D FFT).
NTTW_DLL_SYM nttw_integer idrt (nttw_integer *bins, nttw_integer *result, const int p)
 The Inverse Discrete Radon Transform (iDRT) of Matus & Flusser, 1993 for 2D arrays. O(n^3).
NTTW_DLL_SYM nttw_integer idrt_blockcopy (nttw_integer *datain, nttw_integer *dataout, const int p)
 The Inverse Discrete Radon Transform (iDRT) of Matus & Flusser, 1993 for 2D arrays. This function uses the intelligent block copy method developed by Imants Svalbe. Note m=0 and m=p projections are interchanged in comparision to other DRT functions!
NTTW_DLL_SYM nttw_integer ifrt (nttw_integer *bins, nttw_integer *result, const int p, const int norm)
 The Inverse Fast Radon Transform (iFRT) of Matus & Flusser, 1993 for 2D arrays. Fourier Slice Theorem version. Complexity is linear logarithmic in time (same as a 2D FFT).
NTTW_DLL_SYM double ifrt_double (double *bins, double *result, const int p, const int norm)
 The Inverse Fast Radon Transform (iFRT) of Matus & Flusser, 1993 for 2D arrays. Fourier Slice Theorem version. Complexity is linear logarithmic in time (same as a 2D FFT).
NTTW_DLL_SYM nttw_integer ifrt_signed (nttw_integer *bins, long *result, const int p, const int norm)
 The Inverse Fast Radon Transform (iFRT) of Matus & Flusser, 1993 for 2D arrays. Fourier Slice Theorem version. Complexity is linear logarithmic in time (same as a 2D FFT).
NTTW_DLL_SYM nttw_integer ifrt_dyadic (nttw_integer *bins, nttw_integer *result, const int n, const int norm)
 The Inverse Dyadic Fast Radon Transform (FRT) of Hsung et al, 1996 for 2D arrays. Fourier Slice Theorem version. Complexity is linear logarithmic in time (same as a 2D FFT).
NTTW_DLL_SYM double ifrt_dyadic_double (double *bins, double *result, const int n, const int norm)
 The Inverse Dyadic Fast Radon Transform (FRT) of Hsung et al, 1996 for 2D arrays. Fourier Slice Theorem version. Complexity is linear logarithmic in time (same as a 2D FFT).
NTTW_DLL_SYM nttw_integer ifrt_dyadic_signed (nttw_integer *bins, long *result, const int n, const int norm)
 The Inverse Dyadic Fast Radon Transform (FRT) of Hsung et al, 1996 for 2D arrays. Fourier Slice Theorem version. Complexity is linear logarithmic in time (same as a 2D FFT).
NTTW_DLL_SYM nttw_integer ifrt_dyadic_signed2 (long *bins, long *result, const int n, const int norm)
 The Inverse Dyadic Fast Radon Transform (FRT) of Hsung et al, 1996 for 2D arrays. Fourier Slice Theorem version. Complexity is linear logarithmic in time (same as a 2D FFT). Complete signed array version.
NTTW_DLL_SYM void getSlice (int m, fftw_complex *data, fftw_complex *slice, const int size)
 Extracts the slice at slope m within the FFT space given by data.
NTTW_DLL_SYM void getSlice_Perp (int s, fftw_complex *data, fftw_complex *slice, const int size)
 Extracts the slice at (perp) slope s within the FFT space given by data.
NTTW_DLL_SYM void setSlice (int m, fftw_complex *data, fftw_complex *slice, const int size)
 Sets the slice at slope m within the FFT space given by data.
NTTW_DLL_SYM void setSlice_Perp (int s, fftw_complex *data, fftw_complex *slice, const int size)
 Sets the slice at (perp) slope s within the FFT space given by data.
NTTW_DLL_SYM void dyadic_oversample (nttw_big_integer *data, const int n)
 Constructs the oversample filter required to make FFT space isotropic for dyadic sizes.
NTTW_DLL_SYM void dyadic_1D_filter (nttw_big_integer *data, const int n)
 Constructs the 1D oversample filter required to make FFT space isotropic for dyadic sizes.
NTTW_DLL_SYM void filter_oversampling (fftw_complex *fftSpace, nttw_big_integer *samples, const int n)
 Filters the oversampling within the FFT space for dyadic sizes given by the filter.

Function Documentation

drt ( const nttw_integer *  field,
nttw_integer *  bins,
const int  p 
)

The Discrete Radon Transform (DRT) of Matus & Flusser, 1993 for 2D arrays. O(n^3).

Author:
Shekhar S. Chandra, 2009
Parameters:
field Contains the data to be transformed. Must be p by p array.
bins It is assumed that this is already a pointer that has memory is allocated for each bin. The function only does internal initializing with no allocation. It must have size of p+1 by p.
p The prime which is the size of the square array.

Init

Get Projections where m denotes projection number

Projection angle

Row

Compute Row

Translate

Compute Column (in 1D)

< Next pixel

Columns

Translate

Definition at line 70 of file radon.c.

drt_blockcopy ( nttw_integer *  datain,
nttw_integer *  dataout,
const int  p 
)

The Discrete Radon Transform (FRT) of Matus & Flusser, 1993 for 2D arrays. This function uses the intelligent block copy method developed by Imants Svalbe.

Author:
Andrew Kingston & Imants Svalbe, 2005.

Note that the definition of the m=p projection is non-standard compared to other routines in the libraries.

Parameters:
datain Contains the data to be transformed. Must be p by p array in 1D form.
dataout It is assumed that this is already a pointer that has memory is allocated for each pixel. The function only does internal initializing with no allocation. It must have size of p+1 by p.
p The prime which is the size of the square array.

variables /

Initialise /

transform m = 0 /

transform (1 < m < p-1)

Definition at line 129 of file radon.c.

drt_dyadic ( const nttw_integer *  field,
nttw_integer *  bins,
const int  n 
)

The Dyadic Discrete Radon Transform (DRT) of Hsung et al, 1996 for 2D arrays. O(n^3).

Author:
Shekhar S. Chandra, 2009
Parameters:
field Contains the data to be transformed. Must be n by n array.
bins It is assumed that this is already a pointer that has memory is allocated for each bin. The function only does internal initializing with no allocation. It must have size of n+n/2 by n.
n The dyadic length (32,64,...512,1024,2048,...) which is the size of the square array.

Init

Get Projections where m denotes projection number

Projection angle

Row

Compute Row

Translate

Compute Column (in 1D)

< Next pixel

Perp Projection Angle

Column

Translate

Compute Row (in 1D)

< Next pixel

Definition at line 95 of file radon.c.

dyadic_1D_filter ( nttw_big_integer *  data,
const int  n 
)

Constructs the 1D oversample filter required to make FFT space isotropic for dyadic sizes.

Definition at line 1141 of file radon.c.

dyadic_oversample ( nttw_big_integer *  data,
const int  n 
)

Constructs the oversample filter required to make FFT space isotropic for dyadic sizes.

Definition at line 1116 of file radon.c.

filter_oversampling ( fftw_complex *  fftSpace,
nttw_big_integer *  samples,
const int  n 
)

Filters the oversampling within the FFT space for dyadic sizes given by the filter.

Use the dyadic_oversample() function to construct the filter.

Correct Coefficients

Correct Coefficients

Definition at line 1152 of file radon.c.

frt ( nttw_integer *  field,
nttw_integer *  bins,
const int  p 
)

The Fast Radon Transform (FRT) of Matus & Flusser, 1993 for 2D arrays. Fourier Slice Theorem version. Complexity is linear logarithmic in time (same as a 2D FFT). This is for prime lengths.

Author:
Shekhar S. Chandra, 2008
Parameters:
field Contains the data to be transformed. Must be p by p array.
bins It is assumed that this is already a pointer that has memory is allocated for each bin. The function only does internal initializing with no allocation. It must have size of p+1 by p.
p The prime which is the size of the square array.

FFT image

Extract slices

Clean up

Definition at line 175 of file radon.c.

frt_double ( double *  field,
double *  bins,
const int  p 
)

The Fast Radon Transform (FRT) of Matus & Flusser, 1993 for 2D arrays. Fourier Slice Theorem version. Complexity is linear logarithmic in time (same as a 2D FFT). This is for prime lengths.

This function is the double version. There is minimal rounding and casting between the FFT and the image.

Author:
Shekhar S. Chandra, 2009-10
Parameters:
field Contains the data to be transformed. Must be p by p array.
bins It is assumed that this is already a pointer that has memory is allocated for each bin. The function only does internal initializing with no allocation. It must have size of p+1 by p.
p The prime which is the size of the square array.

FFT image

Copy data to real part

Extract slices

Clean up

Definition at line 211 of file radon.c.

frt_dyadic ( nttw_integer *  field,
nttw_integer *  bins,
const int  n 
)

The Dyadic Fast Radon Transform (FRT) of Hsung et al, 1996 for 2D arrays. Fourier Slice Theorem version. Complexity is linear logarithmic in time (same as a 2D FFT).

Author:
Shekhar S. Chandra, 2009
Parameters:
field Contains the data to be transformed. Must be n by n array.
bins It is assumed that this is already a pointer that has memory is allocated for each bin. The function only does internal initializing with no allocation. It must have size of n+n/2 by n.
n The dyadic size which is the size of the square array.

FFT image

Extract slices

Clean up

Definition at line 248 of file radon.c.

frt_dyadic_double ( double *  field,
double *  bins,
const int  n 
)

The Dyadic Fast Radon Transform (FRT) of Hsung et al, 1996 for 2D arrays. Fourier Slice Theorem version. Complexity is linear logarithmic in time (same as a 2D FFT).

This function is the double version. There is minimal rounding and casting between the FFT and the image.

Author:
Shekhar S. Chandra, 2009
Parameters:
field Contains the data to be transformed. Must be n by n array.
bins It is assumed that this is already a pointer that has memory is allocated for each bin. The function only does internal initializing with no allocation. It must have size of n+n/2 by n.
n The dyadic size which is the size of the square array.

FFT image

Copy data to real part

Extract slices

Clean up

Definition at line 309 of file radon.c.

frt_dyadic_signed ( long *  field,
long *  bins,
const int  n 
)

The Dyadic Fast Radon Transform (FRT) of Hsung et al, 1996 for 2D arrays. Fourier Slice Theorem version. Complexity is linear logarithmic in time (same as a 2D FFT).

Author:
Shekhar S. Chandra, 2009
Parameters:
field Contains the signed data to be transformed. Must be n by n array.
bins It is assumed that this is already a pointer that has memory is allocated for each bin. The function only does internal initializing with no allocation. It must have size of n+n/2 by n.
n The dyadic size which is the size of the square array.

FFT image

Extract slices

Clean up

Definition at line 371 of file radon.c.

getIsum ( nttw_integer *  radon,
const size_t  n 
)

Returns the Isum of the FRT space.

Definition at line 34 of file radon.c.

getIsum_double ( double *  radon,
const size_t  n 
)

Returns the Isum of the FRT space as a double.

Definition at line 45 of file radon.c.

getIsum_Integer ( nttw_integer *  radon,
const size_t  n,
const nttw_integer  modulus 
)

Returns the Isum (modulo the given modulus) of the FRT space.

Definition at line 56 of file radon.c.

getSlice ( int  m,
fftw_complex *  data,
fftw_complex *  slice,
const int  size 
)

Extracts the slice at slope m within the FFT space given by data.

Definition at line 1030 of file radon.c.

getSlice_Perp ( int  s,
fftw_complex *  data,
fftw_complex *  slice,
const int  size 
)

Extracts the slice at (perp) slope s within the FFT space given by data.

Definition at line 1056 of file radon.c.

idrt ( nttw_integer *  bins,
nttw_integer *  result,
const int  p 
)

The Inverse Discrete Radon Transform (iDRT) of Matus & Flusser, 1993 for 2D arrays. O(n^3).

Author:
Shekhar S. Chandra, 2008
Parameters:
bins Contains the data to be inverse transformed and should be of size p+1 by p.
result It is assumed that this is already a pointer that has memory is allocated for each pixel. The function only does internal initializing with no allocation. It must have size of p by p.
p The prime which is the size of the square array.

Calculate the Isum from the first row

Get Projections where j denotes projection number

Get the last projection of rows

Definition at line 440 of file radon.c.

idrt_blockcopy ( nttw_integer *  datain,
nttw_integer *  dataout,
const int  p 
)

The Inverse Discrete Radon Transform (iDRT) of Matus & Flusser, 1993 for 2D arrays. This function uses the intelligent block copy method developed by Imants Svalbe. Note m=0 and m=p projections are interchanged in comparision to other DRT functions!

Author:
Andrew Kingston & Imants Svalbe, 2005.

Note that the definition of the m=p projection is non-standard compared to other routines in the libraries.

Parameters:
datain Contains the data to be inverse transformed. Must be p+1 by p array in 1D form.
dataout It is assumed that this is already a pointer that has memory is allocated for each pixel. The function only does internal initializing with no allocation. It must have size of p by p.
p The prime which is the size of the square array.

variables

Initialise

inverse transform m = 0

inverse transform (1 < m < p-1)

subtract total and divide by p

<

Todo:
Leak Identified !!! Not accessed but pointer ends up pointing outside.

Definition at line 474 of file radon.c.

ifrt ( nttw_integer *  bins,
nttw_integer *  result,
const int  p,
const int  norm 
)

The Inverse Fast Radon Transform (iFRT) of Matus & Flusser, 1993 for 2D arrays. Fourier Slice Theorem version. Complexity is linear logarithmic in time (same as a 2D FFT).

Author:
Shekhar S. Chandra, 2008
Parameters:
bins Contains the data to be inverse transformed and should be of size p+1 by p.
result It is assumed that this is already a pointer that has memory is allocated for each pixel. The function only does internal initializing with no allocation. It must have size of p by p.
p The prime which is the size of the square array.
norm Normalise the result?

FFT projections

Inverse FFT to get result

Cleanup

Definition at line 526 of file radon.c.

ifrt_double ( double *  bins,
double *  result,
const int  p,
const int  norm 
)

The Inverse Fast Radon Transform (iFRT) of Matus & Flusser, 1993 for 2D arrays. Fourier Slice Theorem version. Complexity is linear logarithmic in time (same as a 2D FFT).

This function is the double version. There is minimal rounding and casting between the FFT and the image.

Author:
Shekhar S. Chandra, 2009-10
Parameters:
bins Contains the data to be inverse transformed and should be of size p+1 by p.
result It is assumed that this is already a pointer that has memory is allocated for each pixel. The function only does internal initializing with no allocation. It must have size of p by p.
p The prime which is the size of the square array.
norm Normalise the result?

FFT projections

Inverse FFT to get result

Copy data from real part

Cleanup

Definition at line 581 of file radon.c.

ifrt_dyadic ( nttw_integer *  bins,
nttw_integer *  result,
const int  n,
const int  norm 
)

The Inverse Dyadic Fast Radon Transform (FRT) of Hsung et al, 1996 for 2D arrays. Fourier Slice Theorem version. Complexity is linear logarithmic in time (same as a 2D FFT).

Author:
Shekhar S. Chandra, 2009
Parameters:
bins Contains the data to be inverse transformed. Must be n by n+n/2 array.
result The recontructed image. It must have size of n by n.
n The dyadic size which is the size of the square array.

FFT projections

Correct for oversampling

Inverse FFT to get result

Cleanup

Definition at line 701 of file radon.c.

ifrt_dyadic_double ( double *  bins,
double *  result,
const int  n,
const int  norm 
)

The Inverse Dyadic Fast Radon Transform (FRT) of Hsung et al, 1996 for 2D arrays. Fourier Slice Theorem version. Complexity is linear logarithmic in time (same as a 2D FFT).

This function is the double version. There is minimal rounding and casting between the FFT and the image.

Author:
Shekhar S. Chandra, 2009-10
Parameters:
bins Contains the data to be inverse transformed. Must be n by n+n/2 array.
result The recontructed image. It must have size of n by n.
n The dyadic size which is the size of the square array.

FFT projections

Correct for oversampling

Inverse FFT to get result

Copy data from real part

Cleanup

Definition at line 781 of file radon.c.

ifrt_dyadic_signed ( nttw_integer *  bins,
long *  result,
const int  n,
const int  norm 
)

The Inverse Dyadic Fast Radon Transform (FRT) of Hsung et al, 1996 for 2D arrays. Fourier Slice Theorem version. Complexity is linear logarithmic in time (same as a 2D FFT).

Author:
Shekhar S. Chandra, 2009
Parameters:
bins Contains the data to be inverse transformed. Must be n by n+n/2 array.
result The signed recontructed image. It must have size of n by n.
n The dyadic size which is the size of the square array.

FFT projections

Correct for oversampling

Inverse FFT to get result

Cleanup

Definition at line 862 of file radon.c.

ifrt_dyadic_signed2 ( long *  bins,
long *  result,
const int  n,
const int  norm 
)

The Inverse Dyadic Fast Radon Transform (FRT) of Hsung et al, 1996 for 2D arrays. Fourier Slice Theorem version. Complexity is linear logarithmic in time (same as a 2D FFT). Complete signed array version.

Author:
Shekhar S. Chandra, 2009
Parameters:
bins Contains the signed data to be inverse transformed. Must be n by n+n/2 array.
result The signed recontructed image. It must have size of n by n.
n The dyadic size which is the size of the square array.

FFT projections

Correct for oversampling

Inverse FFT to get result

Cleanup

Definition at line 946 of file radon.c.

ifrt_signed ( nttw_integer *  bins,
long *  result,
const int  p,
const int  norm 
)

The Inverse Fast Radon Transform (iFRT) of Matus & Flusser, 1993 for 2D arrays. Fourier Slice Theorem version. Complexity is linear logarithmic in time (same as a 2D FFT).

This is the signed version, ideally suited for signed data such as noise.

Author:
Shekhar S. Chandra, 2009-10
Parameters:
bins Contains the data to be inverse transformed and should be of size p+1 by p.
result It is assumed that this is already a pointer that has memory is allocated for each pixel. The function only does internal initializing with no allocation. It must have size of p by p.
p The prime which is the size of the square array.
norm Normalise the result?

FFT projections

Inverse FFT to get result

Cleanup

Definition at line 637 of file radon.c.

setSlice ( int  m,
fftw_complex *  data,
fftw_complex *  slice,
const int  size 
)

Sets the slice at slope m within the FFT space given by data.

Definition at line 1073 of file radon.c.

setSlice_Perp ( int  s,
fftw_complex *  data,
fftw_complex *  slice,
const int  size 
)

Sets the slice at (perp) slope s within the FFT space given by data.

Definition at line 1099 of file radon.c.