Question:

After running refine2d.py there are some good classes in several of the iter.#.img files that I would like to use in other programs (spider and IMAGIC). I would like to be able to extract the individual images that made up these class averages - is this possible, and if so how would I go about this?

I have found that by "un-tar-ing" the cls.#.tar files you can get the cls000#.lst file that corresponds to the iteration number. Which image stack file do these list files refer to?

Answer: (Steve 1/2/07) Unfortunately, this isn't the file you want. Two sets of cls files are generated during each cycle of refine2d.py. The tar file contains the first set, which isn't really useful in this context. The second set is not archived, but is left in the directory when refine2d.py completes. That is, you should let refine2d.py run to completion, preferably with finalsep=0, then use the cls files that remain in the directory. If you look at the cls file itself (they are text files) you will see that they refer to ptcl.hed. While these ARE the original particles, they are the original particles after alignment, and they are not in the same order as the file containing the original particles. However, there is a file called ptcl2orig.lst which maps each image in ptcl.hed into the original particle in the original data file. Another issue is that the class-averages in iter.final.hed are not in the same order as the cls*lst files. So you need to (script will vary for different shells):

for i in (cls*lst)
proc2d $i avgs.hed average
done

Then pick out your class-average from avgs.hed. Say you selected class 5, to extract the corresponding particles, you would:

$HOME/EMAN/python/lstsub.py cls0005.lst extracted.hed ptcl2orig.lst

EMAN1/FAQ/Refine2d_classes (last edited 2009-06-27 16:21:58 by SteveLudtke)