4d — Export Images & CTF data

Export scripts · 4d User Manual

← Back to the Export tab · Export, Stats & Notifications

Export Images&CTF data experimental

This script (export/DEVELOPMENT/export_drift.script, a C-shell script) is the export of a conventional drift-correction project, as Focus ran it next to a TEM: for every image it copies the chosen files of the movie pipeline — raw stack, gain reference and defect map, gain-corrected and drift-corrected stacks, the drift-corrected average (with and without dose weighting), the drift plot, the CTF diagnostic image — into one subdirectory per kind of file under the export directory, each renamed after the original movie, and it builds a RELION micrograph STAR file with the CTF values of every image.

Status. One of the four Development exports inherited from Focus, not shown in 4D-STEM or Fibril picking projects and awaiting porting. Its switches and subdirectory names (export_anything_doit, export_rawstack_doit, export_…_subdir, …) are not defined in the current parameter files, so the Parameters panel shows only export_basedir; and it reads the per-image 2dx_image.cfg files and 2dx_merge_dirfile.dat of a Focus project, which a 4d project does not have. It does not run as it stands. For 4D-STEM data the image export for cryoSPARC is the working counterpart.

Parameters

ParameterRole
export_anything_doitThe master switch: 0 does nothing; 1 and 2 export (the helper distinguishes a full export from one that leaves the large stacks out).
export_basedirThe export directory, taken relative to merge/LOGS/.
export_rawstack_doit / _subdirThe raw movie as imported.
export_gainref_doit, export_pixeldef_doit / export_gainref_subdirThe gain reference and the defect map, under their original names.
export_gaincorstack_doit / _subdirThe gain-corrected stack.
export_driftcorstack_doit / _subdirThe drift-corrected stack (…_aligned.mrcs).
export_driftcoraver_doit / _subdirThe drift-corrected average, dose-weighted (<name>.mrc) and not (<name>_noDW.mrc).
export_driftcorfig_doit / _subdirThe drift plot, the image's configuration file, and MotionCor2's shifts when present.
export_CTFDiag_doit / _subdirThe CTF diagnostic image (<name>.ctf:mrc) and CTFFIND4's or gCTF's text output.
export_CTFstar_doitWrite the micrograph STAR file from the CTF values of the image's configuration; otherwise the gCTF results of the image are appended.

Algorithm

  1. Creates the export directory and lists the two STAR files it will write as important results.
  2. For every image directory of the project list: reads the names of its files and its CTF values (defocus, figure of merit, resolution limit, phase shift), voltage, Cs, pixel size and iciness from its configuration; derives the export name from the raw movie's name (dots and the extension removed).
  3. Copies each enabled kind of file with the helper import_export_sub.com (an rsync -auvP into <basedir>/<subdir>/<export name>).
  4. Appends one row per image to micrographs_all_defocus.star — micrograph, CTF image, defocus U/V/angle, voltage, Cs, amplitude contrast (from phacon), magnification, detector pixel size, figure of merit, maximum resolution, phase shift — and the same row with the image's iciness to micrographs_all_defocus_withIciness.star, writing the RELION 3.0 headers first when the files are new.
  5. Advances the progress bar by image and re-reads the results at the end.