Data Structures | Functions

Mojette Transforms & Related

Data Structures

struct  mojetteProjection

Functions

NTTW_DLL_SYM mojetteProjectionmojetteArray_1D (vector *angles, const size_t mu, const size_t rows, const size_t cols)
 Allocates a Mojette Projection set (array) for the angle set provided.
NTTW_DLL_SYM void free_mojetteArray (mojetteProjection *set, const size_t mu)
 Deallocates a Mojette Projection set (array).
NTTW_DLL_SYM int writeMojetteSet (mojetteProjection *set, const size_t mu, const char *filename)
 Writes a Mojette Projection set (array) to file.
NTTW_DLL_SYM int outputMojetteSet (mojetteProjection *set, const size_t mu)
 Writes a Mojette Projection set (array) to stdout.
NTTW_DLL_SYM int readMojetteSet (mojetteProjection **set, size_t *mu, const char *filename)
 Reads a Mojette Projection set (array) from file.
NTTW_DLL_SYM int isKatzCriterion (const vector *projectionSet, const int projectionsNumber, const int rows, const int cols)
 Uses the set of projections to determine if the Katz Criterion is met.
NTTW_DLL_SYM int totalFareyAngles (const int n)
 Returns the upper bound for the number of Farey angles less than n. Limit is approximately 3n^2/pi^2 = 0.3034 n^2. Its to be used with the compact routines.
NTTW_DLL_SYM void nextFareyAngle (const int n, const vector angle1, const vector angle2, vector *result)
 Computes the next Farey fraction/angle from the two fractions provided.
NTTW_DLL_SYM void nextFareyAngle_Compact (const int n, const vector angle1, const vector angle2, vector *result)
 Computes the next Farey fraction/angle from the two fractions provided that has minimal l1 norm.
NTTW_DLL_SYM void allFareyAngles (const int n)
 Computes all the Farey fractions of order n and outputs to stdout.
NTTW_DLL_SYM void allFareyAngles_Compact (const int n)
 Computes all the Farey fractions of order n that has minimal l1 norm and outputs to stdout.
NTTW_DLL_SYM nttw_big_integer finiteAngle (const vector fareyAngle, const nttw_big_integer modulus, nttw_integer *perp)
 Computes the corresponding finite angle (m or s) for the Farey fraction for the given modulus.
NTTW_DLL_SYM void markFiniteAngle (const nttw_big_integer value, const nttw_integer perp, nttw_integer *mLookUpTable, nttw_integer *sLookUpTable, nttw_integer *rejected)
 Marks the lookup table if the finite angle is unique in the given finite set.
NTTW_DLL_SYM void computeAngle (const size_t N, long p, long q, nttw_integer *mLookUp, nttw_integer *sLookUp, vector *farey, nttw_big_integer *finite, nttw_integer *perps, nttw_big_integer *angleCount)
 Determines the finite angle for a given Farey fraction and rejects it if it is not unique. Marks the lookup if unique.
NTTW_DLL_SYM nttw_big_integer fmt_angleSet (const size_t N, const size_t P, const size_t Q, vector *farey, nttw_big_integer *finite, nttw_integer *perps)
 Determines the finite angle set for the FMT using the first encountered Farey fractions during generation of the l1 norm Farey set of order n.
NTTW_DLL_SYM nttw_big_integer fmt_angleSet_Simple (const size_t N, vector *farey, nttw_big_integer *finite, nttw_integer *perps)
 Determines the finite angle set for the FMT using the simple [1,w] set.
NTTW_DLL_SYM nttw_big_integer fmt_angleSet_L1 (const size_t N, const size_t P, const size_t Q, vector *farey, nttw_big_integer *finite, nttw_integer *perps)
 Determines the l1 norm finite angle set for the FMT by generating the Farey set for order n and sorting in ascending l1 norm. The shortest fractions are chosen to form the set.
NTTW_DLL_SYM void mt (const vector *angles, const nttw_integer *data, mojetteProjection *set, const size_t mu, const size_t rows, const size_t cols)
 The Mojette Transform (MT) of the data taken at the angles provided. The set contains the projection data.
NTTW_DLL_SYM nttw_integer * fmt (const size_t P, const size_t Q, const nttw_integer *image, const vector *farey, const nttw_big_integer *finite, nttw_integer *perps, const size_t N)
 The Fast Mojette Transform (FMT) of the data taken at the angles provided. The FMT is simulated by taking the MT and then mapping it to FRT space.
