4d — Export

Handing results to other programs · 4d User Manual

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

Export — the project's results for cryoSPARC, RELION and others

The Export tab collects results from every image of the project and writes them, renamed and with their metadata, into a folder structure that another program can read: cryoSPARC's Import Movies, RELION's micrograph and coordinate conventions. Like the Datasets tab it is one window for the whole project, without per-image sub-tabs; its scripts run in the project's merge/ directory. The ? button at the top right opens this page; the ? next to a script in the list opens that script's own page.

The numbered markers on the screenshot point to each region; the legend that follows explains them.

The Export tab while the image export for cryoSPARC runs, with numbered regions 1 2 3 4 5 6 7 8 9 10 11

The image export for cryoSPARC at work on a project of 90 datasets: bright field, dark field, py4DSTEM parallax and shadow images are being copied, the Output shows rsync transferring a file and a warning about a dataset without a voltage, and the File Preview shows the metadata STAR file being written, 90 rows in 7 columns.

#RegionWhat it is and does
1Script categoriesGeneral and Fibrils; Development is not shown in 4D-STEM or Fibril picking projects.
2Script listThe scripts of the category, each with its language icon and a ? that opens its manual page. Drag the right edge of the column to see long titles in full.
3Script nameThe title of the selected script and its file name.
4Python environmentFor a Python script, the environment it runs in (see Preferences ▸ Python).
5Run and ReloadThe Run/Stop button and Reload & save results. An export runs once; there are no relaunch fields here.
6ParametersThe script's switches: the master switch, the export directory, and one Yes/No per kind of file to export.
7OutputThe live log: one block per dataset, with the rsync transfers and any warnings about missing files or metadata.
8ResultsThe values the script wrote back.
9ImagesThe result files: the export directory and the metadata STAR file.
10File PreviewThe selected result; a STAR file is shown as text with its columns and row count.
11HelpThe ? button opens this page.

The panels are described region by region on the Manual Processing page. The categories are:

CategoryShown inScripts
Generalevery project mode Export 4D-STEM images for cryoSPARC processing (Python) — the reconstructed images of every dataset (bright field, dark field, parallax, shadow, ptychography) as MRC files in one folder per type, with a STAR file of their metadata, for cryoSPARC's Import Movies.
Fibrilsevery project mode Export picked fibril coordinates — the fibril coordinates picked in the Fibrils section, with their micrographs and metadata, in a RELION-compatible layout.
Developmentnot shown in 4D-STEM or Fibril picking projects Four scripts inherited from Focus, 4d's predecessor, kept for reference while they await porting (see their pages for what they do and what they need): Export to central, Export Images&CTF data, Export Parameter Settings and Export Tomo Tiltseries.

Where the export goes

Every export script has a parameter export_basedir (default EXPORT), the directory the files are written into. Given as a plain name or a relative path it lies inside the project's merge/ directory; given as an absolute path (starting with /) it can be anywhere, e.g. on a disk the other program sees. The directory is created when missing, and the Results panel lists it as an important result, so it opens in the File Preview and in the file browser from there.

The image export has a master switch, export_doit. At n the script only simulates: it reports every file it would copy, and nothing is written. Run it that way first to check the file mapping, then set it to y.

The files are copied with rsync, so an export run a second time copies only what has changed since, and a project that keeps growing can be exported again and again into the same directory.