home
about
news
download
doc
source
systems
tests
bugs
contact
IMP Reference Guide
2.21.0
The Integrative Modeling Platform
IMP Manual
Reference Guide
Tutorial Index
Modules
Classes
Examples
version 2.21.0
em2d/em_images_conversion.py
Conversion of Electron Microscopy Images.
1
## \example em2d/em_images_conversion.py
2
# Conversion of Electron Microscopy Images.
3
#
4
5
import
IMP
6
import
IMP.em2d
7
import
sys
8
9
IMP.setup_from_argv
(sys.argv,
"EM images conversion"
)
10
11
"""
12
Conversion of Electron Microscopy Images.
13
14
"""
15
16
# Read images
17
fn_selection =
IMP.em2d.get_example_path
(
"all-1z5s-projections.sel"
)
18
19
srw =
IMP.em2d.SpiderImageReaderWriter
()
20
trw =
IMP.em2d.TIFFImageReaderWriter
()
21
fn_images = IMP.em2d.read_selection_file(fn_selection)
22
fn_images = [
IMP.em2d.get_example_path
(x)
for
x
in
fn_images]
23
images =
IMP.em2d.read_images
(fn_images, srw)
24
# write
25
fn_saved = IMP.em2d.create_filenames(3,
"1z5s-projection"
,
"tif"
)
26
IMP.em2d.save_images
(images, fn_saved, trw)