bigpyramid
index
/.automount/ioasun3/root/disk/users/kybic/work/python_volumes/bigpyramid.py

 Module bigpyramid implements a B-spline pyramid with on-demand
generated coarser levels
 
Jan Kybic, October 2000
$Id: bigpyramid.html,v 1.1 2002/08/26 14:11:15 jkybic Exp $

 
Modules
                      
BIGsplines
Gnuplot
bigsplines
bigtools
copy
copy_reg
math
multiarray
pickle
string
types

 
Classes
                      
BSPyramid

 
class BSPyramid
            An instance of BSPyramid is initialized with an n-dimensional
image. Subsequent queries for lower-resolution versions 
are calculated if needed and cached for later
 
  
__init__(self, image, degree=3)
getcoefs(self, level)
getimage(self, level)
show1d(self, n, s=0)

 
Functions
                      
alltrue = reduce(...)
array(...)
array(sequence, typecode=None, copy=1, savespace=0) will return a new array formed from the given (potentially nested) sequence with type given by typecode.  If no typecode is given, then the type will be determined as the minimum type required to hold the objects in sequence.  If copy is zero and sequence is already an array, a reference will be returned.  If savespace is nonzero, the new array will maintain its precision in operations.
binomfilt(n)
 Returns a binomial kernel (1+z)^(n+1)/2^n as an array.
The second parameter returned is the kernel origin, ready for the
call to BIGsplines.FirConvolve. When the kernel has even length, the
kernel origin is shifted left
bsexpand(c, degree, bcond=4)
 Given a 1D array of B-spline coefficients c,
make a double resolution version representing the same function.
 
Note that MirrorOnBoundary boundary conditions would impose that the
expand of n-point vector has (2n-1) points which is inconvenient.
 
See Unser, Aldroubi, Eden: The L2 Polynomial Spline Pyramid,
IEEE Trans. on Pattern Analysis and Machine Intelligence,
vol. 15, no. 4, April 1993
bsreduce(c, degree, bcond=4)
 Given a 1D array of B-spline coefficients
c, make a half resolution version cr, optimal in the L2 sense
 
See Unser, Aldroubi, Eden: The L2 Polynomial Spline Pyramid,
IEEE Trans. on Pattern Analysis and Machine Intelligence,
vol. 15, no. 4, April 1993
choose(...)
choose(a, (b1,b2,...))
cross_correlate(...)
cross_correlate(a,v)
cumproduct = accumulate(...)
cumsum = accumulate(...)
fromstring(...)
fromstring(string, count=None, typecode='l') returns a new 1d array initialized from the raw binary data in string.  If count is not equal to None, the new array will have count elements, otherwise it's size is determined by the size of string.
mbsexpand(c, degree, bcond=4)
 Given a multidimensional array of B-spline coefficients c,
return a double resolution version by applying bsexpand to
all dimensions.
mbsreduce(c, degree, bcond=4)
 Given a multidimensional array of B-spline coefficients c,
return a half resolution version by applying bsreduce to
all dimensions.
product = reduce(...)
repeat(...)
repeat(a, n, axis=0)
reshape(...)
reshape(a, (d1, d2, ..., dn)).  Change the shape of a to be an n-dimensional array with dimensions given by d1...dn.  One dimension is allowed to be None.  This dimension will be set to whatever value will make the size of the new array equal the size of the old one.  Note: the size specified for the new array must be exactly equal to the size of the  old one or an error will occur.  This returns a completely new array with the data of the old one copied.  Use a.shape=(...) for no data copying.
searchsorted = binarysearch(...)
binarysearch(a,v)
sometrue = reduce(...)
sum = reduce(...)
take(...)
take(a, indices, axis=0).  Selects the elements in indices from array a along the given axis.
test_expandreduce()
test_mexpandreduce()
test_pyramid()
test_updownsample()
zeros(...)
zeros((d1,...,dn),typecode,savespace) will return a new array of shape (d1,...,dn) and type typecode (default 'l') with all it's entries initialized to zero.  If savespace (default 0) is nonzero the array will be a spacesaver array.

 
Constants
                      ArrayType = <type 'array'>
Complex = 'D'
Complex0 = 'F'
Complex16 = 'F'
Complex32 = 'F'
Complex64 = 'D'
Complex8 = 'F'
Float = 'd'
Float0 = 'f'
Float16 = 'f'
Float32 = 'f'
Float64 = 'd'
Float8 = 'f'
Int = 'l'
Int0 = '1'
Int16 = 's'
Int32 = 'i'
Int8 = '1'
LittleEndian = 1
PrecisionError = 'PrecisionError'
PyObject = 'O'
UnsignedInt8 = 'b'
arraytype = <type 'array'>
e = 2.7182818284590451
pi = 3.1415926535897931