Personal tools
You are here: Home Tutorials pyCoAn: clem add-on tutorial clem_align: getting the transform

clem_align: getting the transform

Interactive function to find coordinate transform from fluorescence to EM image

After the initial correspondences were determined, the program will continue with a number of steps to extract the coordinate transform from those correspondences. First, it will use the initial correspondences to find all holes that can be used for the alignment.

get full correspondence

 initial scale:         6.00508742487

 scale std:             0.0220173843488

 initial shift:         1537.0 3647.5

 initial angle:         255.018554688

 initial rmsd score:    1.95403073481

 simplex iterations:    20


 number of correspondences:  28

In this case, it found 28 holes that can be used for the alignment. Next, the program will use those holes to determine an initial coordinate transform based on all holes and then refines it.

get clem transform

 initial scale:         6.00196408804

 scale std:             0.0248956843741

 initial shift:         1780.96 2495.79

 initial angle:         -105.014404297

 initial rmsd score:    5.09716917487

 simplex iterations:    19


 refined scale:         6.00013610625

 refined translation:   1780.19 2496.24

 refined angle:         -105.014249261

 refined rmsd score:    5.07259357051

 simplex iterations:    62

The final step is to get a precision estimate using the prediction error for the individual hole center locations.

estimating precision


 individual prediction error:   0.415130066712

 individual prediction error:   0.212134699074

 individual prediction error:   0.049470867331

 individual prediction error:   0.171328466792

 individual prediction error:   0.30353393794

 individual prediction error:   0.297153549271

 individual prediction error:   0.30770940458

 individual prediction error:   0.241720372055

 individual prediction error:   0.0315254115322

 individual prediction error:   0.147155964241

 individual prediction error:   0.152103148491

 individual prediction error:   0.455517389046

 individual prediction error:   0.158224269255

 individual prediction error:   0.182281062408

 individual prediction error:   0.298012236736

 individual prediction error:   0.387046597931

 individual prediction error:   0.334400029894

 individual prediction error:   0.185284720489

 individual prediction error:   0.21896624095

 individual prediction error:   0.163736109545

 individual prediction error:   0.206042429483

 individual prediction error:   0.144363357355

 individual prediction error:   0.594854532139

 individual prediction error:   0.246608256843

 individual prediction error:   0.21067921402

 individual prediction error:   0.322462726775

 individual prediction error:   0.265699151853

 individual prediction error:   0.0240490908231


 mean prediction error:         0.240256903699

 prediction error std:          0.124642161896

The error is given in EM pixel units. At this stage, the program allows to either finalize the results or to go back to the correspondence picker (type 'c', then hit return) or the interactive peak determination step (type 'p', then hit return). 

 type 'c' and hit return for repeating correspondence

 type 'p' and hit return to go back to peak determination

 otherwise, hit return to exit

If you hit return, the program is finished and you will be returned to the pyCoAn shell. The variable 'T' contains the information about the coordinate transform.

>>> T['angle']


>>> T['scale']


The transform can be applied to the fluorescence image using the 'apply_clem_transform' function.

>>> tr = apply_clem_transform(em,fl,T)

 scaling up





>>> tr.imshow()


This image is now on the same origin, scale etc as the EM image. It can be used to combine the fluorescence signal with the EM image at the scale of the EM image.


< previous