NTTW_DLL_SYM nttw_integer * fmt_noise (const size_t P, const size_t Q, const nttw_integer *image, const vector *farey, const nttw_big_integer *finite, nttw_integer *perps, const size_t N, const float SNR)
 The Fast Mojette Transform (FMT) of the data taken at the angles provided with noise at SNR. The FMT is simulated by taking the MT and then mapping it to FRT space.
NTTW_DLL_SYM void mt2frt (const vector *farey, const nttw_big_integer *finite, const nttw_integer *perps, const mojetteProjection *set, const size_t mu, const size_t rows, nttw_integer *frtSpace, const size_t N)
 Mojette projections are mapped to the FRT space using the finite mapping developed by Chandra et al.
NTTW_DLL_SYM void mt2frt_noise (const vector *farey, const nttw_big_integer *finite, const nttw_integer *perps, const mojetteProjection *set, const size_t mu, const size_t rows, nttw_integer *frtSpace, const size_t N, const float SNR)
 Mojette projections are mapped to the FRT space with noise using the finite mapping developed by Chandra et al.

Function Documentation

allFareyAngles ( const int  n  ) 

Computes all the Farey fractions of order n and outputs to stdout.

Definition at line 191 of file mojette.c.

allFareyAngles_Compact ( const int  n  ) 

Computes all the Farey fractions of order n that has minimal l1 norm and outputs to stdout.

Definition at line 218 of file mojette.c.

computeAngle ( const size_t  N,
long  p,
long  q,
nttw_integer *  mLookUp,
nttw_integer *  sLookUp,
vector farey,
nttw_big_integer *  finite,
nttw_integer *  perps,
nttw_big_integer *  angleCount 
)

Determines the finite angle for a given Farey fraction and rejects it if it is not unique. Marks the lookup if unique.

The mapping was developed by Chandra et al (arXiv:1006.1965v1 [physics.med-ph]).

Compute Angle by setting vector

Determine the finite angle analytically

Check and Mark lookup tables

Definition at line 293 of file mojette.c.

finiteAngle ( const vector  fareyAngle,
const nttw_big_integer  modulus,
nttw_integer *  perp 
)

Computes the corresponding finite angle (m or s) for the Farey fraction for the given modulus.

The mapping was developed by Chandra et al (arXiv:1006.1965v1 [physics.med-ph]).

Definition at line 245 of file mojette.c.

fmt ( const size_t  P,
const size_t  Q,
const nttw_integer *  image,
const vector farey,
const nttw_big_integer *  finite,
nttw_integer *  perps,
const size_t  N 
)

The Fast Mojette Transform (FMT) of the data taken at the angles provided. The FMT is simulated by taking the MT and then mapping it to FRT space.

The FMT was developed by Chandra et al (arXiv:1006.1965v1 [physics.med-ph]).

Compute Fast Mojette

Definition at line 546 of file mojette.c.

fmt_angleSet ( const size_t  N,
const size_t  P,
const size_t  Q,
vector farey,
nttw_big_integer *  finite,
nttw_integer *  perps 
)

Determines the finite angle set for the FMT using the first encountered Farey fractions during generation of the l1 norm Farey set of order n.

The angle set was developed by Chandra et al (arXiv:1006.1965v1 [physics.med-ph]).

Compute Start and End angles, order important

Todo:
Typecast safe?
Todo:
Typecast safe?

First Octant

Second Octant

Third Octant

Forth Octant

Deallocate

Definition at line 317 of file mojette.c.

fmt_angleSet_L1 ( const size_t  N,
const size_t  P,
const size_t  Q,
vector farey,
nttw_big_integer *  finite,
nttw_integer *  perps 
)

Determines the l1 norm finite angle set for the FMT by generating the Farey set for order n and sorting in ascending l1 norm. The shortest fractions are chosen to form the set.

The angle set was developed by Chandra et al (arXiv:1006.1965v1 [physics.med-ph]).

Compute Start and End angles, order important

Sort Angles by L1,

Todo:
Use qsort here

Determine Finite angles for sorted L1 set

First Octant

Second Octant

Third Octant

Forth Octant

Deallocate

Definition at line 407 of file mojette.c.

fmt_angleSet_Simple ( const size_t  N,
vector farey,
nttw_big_integer *  finite,
nttw_integer *  perps 
)

Determines the finite angle set for the FMT using the simple [1,w] set.

The angle set was developed by Chandra et al (arXiv:1006.1965v1 [physics.med-ph]).

Compute Start and End angles, order important

Todo:
Typecast safe?
Todo:
Typecast safe?
Todo:
Typecast safe?
Todo:
Typecast safe?

Deallocate

Definition at line 376 of file mojette.c.

