Bug #60
closedAppion should generate envelopeImage.mrc instead of storing the 4k image
Description
The file source:trunk/appion/appionlib/envelopeImage.mrc is a 4k by 4k image (65MB). But the data rotationally symmetric, so we can store the 1D information and generate the 2D image. This will save lots of space in the distribution.
Files
Updated by Neil Voss over 14 years ago
- Status changed from New to Assigned
- Assignee set to Neil Voss
Updated by Neil Voss over 14 years ago
The goal of this function is to create a function, f(r),
that will generate the original 2D envelopeImage.mrc
The function will contain 1D points and use linear interpolation
to fill in the gaps. The function is also monotonically decreasing.
Numpy has an linear interpolation function: numpy.interp
http://docs.scipy.org/doc/numpy/reference/generated/numpy.interp.html
Scipy has non-linear interpolation functions: scipy.interpolate
http://docs.scipy.org/doc/scipy/reference/interpolate.html
including cubic spline, which is probably ideal.
I need to decide the resolution of the 1D and
I decided that 1 pixel was enough ranging between 0 and 2896
to fill a complete 4k image
Create two numpy arrays one for sums and a second for weight. Loop through all
pixels and make their contribution to the relevant pixels (+/- 3 pixels).
At the end, divide the sums by the weights and we obtain the 1D function, f(r).
For each integer in r, I will then calculate a mean based on all nearby values
+/- 2 pixels. Probably with a Gaussian weighting, error function in python
from scipy.special import erfc
weight = erfc( abs(r-r_i)/Sqrt(2) )
f(0) = 265.20575 based on linear extrapolation involving first 4 points
f(2896) = 185.45721 based on linear extrapolation involving last 4 points
Updated by Neil Voss over 14 years ago
- File convert2Dto1D.py convert2Dto1D.py added
Updated by Neil Voss over 14 years ago
- File radial-envelope.numpy radial-envelope.numpy added
Updated by Neil Voss over 14 years ago
- Status changed from Assigned to In Code Review
- Assignee changed from Neil Voss to Amber Herold
Dmitry can test this by just creating a stack. There were some problems as the envelop was not perfectly rotationally symmetric, but I doubt it matters. r13115 contains all code changes, most of the work went into converting the 2D mrc into the 1D radial array. Old file 65MB, new file 88k'
Updated by Amber Herold over 14 years ago
- Status changed from In Code Review to In Test
- Assignee changed from Amber Herold to Dmitry Lyumkis
Updated by Dmitry Lyumkis over 14 years ago
- Status changed from In Test to Closed
- Affected Version set to Appion/Leginon 2.0.1
I created a couple datasets to test this function and it works fine. The envelope image is created, but it is still not taking into account pixel size (Appion Bug #195). As far as I'm concerned, I think this one is closed.
Updated by Dmitry Lyumkis over 14 years ago
- Status changed from Closed to Merge
- Assignee changed from Dmitry Lyumkis to Amber Herold
Updated by Amber Herold over 14 years ago
- Assignee changed from Amber Herold to Neil Voss
Neil, I believe this does not need to be merged since you added it prior to branching. If I'm correct, please close it out.