Identifying the 3D particles associated with the 2D particles

16 views
Skip to first unread message

Reza Khayat

unread,
Apr 16, 2026, 9:09:36 PM (8 days ago) Apr 16
to EMAN2
Hi,
I have identified a set of 2D particles, from aliptcls2d_XX.lst file, whose associated 3D particles I would like to identify. I'd like run additional refinement on these 3D, and associated 2D, particles. Are there tools available for doing this? 

Best wishes,
Reza

Steve Ludtke

unread,
Apr 16, 2026, 11:00:16 PM (8 days ago) Apr 16
to em...@googlegroups.com
By "identified" what do you mean?  Do you have a .lst file containing only the 2-D particles you wish to use, or a list of particle numbers, or something else?  Did you identify only a single 2-D particle for each 3-D particle, or do you have multilple 2-D particles for each.  The necessary metadata exists to do what you want, but the practical approach will depend on what you have.

--
--
----------------------------------------------------------------------------------------------
You received this message because you are subscribed to the Google
Groups "EMAN2" group.
To post to this group, send email to em...@googlegroups.com
To unsubscribe from this group, send email to eman2+un...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/eman2

---
You received this message because you are subscribed to the Google Groups "EMAN2" group.
To unsubscribe from this group and stop receiving emails from it, send an email to eman2+un...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/eman2/ff9ba8f3-acb9-4c63-8e9d-26c4ea60f430n%40googlegroups.com.

Reza Khayat

unread,
Apr 16, 2026, 11:37:53 PM (8 days ago) Apr 16
to EMAN2
I have a list of 2D particles (a subset of the aliptcls2d_XX.lst). The file contains all tilts for each 3D particle. It's a one:one correspondence. 

Steve Ludtke

unread,
Apr 17, 2026, 10:15:53 PM (7 days ago) Apr 17
to em...@googlegroups.com
Hi Reza,
Sorry for the delay. Busy day.

I'm not 100% sure it's necessary to extract a 3-D substack, it might already only use 3-D particles which are referenced in the 2-D particles?  I'm not positive. Muyuan would have to answer. If you want to be careful, you'd need a little python script to extract the corresponding 3-D particles and remap the 2-D particles:



# This program will extract the 3-D particles corresponding to a subset of 2-D particles in SPT

# it will also generate a new 2-D file with renumbered 3-D references

# usage program.py <2d substack lst> <3d stack lst> <new 2d out> <new 3d out>


from EMAN3 import *

import sys,os


try: os.unlink(sys.argv[3])

except: pass

try: os.unlink(sys.argv[4])

except: pass


in2d=LSXFile(sys.argv[1])

in3d=LSXFile(sys.argv[2])

out2d=LSXFile(sys.argv[3])

out3d=LSXFile(sys.argv[4])



pt3did={int(x[2]["ptcl3d_id"]) for x in in2d}

pt3dlst=sorted(list(pt3did))

map=dict()


for i,j in enumerate(pt3dlst):

out3d[i]=in3d[j]

map[j]=i


for num,fsp,meta in in2d:

meta["ptcl3d_id"]=map[meta["ptcl3d_id"]]

out2d[-1]=num,fsp,meta





Reza Khayat

unread,
Apr 18, 2026, 11:04:55 AM (6 days ago) Apr 18
to EMAN2
Hi Steve,

Thanks so much, this works great!

Best wishes,
Reza

Reply all
Reply to author
Forward
0 new messages