Library Panels — the preview overviews
The LibraryPanels page of Preferences defines the preview
overviews shown in the Library's preview panel
(the right-hand side, and the per-dataset preview). Each Overview
is one preview page — a titled grid of result images. This is where you decide
which images appear in each overview, their captions, the shape of the image
grid (rows × columns), in which program modes the overview is shown, and
which images are combined for the overlay view. Each overview is stored in a
file of its own in scripts/config/ of the 4d installation, named
overview_0010000.json, overview_0020000.json, …
(see The overview files below).
Each overview has its own tab. The arrow buttons at the left end of the row of tabs step from one overview to the next and back, Add Overview at its right end appends a new tab, and the ? button at the top-right opens this page. The numbered markers on the screenshot point to each region; the legend explains them. A tab holds the overview's fields in its left half and its board of tiles in the right half. The screenshot was taken with the Mode field's list of modes open (11).
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
| # | Region / field | What it is and does |
|---|---|---|
| 1 | Preferences tabs | The eight Preferences pages; LibraryPanels is selected here. |
| 2 | Title | The panel title, "Library Panels." |
| 3 | Help | The ? button at the right end of the title line opens this page. |
| 4 | ◀ ▶ arrows | At the left end of the row of tabs: step to the previous or next overview, wrapping round at the ends. |
| 5 | Add Overview | At the right end of the row of tabs: appends a new overview as the last tab and opens it. |
| 6 | Overview tabs | One tab per overview, labelled like its heading in the Library preview: "(2) Reconstruction Overview". The number is the overview's position in the alphabetical order of the overview files; long titles are shortened with an ellipsis. Every overview has its tab; the name is greyed out when the overview is not shown in the current program mode, because its Mode is neither ALL nor contains the mode's digit. |
| 7 | Overview N headline | Behind the headline, Copy keeps the whole overview for pasting, Paste inserts the copied overview as a new tab behind this one (titled "… (copy)" until renamed), and Delete removes the overview after asking "Are you sure?"; the overviews behind it are renumbered. Under the headline, "File: overview_0020000.json" names the file the overview is saved to. |
| 8 | Title | The heading shown over this overview in the Library preview, prefixed there with the overview's number: "(2) Reconstruction Overview". |
| 9 | Mode | The program modes in which this overview is shown (e.g. 67), or ALL. A click into the field opens the list of modes (11). |
| 10 | Overlay | Which two image slots are shown alternately in the overlay view (e.g. 12 = slots 1 and 2), used when Activate Overlay is pressed in the Library preview. A click into the field opens a list of the slots 1 to 9 with squares to tick; two can be ticked, slots beyond the chosen shape are greyed out, and no tick means no overlay. The field turns red unless it names two slots of the shape. |
| 11 | List of modes | Opened by a click into Mode: ALL and the program modes by name (6 4D-STEM, 7 Fibril picking), each with a square to tick. Ticking ALL clears the digits, ticking a digit clears ALL; the field shows the result. A click anywhere else closes the list. |
| 12 | Rows / Columns | How many rows and columns of the board are in use, 1 to 3 each (3 × 2 here). The Library preview lays the images out in this shape. The line underneath reminds you how the tiles work. |
| 13 | Slot number | The top-left rows × columns tiles are yellow: the slots of the overview, numbered row by row in their corner. These are the numbers the Overlay field refers to. |
| 14 | File name | The result-image file name shown in the slot (e.g. parallax_output_upsampled.mrc). Click it to edit it in place: Return, Tab or a click elsewhere keeps the edit, Escape drops it. Drag the tile onto another yellow slot to change the order: the tiles in between move out of its way while it hovers, and dropping it keeps that order (dropping it outside the board restores the old one). An empty yellow tile stays blank in the preview. |
| Modern style | The slots are white tiles with their number in a small badge; each shows the figure of the dataset chosen under Preview (next to Add Overview), with the title and the file name under it. A file name that dataset has no file of makes a dashed tile that says “Not in …”; an MRC file says that it has no preview. | |
| 15 | Title | The caption shown under the image in the preview (e.g. Parallax Reconstruction); click it to edit it in place like the file name. |
| 16 | Grey tiles | Tiles beyond the chosen shape are grey and not in use. They keep whatever they held, dimmed and locked, so a shape can be changed back without losing entries. All nine tiles are sized so that they fit the right half of the page. |
| 17 | Save and Close / Close | Save and Close writes each overview to its file and removes the files of deleted overviews, and the Library preview refreshes to match; Close discards the changes. |
How it works
- Each Overview corresponds to one page of the Library preview panel. Choose how many Rows and Columns it uses, then click into each yellow tile to enter the file name of a result image that your processing scripts produce, and the title shown under it.
- The Mode field decides in which program modes the overview appears; the Overlay field selects the slots blended by the Library preview's Activate Overlay button, by the numbers in the tiles.
- Add Overview appends a page, Copy and Paste duplicate one, and Delete removes it. Nothing is written until Save and Close is pressed; the Library preview then refreshes to match. The images themselves come from running the processing scripts on a dataset.
The overview files
Each overview is one JSON file in scripts/config/, named
overview_ plus a seven-digit number: overview_0010000.json,
overview_0020000.json, overview_0030000.json, …
The Library preview and this page use the overviews in the
alphabetical order of their file names, so the number decides
the position. The steps of 10000 leave room in between: to put a new overview
between two others, give it the number half way between theirs, e.g.
overview_0025000.json between overview_0020000.json and
overview_0030000.json. A file looks like this:
{
"title": "2) Reconstruction Overview",
"mode": "67",
"overlay": "12",
"rows": 3,
"columns": 2,
"frames": [
{ "path": "parallax_output_upsampled.mrc", "title": "Parallax Reconstruction" },
{ "path": "shadow_image.mrc", "title": "Shadow Image" },
{ "path": "parallax_output_upsampled_fft.mrc", "title": "FFT of Parallax Reconstruction" },
{ "path": "shadow_image_fft.mrc", "title": "FFT of Shadow Image" },
{ "path": "parallax_convergence.png", "title": "Parallax Convergence" },
{ "path": "parallax_shift_map.png", "title": "Parallax Shift Map" }
]
}
title,modeandoverlayare the fields of the same names on this page; a file withoutmodeis shown in every program mode.rowsandcolumnsgive the shape of the grid. Without them, or when they are too small for the frames, the shape follows from the number of frames.frameslists the slots row by row: the image file (path) and its caption (title). A frame with an empty path is an empty slot.
This page follows the same rules. Add Overview and
Paste name the new overview's file after its place: half way
between the files before and behind it, or the next multiple of 10000 behind
the last one. Only when no number is left in between (or a neighbouring file is
not named overview_ + seven digits) are all overviews renumbered
10000, 20000, 30000, … and their files renamed on saving. A file that
cannot be read (e.g. after a typing error in it) is listed above the tabs and
left as it is when saving. Files that do not match
overview_*.json are ignored, so an overview can be set aside by
renaming its file, e.g. to overview_0030000.json.off.