Skip to content

Implementation of OpenCV + reorganisation of SubframeExperiment

Raza, Zamaan requested to merge opencv into main

In this MR I have added OpenCV as a dependecy to do image processing when we are not trying to construct a full 3D model in the peak finding stage. This is particularly important for the strategy tool (#187), which requires autoindexing from a single frame, which is impossible in the current framework.

The changes are as follows:

  1. Reorganisation of the left widget of SubframeExperiment to have three tabs: i) strategy ii) histogram iii) masks. This has allowed...
  2. Elimination of the interaction mode combo of DetectorWidget, which provided a method of changing the mode that I think was inconsistent and incomprehensible to the user.
  3. Addition of a new core module, PeakFinder2D that leverages OpenCV as an external library
  4. Addition of a DataSet metadata entry, bitDepth, which is required in many OpenCV operations. This may break compatibility with older .ohkl files.
  5. Changed the plot widget of SubframeExperiment to have a tab that displays autoindexer solutions.
  6. Added a table interface enabling mask dimensions to be modified from the GUI using spin boxes (SubframeExperiment masks tab)
  7. Replaced interaction mode combo with two mutually exclusive QPushButtons to allow the zoom and rectangle select functionality in DetectorScene

From now, the mask functionality is only accessible from SubframeExperiment, although they can be seen in other widgets. The user can find blobs in any single detector image using the new strategy tab in SubframeExperiment, and attempt to autoindex using this frame only. Before attempting this, it is crucial to i) adjust the direct beam position and ii) apply masks. Note that the masking is much more critical than it is for the regular PeakFinder because the current blob-finding implementation is less discerning of heterogeneous features, and blobs will not be filtered by d-range, strength etc because it is impossible to integrate them at this point.

Fixes #538 (closed), #537 (closed), #478 (closed), #255 (closed) and #168 (closed),

Edited by Raza, Zamaan

Merge request reports