Directory spy frame#

The Directory spy frame is a graphical interface to configure and run the DirectorySpyApp. It is split in two main parts: On the left are the controls for configuring and running the application. The right part of the frame is taken by a visualization widget for the latest images read from the DirectorySpyApp.

../../../_images/full1.png

The configuration on the left holds widgets to configure all necessary application Parameters as well as to start and stop running the actual application.

Configuring the input#

Data source#

../../../_images/path.png

The first Parameter the user must define is the working path for the app. Either copy the full directory path in the field or use the Open button to select a path in a pop-up window.

../../../_images/name_pattern.png

The default settings of the app is to scan for files corresponging to a specific file-naming pattern. An existing file can be selected using the Open button and its filename modified to exchange the counters in the filename with hashtags. An example of a filename with wildcards is given on the right. Note that the Hdf5 dataset key Parameter widget is also shown automatically if a hdf5 file extension was detected.

../../../_images/scan_for_all.png

If the scan_for_all option has been selected, the filename pattern Parameter will be hidded. Note that the Hdf5 dataset key Parameter is also shown and this dataset is looked for in all new files in the specified folder.

Image corrections#

../../../_images/corrections.png

The Directory spy frame allows to mask the images with the global detector mask, toggled by changing the corresponding Parameter value.

../../../_images/bg_corr.png

In addition, a generic background image can be subtracted from all images. If this option is selected, the widget to select the filename is shown. If an hdf5 file was selected, the widgets for the selection of dataset and frame number are shown as well, see image on the right.

Running the App#

../../../_images/running.png

Running the DirectorySpyApp in this frame will automatically display the latest update in the presentation widget on the right.

A single directory scan can be performed by using the Show latest image button. This will also trigger a guaranteed update of the display widget.

A continuous process can be started by using the Start scanning button. This process will run until the pydidas UI is stopped or the Stop scanning button has been pressed. Updates to the display widget will be send based on the frequency set in the global settings.

Note

If a pattern has been selected, the app will perform a single scan of the whole directory upon starting to determine the latest image. To minimize file system access, it will then only look for the next consecutive file (and consequently, it will block if files are missing). To skip missing files, the user needs to restart the app.

Tip

The minimum frequency in which the plot is updated is defined in the global settings. Therefore, if two updates came back-to-back, pydidas will (depending on the settings) the second event and therefore will not show the latest image. A forced updated can be executed by using the Force plot update button.

Image data visualization#

Pydidas 2D plot#

The PydidasPlot2d is a subclassed silx Plot2d with additional features useful in pydidas.

../../../_images/standard_plot2d.png
  • The menu

    The menu bar allows access to all generic silx and additional pydidas functionality. The detailed menu icons and actions are described below in the menu entries description.

  • The image display

    This widget shows the image data. Depending on the zoom level, this is either the full image or a sub-region.

  • The colorbar

    The colorbar shows the reference for the used colormap to map data levels to colors.

  • The position information

    This widget displays the coordinates and data values of the data under the mouse cursor.

Two-dimensional plots are presented in a silx Plot2D widget. The toolbar options will be explained in detail below. Moving the mouse over the canvas will update the labels for x/y position and data value at the bottom of the canvas. Note that the x and y axis positions for each pixel are defined at the pixel center and the given values must be treated carefully with respect to the pixel shape, especially for coarse pixels.

Tip

The scaling of the results can be achieved by modifying the colormap settings.