Project

General

Profile

Actions

Bug #60

closed

Appion should generate envelopeImage.mrc instead of storing the 4k image

Added by Neil Voss over 14 years ago. Updated almost 14 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
-
Target version:
-
Start date:
01/26/2010
Due date:
% Done:

0%

Estimated time:
Spent time:
Affected Version:
Appion/Leginon 2.0.1
Show in known bugs:
Workaround:

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

convert2Dto1D.py (4.13 KB) convert2Dto1D.py program to do the conversion Neil Voss, 03/07/2010 02:46 PM
radial-envelope.numpy (22.8 KB) radial-envelope.numpy radially averaged envelope in numpy format Neil Voss, 03/07/2010 02:47 PM

Related issues 1 (0 open1 closed)

Related to Appion - Bug #195: envelope image does not take into account pixel size changesWon't Fix or Won't Do Dmitry Lyumkis03/08/2010

Actions
Actions #1

Updated by Neil Voss about 14 years ago

  • Status changed from New to Assigned
  • Assignee set to Neil Voss
Actions #2

Updated by Neil Voss about 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

Actions #5

Updated by Neil Voss about 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'

Actions #6

Updated by Amber Herold about 14 years ago

  • Status changed from In Code Review to In Test
  • Assignee changed from Amber Herold to Dmitry Lyumkis
Actions #7

Updated by Dmitry Lyumkis almost 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.

Actions #8

Updated by Dmitry Lyumkis almost 14 years ago

  • Status changed from Closed to Merge
  • Assignee changed from Dmitry Lyumkis to Amber Herold
Actions #9

Updated by Amber Herold almost 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.

Actions #10

Updated by Neil Voss almost 14 years ago

  • Status changed from Merge to Closed
Actions

Also available in: Atom PDF