4d — Viewers

Preferences ▸ General ▸ Viewers · 4d User Manual

← Back to Preferences

Viewers — the programs used to open files

The Viewers section, at the end of the General page of Preferences, sets the external program/command 4d uses to open each kind of file — result images, documents, scripts, and datasets. Whenever you open a file (for example from a processing window's Results / Images panel, or "open in the viewer"), 4d runs the command configured here with the file name appended.

The numbered markers on the screenshot point to each region; the legend explains them, and the table below lists every entry. The ? button at the right end of the Viewers title line opens this page.

The Viewers preferences page with numbered regions 1 2 3 4 5
#RegionWhat it is and does
1Preferences tabsThe eight Preferences pages. The Viewers are the last section of the General page, below General, Manual and Overall Font.
2TitleThe Viewers section title. The ? help button sits at the right end of this line.
3Viewer / editor nameThe file type or tool a row configures (e.g. Script Editor, PNG Image Viewer, 3D Viewer).
4CommandThe shell command 4d runs to open that type — the file name is appended to it. Use whatever launches the program on your system.
–Default ValuesRight of each command (not yet on the screenshot): the command 4d was installed with, and an arrow that copies it into the row. See the note below.
5CloseClose the Preferences dialog.
As on the Manual Processing tab, a grey field at the right end of each row, under the heading Default Values, shows the value 4d was installed with, in a lighter grey while the parameter holds that value. The arrow button left of it copies the default into the parameter. After a copy the arrow turns into a cross (Undo): click it, or press Command-Z or Control-Z, to put the value from before back. Only the last copy can be undone, and only while the parameter still holds the default.

The entries

Each row maps a use to a launch command (the file to open is added after the command). Example values, as shipped on macOS:

EntryOpens…Example command
Script EditorShell scripts — Bash or C-shell (.script/.com/.sh) — and text files.open -e
Python Script EditorPython (.py) scripts.code
Web BrowserHTML pages and URLs (also the online manual).open
JPEG / JPG Image ViewerJPEG images.open
PS Image ViewerPostScript images.open
PDF ViewerPDF documents.open
PNG Image ViewerPNG images (most result previews).open
3D Viewer3D volumes / maps.open -n -a /Applications/Chimera.app
TIFF Images ViewerTIFF images.open
HDF5 (h5) Images Viewer4D-STEM HDF5 datasets.open -a 4d_stem_visualizer.py
Stack image viewerMRC image stacks.e2display.py
Use commands appropriate to your platform. On macOS, open uses the default app for the file type, open -a <App> or open -a <script> forces a specific one, and open -e opens in TextEdit; on Linux, use the program's executable name (e.g. xdg-open, code, eog) instead. A direct executable or script name (e.g. e2display.py) is run with the file as its argument.