Differences between revisions 4 and 76 (spanning 72 versions)
Revision 4 as of 2008-06-23 18:14:05
Size: 266
Comment:
Revision 76 as of 2009-07-24 17:22:07
Size: 9219
Comment:
Deletions are marked like this. Additions are marked like this.
Line 2: Line 2:
#format wiki
<<TableOfContents>>
Line 5: Line 7:
A programmer disguised as a Post Doc.
Line 6: Line 9:
== Personal ==
[http://home.swipnet.se/freakguitar/ A cool guitar site for scales and licks and reading]
I came from Australia to work for Steve Ludkte.
Line 9: Line 11:
Email: [[MailTo(you AT SPAMFREE example DOT com)]] See my old project: [[https://ps.imb.uq.edu.au/projects/SwarmPS|SwarmPS]]


== What is Single Particle Reconstruction? ==

If you want to figure out where all of the atoms of a protein are arranged in space, how do you do it? There are several techniques for doing this, the one we use is called [[http://en.wikipedia.org/wiki/Single_particle_reconstruction|single particle reconstruction]].

|| {{attachment:spr_overview.jpg}} ||
|| Overview of single particle reconstruction ||

In this flow diagram my primary role is the development of EMAN2, which is a large suite of image processing algorithms and interfaces.


== C++ ==

=== Some of my work in EMAN2 ===

Here are a few of the C++ classes that I wrote in EMAN2

 * Made the main [[http://blake.bcm.edu/eman2/doxygen_html/classEMAN_1_1FourierReconstructor.html| Fourier reconstructor ]] work, generalizing it so that there is a lot of flexibility with respect to padding and dimensions. I refactored and tweaked the [[http://blake.bcm.edu/eman2/doxygen_html/classEMAN_1_1BackProjectionReconstructor.html| back projection]] reconstructor too.

 * Abstracted the method of [[http://blake.bcm.edu/eman2/doxygen_html/classEMAN_1_1FourierPixelInserter3D.html| 3D Fourier pixel insertion]], and implemented the closely related method of calculating the [[http://blake.bcm.edu/eman2/doxygen_html/classEMAN_1_1InterpolatedFRC.html| interpolated Fourier ring correlation ]] from scratch.

 * Wrote the [[http://blake.bcm.edu/eman2/doxygen_html/classEMAN_1_1Symmetry3D.html| 3D symmetry ]] classes, which was very satisfying, probably because there is a finite number of 3D symmetries and we support them all, so the code is never likely to change. Actually, the story may not be as [[http://en.wikipedia.org/wiki/Point_groups_in_three_dimensions|simple]] as I think it to be. I also wrote the [[http://blake.bcm.edu/eman2/doxygen_html/classEMAN_1_1OrientationGenerator.html| orientation generating]] classes, which are just cool.

 * I rewrote the [[http://blake.bcm.edu/eman2/doxygen_html/classEMAN_1_1Transform.html| transform ]] class, and templated the [[http://blake.bcm.edu/eman2/doxygen_html/classEMAN_1_1Vec3.html| 3D vector]] and [[http://blake.bcm.edu/eman2/doxygen_html/classEMAN_1_1Vec2.html| 2D vector ]] classes. Maybe we should have used template unrolling to generalize for dimensions? If it ain't broke...

 * Poured through the [[http://blake.bcm.edu/eman2/doxygen_html/classEMAN_1_1Aligner.html| aligners]], rewriting and fixing them as needed.

 * I know it's only a single function, but [[http://blake.bcm.edu/eman2/doxygen_html/classEMAN_1_1EMData.html#f25ce5ad2bfb10223c5812ce0868a48a| robust inplace clipping ]] an image of 1,2 or 3 dimensions is a tricky job, but once implemented is very useful (we work on big images). In a similar vein, in EMAN2 the phase shifting and Fourier origin shifting processors work in place, for all dimensions, and for all combinations of even and odd dimensions.( [[http://blake.bcm.edu/eman2/doxygen_html/classEMAN_1_1Phase180Processor.html| phase processor]], [[http://blake.bcm.edu/eman2/doxygen_html/classEMAN_1_1FourierToCornerProcessor.html| Fourier processor]]). Very cool.

 * Incorporated [[http://blake.bcm.edu/eman2/doxygen_html/classEMAN_1_1EMFTGL.html|FTGL]] - basically wrapped FTGL to suit our needs. We expose our C++ in Python and end up using it that way.

 * I optimized the [[http://blake.bcm.edu/eman2/doxygen_html/marchingcubes_8cpp-source.html|marching cubes]] code, making it usable. About 10x faster.


=== Patterns in EMAN2 ===

 * We use a nifty [[http://blake.bcm.edu/eman2/doxygen_html/classEMAN_1_1Factory.html| Abstract Factory ]] for just about everything. I like our factory because it doesn't rely on a tier of maker classes - instead you register a class using a function pointer (to a static function).

 * We have an [[http://blake.bcm.edu/eman2/doxygen_html/classEMAN_1_1EMObject.html|object]] that can be of "any" type, sometimes referred to as the Variant pattern. We pass it around in [[http://blake.bcm.edu/eman2/doxygen_html/classEMAN_1_1Dict.html| Dictionaries]], specifically for communicating to and from Python and C++. The use of the EMObject and the Dict is all-pervasive in EMAN2.

 * Extensive use of the Strategy pattern, for [[http://blake.bcm.edu/eman2/doxygen_html/classEMAN_1_1Aligner.html| alignment]], [[http://blake.bcm.edu/eman2/doxygen_html/classEMAN_1_1Projector.html|projection]], [[http://blake.bcm.edu/eman2/doxygen_html/classEMAN_1_1Cmp.html|comparison]], [[http://blake.bcm.edu/eman2/doxygen_html/classEMAN_1_1Processor.html|processing]], and [[http://blake.bcm.edu/eman2/doxygen_html/classEMAN_1_1OrientationGenerator.html| orientation generation]], to name a few.

=== C++ Articles ===

These useful C++ articles

[[http://icu-project.org/docs/papers/cpp_report/the_assignment_operator_revisited.html|The assignment operator revisited]]


[[http://www.tutok.sk/fastgl/callback.html |Callbacks in C++ using template Functors]]

=== C++ is sometimes like what you call the name of a song... ===


 * '' A friend once told me that this is excerpt, taken from Alice in Wonderland, reminded him of C++''

''You are sad,'' the Knight said in an anxious tone: ''let me sing you a song to comfort you.''

''Is it very long?'' Alice asked, for she had heard a good deal of poetry that day.

''It's long,'' said the Knight, ''but very, very beautiful. Everybody that hears me sing it -- either it brings the tears into their eyes, or else -- ''

''Or else what?'' said Alice, for the Knight had made a sudden pause.

''Or else it doesn't, you know. The name of the song is called "Haddocks' Eyes."''

''Oh, that's the name of the song, is it?'' Alice said, trying to feel interested.

''No, you don't understand,'' the Knight said, looking a little vexed. ''That's what the name is called. The name really is "The Aged Aged Man."''

''Then I ought to have said "That's what the song is called"?'' Alice corrected herself.

''No, you oughtn't: that's quite another thing! The song is called "Ways and Means": but that's only what it's called, you know!''

''Well, what is the song, then?'' said Alice, who was by this time completely bewildered.

''I was coming to that,'' the Knight said. ''The song really is "A-sitting On A Gate": and the tune's my own invention.''

== Python ==

=== Links ===

[[http://code.activestate.com/recipes/93378/| Templated inheritance in Python]]

=== My work ===

 * I have written a huge amount of Python stuff in EMAN2, both interfaces and scripts. PyQt and PyOpenGL and the weapons of choice for the EMAN2 interfaces. Have a look at a [[http://blake.bcm.edu/emanwiki/DaveWoolford|gallery]] that I made as I wrote some of the PyOpenGL widgets, and [[http://blake.bcm.edu/emanwiki/e2display|another one]].

 * Here is a figure depicting the [[http://blake.bcm.edu/emanwiki/e2workflow| workflow]], which was for a poster. The workflow is a fairly large body of Python code designed to be very user friendly.

 * The fully embedded 3D [[http://blake.bcm.edu/emanwiki/e2desktop_gallery| desktop]] sits on top of the workflow, but we don't have the luxury of time to make it fully functional. It's done with PyQt and PyOpenGL.

 * [[http://blake.bcm.tmc.edu/emanwiki/e2boxer|e2boxer]] is gaining popularity.

== Programming Mantras ==

These are phrases I keep in mind when programming:

''The designers knows that he has achieved perfection, not when there is nothing left to add, but when there is nothing left take away.''

''If you don't have enough time to do it right the first time, when you will you ever have the time?''


== Cuda ==

You can't see the CUDA on the web because the machine which builds the documentation does not have the CUDA_FLAG on. But here is some [[http://blake.bcm.edu/eman2/doxygen_html/group__CUDA__ENABLED.html| EMAN2 code ]] that is already cuda enabled.

=== Links ===
[[http://forums.nvidia.com/lofiversion/index.php?t60956.html| Why many calls to cudaFree/cudaMalloc seems to cause havoc]]

[[http://forums.nvidia.com/index.php?act=ST&f=71&t=76026| Why cudaMemcpyDeviceToDevice seems to fail]]


== OpenGL ==

=== Articles ===
[[attachment:hoff2000derivingOpenGL.pdf|Matrices of the perspective transformation]] - this is a nice summary of everything involved in the perspective transform, better even than what I've found in books.

== Does MathML work ? ==

{{{$$sqrt(a^2+b^2)$$}}}


 . {{{`G(f) = exp(-f^2/(2 sigma_f^2))`}}}

Let's try some interesting formulas:

E=m c^2^

and e^i pi^=-1

and AA x in CC (sin^2x^ +cos^2x^=1)

and one more: sum_(i=1)^n^ i^3^=((n(n+1))/2)^2^


## page was renamed from foo1
Trivial examples.

First, using asciimath formatting.
{{{`a+b`}}}


Then, using latex format.

{{{$$\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}$$}}}


Email: <<MailTo(woolford AT SPAMFREE bcm DOT edu)>>

David Woolford

A programmer disguised as a Post Doc.

I came from Australia to work for Steve Ludkte.

See my old project: SwarmPS

What is Single Particle Reconstruction?

If you want to figure out where all of the atoms of a protein are arranged in space, how do you do it? There are several techniques for doing this, the one we use is called single particle reconstruction.

spr_overview.jpg

Overview of single particle reconstruction

In this flow diagram my primary role is the development of EMAN2, which is a large suite of image processing algorithms and interfaces.

C++

Some of my work in EMAN2

Here are a few of the C++ classes that I wrote in EMAN2

  • Made the main Fourier reconstructor work, generalizing it so that there is a lot of flexibility with respect to padding and dimensions. I refactored and tweaked the back projection reconstructor too.

  • Abstracted the method of 3D Fourier pixel insertion, and implemented the closely related method of calculating the interpolated Fourier ring correlation from scratch.

  • Wrote the 3D symmetry classes, which was very satisfying, probably because there is a finite number of 3D symmetries and we support them all, so the code is never likely to change. Actually, the story may not be as simple as I think it to be. I also wrote the orientation generating classes, which are just cool.

  • I rewrote the transform class, and templated the 3D vector and 2D vector classes. Maybe we should have used template unrolling to generalize for dimensions? If it ain't broke...

  • Poured through the aligners, rewriting and fixing them as needed.

  • I know it's only a single function, but robust inplace clipping an image of 1,2 or 3 dimensions is a tricky job, but once implemented is very useful (we work on big images). In a similar vein, in EMAN2 the phase shifting and Fourier origin shifting processors work in place, for all dimensions, and for all combinations of even and odd dimensions.( phase processor, Fourier processor). Very cool.

  • Incorporated FTGL - basically wrapped FTGL to suit our needs. We expose our C++ in Python and end up using it that way.

  • I optimized the marching cubes code, making it usable. About 10x faster.

Patterns in EMAN2

  • We use a nifty Abstract Factory for just about everything. I like our factory because it doesn't rely on a tier of maker classes - instead you register a class using a function pointer (to a static function).

  • We have an object that can be of "any" type, sometimes referred to as the Variant pattern. We pass it around in Dictionaries, specifically for communicating to and from Python and C++. The use of the EMObject and the Dict is all-pervasive in EMAN2.

  • Extensive use of the Strategy pattern, for alignment, projection, comparison, processing, and orientation generation, to name a few.

C++ Articles

These useful C++ articles

The assignment operator revisited

Callbacks in C++ using template Functors

C++ is sometimes like what you call the name of a song...

  • A friend once told me that this is excerpt, taken from Alice in Wonderland, reminded him of C++

You are sad, the Knight said in an anxious tone: let me sing you a song to comfort you.

Is it very long? Alice asked, for she had heard a good deal of poetry that day.

It's long, said the Knight, but very, very beautiful. Everybody that hears me sing it -- either it brings the tears into their eyes, or else --

Or else what? said Alice, for the Knight had made a sudden pause.

Or else it doesn't, you know. The name of the song is called "Haddocks' Eyes."

Oh, that's the name of the song, is it? Alice said, trying to feel interested.

No, you don't understand, the Knight said, looking a little vexed. That's what the name is called. The name really is "The Aged Aged Man."

Then I ought to have said "That's what the song is called"? Alice corrected herself.

No, you oughtn't: that's quite another thing! The song is called "Ways and Means": but that's only what it's called, you know!

Well, what is the song, then? said Alice, who was by this time completely bewildered.

I was coming to that, the Knight said. The song really is "A-sitting On A Gate": and the tune's my own invention.

Python

Templated inheritance in Python

My work

  • I have written a huge amount of Python stuff in EMAN2, both interfaces and scripts. PyQt and PyOpenGL and the weapons of choice for the EMAN2 interfaces. Have a look at a gallery that I made as I wrote some of the PyOpenGL widgets, and another one.

  • Here is a figure depicting the workflow, which was for a poster. The workflow is a fairly large body of Python code designed to be very user friendly.

  • The fully embedded 3D desktop sits on top of the workflow, but we don't have the luxury of time to make it fully functional. It's done with PyQt and PyOpenGL.

  • e2boxer is gaining popularity.

Programming Mantras

These are phrases I keep in mind when programming:

The designers knows that he has achieved perfection, not when there is nothing left to add, but when there is nothing left take away.

If you don't have enough time to do it right the first time, when you will you ever have the time?

Cuda

You can't see the CUDA on the web because the machine which builds the documentation does not have the CUDA_FLAG on. But here is some EMAN2 code that is already cuda enabled.

Why many calls to cudaFree/cudaMalloc seems to cause havoc

Why cudaMemcpyDeviceToDevice seems to fail

OpenGL

Articles

Matrices of the perspective transformation - this is a nice summary of everything involved in the perspective transform, better even than what I've found in books.

Does MathML work ?

$$sqrt(a^2+b^2)$$

  • `G(f) = exp(-f^2/(2 sigma_f^2))`

Let's try some interesting formulas:

E=m c2

and ei pi=-1

and AA x in CC (sin2x +cos2x=1)

and one more: sum_(i=1)n i3=((n(n+1))/2)2

Trivial examples.

First, using asciimath formatting. `a+b`

Then, using latex format.

$$\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}$$

Email: <woolford AT SPAMFREE bcm DOT edu>

...


CategoryHomepage

DavidWoolford (last edited 2009-08-12 23:39:00 by DavidWoolford)