Project

General

Profile

Actions

Feature #3759

closed

handle aligned images in tilt series alignment

Added by Anchi Cheng about 9 years ago. Updated almost 9 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
-
Target version:
-
Start date:
11/12/2015
Due date:
% Done:

0%

Estimated time:
Deliverable:

Description

protomo2aligner.py accepts flag to take the aligned images.

Need to handle it correctly

Actions #1

Updated by Anchi Cheng about 9 years ago

A frame-aligned image data instance has this signiture

imagedata['camera']['align frames']=True
Actions #2

Updated by Anchi Cheng about 9 years ago

  • Status changed from New to Assigned
  • Assignee set to Alex Noble

Also aligned_imagedata and unaligned_imagedata are recorded as a pair in appiondata.ApDDAlignImagePairData.

Alex, this is assigned to you, but if you want me to replace your ex-a text search for non-aligned images with a query, I can do that.

Actions #3

Updated by Alex Noble about 9 years ago

I actually just wrote that this week. Scott and I had a discussion about the correct way to query aligned images and determined that this is the best way. Here's why:

  • The DE Frame Alignment script that Scott wrote and that we use Takes the frames for file ...00002ex_001.mrc, aligns them, and writes to the same directory a ...00002ex-a_001.mrc file and includes the new file in the database as the corresponding frame aligned version of 00002ex_001.mrc.
  • If you run the DE Frame Alignment script again on the same frames, it will write a second image with the filename 00002ex-a_001_v01.mrc, paired with the original image in the database. Run it again and you will get 00002ex-a_001_v02.mrc, etc.
  • I am only giving the user the option to use the frame aligned image or the original image. I am not giving them the option of which frame aligned image to use. Therefore I make the assumption that the last frame aligned image - 00002ex-a_001_v02.mrc for example - is the image that the user wants to use.

That's why this code queries the files and not the database to get the frame aligned image. Scott left for a conference yesterday, so I think this code will have to stay as it is for 3.2.

Actions #4

Updated by Alex Noble about 9 years ago

I explain to the user in the Use Frame Aligned Images help doc that this only works if images were aligned with the Launch DE Frame script.

Actions #5

Updated by Anchi Cheng about 9 years ago

Alex, the way the file gets put back is no different from motioncorr aligned images. Please check for me of your images the following:

Imagedata can be viewed from imagereport.php (click "i" on any webimageviewer above the image). On the right hand side, there is an item called "Data Tree" which you can click view to expose various database information. Go under camera and find "align frames". Any aligned image should say 1 any unaligned image should say 0.

The place where you look for ex-a is just to find the unaligned original image so that it can be sorted properly without duplication from what I can tell. Therefore, you just need a loop to find image['camera']['aligne frames']=False to do the same without the restriction that the user has to call the exposure preset ex.

Actions #6

Updated by Alex Noble about 9 years ago

Okay yes, I see what you mean and yes our aligned images have ['camera']['align frames']=1. I took out the explicit check for 'ex-a' in apProTomo2Prep.py, but I don't know how to replace line 109-110 in apProTomo.py:

images=glob.glob(imgfullpath[:-8]+'*'+imgfullpath[-7:-4]+'*')
images.sort(key=os.path.getmtime)

The problem is that an unaligned image can have multiple aligned images associated with it and I don't know how to get the most recent aligned image from the database.

Also, our machines are not allowing me to connect to the internet right now so I can't commit. Hoping our IT guy figures this out...

Actions #7

Updated by Alex Noble about 9 years ago

Here's the code that I can't commit right now. apProTomo2Prep.py, change lines 96-98 and 389-391 to:

for i in range(len(tiltdata)):

if tiltdata[i]['camera']['align frames'] == False:

non_frame_tiltdata.append(tiltdata[i])

Edit: I can commit again.

Actions #8

Updated by Alex Noble almost 9 years ago

  • Status changed from Assigned to Closed

Update 6 has been solved by database queries. Frames are now queried properly for file preparation, CTF correction, and dose compensation. Closing issue.

Actions

Also available in: Atom PDF