generate a lst file

14 views
Skip to first unread message

Anindito Sen

unread,
Feb 26, 2025, 7:25:37 PMFeb 26
to EMAN2
Dear ALL,

I want a generate a stack of images like using a list containing files "arranged" in a specific order that looks something like this (the actual images are in the same folder)-

E3_10_2.mrc
E3_10_4.mrc
E3_10_6.mrc
E3_10_8.mrc
E3_10_10.mrc
E3_10_12.mrc
E3_10_14.mrc
E3_10_16.mrc
E3_10_18.mrc
E3_10_20.mrc
E3_10_22.mrc
E3_10_24.mrc
E3_10_26.mrc
E3_10_28.mrc
E3_10_30.mrc
E3_10_32.mrc
E3_10_34.mrc
E3_10_35.mrc
E3_10_-0.mrc
E3_10_-1.mrc
E3_10_-3.mrc
E3_10_-5.mrc
E3_10_-7.mrc
E3_10_-9.mrc
E3_10_-11.mrc
E3_10_-13.mrc
E3_10_-15.mrc
E3_10_-17.mrc
E3_10_-19.mrc
E3_10_-21.mrc
E3_10_-23.mrc
E3_10_-25.mrc
E3_10_-27.mrc
E3_10_-29.mrc
E3_10_-31.mrc
E3_10_-33.mrc
E3_10_-35.mrc
E3_10_-37.mrc


How can I make use of the list to successfully generate a stack using e2pro2d.py or (generate a tilt series)

I tried unsuccessfully


e2proc2d.py img.lst stack.hdf

Traceback (most recent call last):
  File "/opt/eman2/lib/python3.7/site-packages/EMAN2db.py", line 657, in db_get_image_count
    ret = EMUtil.get_image_count_c(fsp)
RuntimeError: ImageFormatException at /home/eman2/miniconda3/conda-bld/eman2_1615224802990/work/libEM/emutil.cpp:526: 'invalid image type' caught


During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/eman2/bin/e2proc2d.py", line 1214, in <module>
    main()
  File "/opt/eman2/bin/e2proc2d.py", line 452, in main
    nimg = EMUtil.get_image_count(infile)
  File "/opt/eman2/lib/python3.7/site-packages/EMAN2db.py", line 660, in db_get_image_count
    raise Exception(fsp)
Exception: img.lst

Let me know the correction

Regards

Andy

Steve Ludtke

unread,
Feb 27, 2025, 9:46:25 AMFeb 27
to em...@googlegroups.com
Hi. .lst files are more than just a list of filenames. They are documented towards the end of this page, along with a simple python example of how to correctly generate one:


If you don’t do python, you could just take the file below and add
#LST
by itself on the first line
then put a 0<tab> before each of the lines in your file below (0 being the first image in a file). The comment at the end of the line is optional, and if the file starts with #LST instead of #LSX, then the line lengths don’t have to be the same.  There are other ways you could accomplish your goal as well, but that approach will work, and then you’ll have a .lst file to document what you did.

Note: If those files represent tilt angles, that’s kind of a strange ordering to use, as you’d probably want 35 .. 0 .. -37  or vice-versa. Note that if you go 35 .. 0 .. -37, the tilt axis will have the opposite sign than if you do it -37 .. 0 .. 35


--
--
----------------------------------------------------------------------------------------------
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/f432668d-1213-4ddd-ae25-739366d303bcn%40googlegroups.com.

Steve Ludtke

unread,
Feb 27, 2025, 10:00:18 AMFeb 27
to em...@googlegroups.com
Sorry, opposite sign isn’t what I meant to say, I meant it would be rotated 180 degrees :^)

On Feb 27, 2025, at 8:46 AM, Steve Ludtke <slud...@gmail.com> wrote:

Hi. .lst files are more than just a list of filenames. They are documented towards the end of this page, along with a simple python example of how to correctly generate one:

Muyuan Chen

unread,
Feb 27, 2025, 11:59:26 AMFeb 27
to em...@googlegroups.com
I thought you can just run 
e2proclst.py $(cat list_of_files.txt) --create files.lst


Steve Ludtke

unread,
Feb 27, 2025, 12:02:10 PMFeb 27
to em...@googlegroups.com
You could, of course, but if you’re already going through the trouble of creating a text file containing the list of filenames in the order you want, adding #LST and 0 on each line doesn’t seem like much of an extra effort...   As I said, lots of ways to do it

Reply all
Reply to author
Forward
0 new messages