fmt_noise ( const size_t  P,
const size_t  Q,
const nttw_integer *  image,
const vector farey,
const nttw_big_integer *  finite,
nttw_integer *  perps,
const size_t  N,
const float  SNR 
)

The Fast Mojette Transform (FMT) of the data taken at the angles provided with noise at SNR. The FMT is simulated by taking the MT and then mapping it to FRT space.

The FMT was developed by Chandra et al (arXiv:1006.1965v1 [physics.med-ph]).

Compute Fast Mojette

Definition at line 586 of file mojette.c.

free_mojetteArray ( mojetteProjection set,
const size_t  mu 
)

Deallocates a Mojette Projection set (array).

Todo:
free_array instead?

Definition at line 52 of file mojette.c.

isKatzCriterion ( const vector projectionSet,
const int  projectionsNumber,
const int  rows,
const int  cols 
)

Uses the set of projections to determine if the Katz Criterion is met.

The Katz criterion signifies whether there is sufficient information in the projections to reconstruct the data from the projections. Katz Criterion is met for a $ N\times N $ when

\[ N < 1+\max\left(\sum_{i=0}^{\mu-1}|p_i|,\sum_{i=0}^{\mu-1}|q_i|\right), \]

where $ \mu $ is the total number of projections and $ p $ and $ q $ are part of the projection vector $ \vec{\rho} = p + qi $ .

Returns:
A Boolean representing if the Katz Criterion is met.

Definition at line 129 of file mojette.c.

markFiniteAngle ( const nttw_big_integer  value,
const nttw_integer  perp,
nttw_integer *  mLookUpTable,
nttw_integer *  sLookUpTable,
nttw_integer *  rejected 
)

Marks the lookup table if the finite angle is unique in the given finite set.

The mapping was developed by Chandra et al (arXiv:1006.1965v1 [physics.med-ph]).

Definition at line 273 of file mojette.c.

mojetteArray_1D ( vector angles,
const size_t  mu,
const size_t  rows,
const size_t  cols 
)

Allocates a Mojette Projection set (array) for the angle set provided.

Definition at line 35 of file mojette.c.

mt ( const vector angles,
const nttw_integer *  data,
mojetteProjection set,
const size_t  mu,
const size_t  rows,
const size_t  cols 
)

The Mojette Transform (MT) of the data taken at the angles provided. The set contains the projection data.

Compute Fast Mojette

Definition at line 522 of file mojette.c.

mt2frt ( const vector farey,
const nttw_big_integer *  finite,
const nttw_integer *  perps,
const mojetteProjection set,
const size_t  mu,
const size_t  rows,
nttw_integer *  frtSpace,
const size_t  N 
)

Mojette projections are mapped to the FRT space using the finite mapping developed by Chandra et al.

Compute Fast Mojette

Definition at line 625 of file mojette.c.

mt2frt_noise ( const vector farey,
const nttw_big_integer *  finite,
const nttw_integer *  perps,
const mojetteProjection set,
const size_t  mu,
const size_t  rows,
nttw_integer *  frtSpace,
const size_t  N,
const float  SNR 
)

Mojette projections are mapped to the FRT space with noise using the finite mapping developed by Chandra et al.

Compute Fast Mojette

Definition at line 669 of file mojette.c.

nextFareyAngle ( const int  n,
const vector  angle1,
const vector  angle2,
vector result 
)

Computes the next Farey fraction/angle from the two fractions provided.

The computation is done using the standard method.

Definition at line 159 of file mojette.c.

nextFareyAngle_Compact ( const int  n,
const vector  angle1,
const vector  angle2,
vector result 
)

Computes the next Farey fraction/angle from the two fractions provided that has minimal l1 norm.

The computation is done using the standard method with a l1 norm constraint.

Definition at line 175 of file mojette.c.

outputMojetteSet ( mojetteProjection set,
const size_t  mu 
)

Writes a Mojette Projection set (array) to stdout.

Definition at line 84 of file mojette.c.

readMojetteSet ( mojetteProjection **  set,
size_t *  mu,
const char *  filename 
)

Reads a Mojette Projection set (array) from file.

Definition at line 100 of file mojette.c.

totalFareyAngles ( const int  n  ) 

Returns the upper bound for the number of Farey angles less than n. Limit is approximately 3n^2/pi^2 = 0.3034 n^2. Its to be used with the compact routines.

Definition at line 152 of file mojette.c.

writeMojetteSet ( mojetteProjection set,
const size_t  mu,
const char *  filename 
)

Writes a Mojette Projection set (array) to file.

Definition at line 62 of file mojette.c.