IMP logo
IMP Reference Guide  2.10.0
The Integrative Modeling Platform
em_images_conversion.py
1 ## \example em2d/em_images_conversion.py
2 # Conversion of Electron Microscopy Images.
3 #
4 
5 import IMP
6 import IMP.em2d
7 import os
8 import sys
9 
10 IMP.setup_from_argv(sys.argv, "EM images conversion")
11 
12 """
13  Conversion of Electron Microscopy Images.
14 
15 """
16 
17 # Read images
18 fn_selection = IMP.em2d.get_example_path("all-1z5s-projections.sel")
19 
22 fn_images = IMP.em2d.read_selection_file(fn_selection)
23 fn_images = [IMP.em2d.get_example_path(x) for x in fn_images]
24 images = IMP.em2d.read_images(fn_images, srw)
25 # write
26 fn_saved = IMP.em2d.create_filenames(3, "1z5s-projection", "tif")
27 IMP.em2d.save_images(images, fn_saved, trw)
Restraints using electron microscopy 2D images (class averages).
Strings setup_from_argv(const Strings &argv, std::string description, std::string positional_description, int num_positional)
std::string get_example_path(std::string file_name)
Return the full path to one of this module's example files.
Images read_images(const Strings &names, const ImageReaderWriter *rw)
void save_images(Images images, const Strings &names, const ImageReaderWriter *rw)
Management of reading/writing TIFF images.