cosedaUI package¶
Subpackages¶
- cosedaUI.importers package
- Submodules
- cosedaUI.importers.import_emd_window module
EMDImportThreadImportEMDWindowImportEMDWindow.add_emd_file()ImportEMDWindow.add_emd_folder()ImportEMDWindow.closeEvent()ImportEMDWindow.dragEnterEvent()ImportEMDWindow.dropEvent()ImportEMDWindow.import_finished()ImportEMDWindow.init_ui()ImportEMDWindow.remove_selected_items()ImportEMDWindow.start_import()ImportEMDWindow.start_monitor()ImportEMDWindow.stop_monitor()ImportEMDWindow.update_status()
- cosedaUI.importers.import_h5_window module
- cosedaUI.importers.import_mrc_window module
- cosedaUI.importers.import_tiff_window module
- Module contents
ImportEMDWindowImportEMDWindow.add_emd_file()ImportEMDWindow.add_emd_folder()ImportEMDWindow.closeEvent()ImportEMDWindow.dragEnterEvent()ImportEMDWindow.dropEvent()ImportEMDWindow.import_finished()ImportEMDWindow.init_ui()ImportEMDWindow.remove_selected_items()ImportEMDWindow.start_import()ImportEMDWindow.start_monitor()ImportEMDWindow.stop_monitor()ImportEMDWindow.update_status()
ImportH5WindowImportMRCWindowImportTiffWindow
- cosedaUI.indexintegrate_sections package
- Submodules
- cosedaUI.indexintegrate_sections.cellfile module
- cosedaUI.indexintegrate_sections.geomfile module
- cosedaUI.indexintegrate_sections.helpers module
- cosedaUI.indexintegrate_sections.ici module
- cosedaUI.indexintegrate_sections.index_settings module
- cosedaUI.indexintegrate_sections.run_control module
- Module contents
- cosedaUI.mainwindow_sections package
- Submodules
- cosedaUI.mainwindow_sections.cluster module
- cosedaUI.mainwindow_sections.imports module
- cosedaUI.mainwindow_sections.indexing module
- cosedaUI.mainwindow_sections.viewer module
ViewerMixinViewerMixin.adjust_brightness()ViewerMixin.adjust_brightness_value()ViewerMixin.adjust_contrast()ViewerMixin.adjust_contrast_value()ViewerMixin.adjust_gamma()ViewerMixin.adjust_gamma_value()ViewerMixin.change_frame()ViewerMixin.change_frame_from_entry()ViewerMixin.clear_vdf_overlay()ViewerMixin.draw_peak_preview()ViewerMixin.ensure_atlas_for_current_file()ViewerMixin.export_current_frame()ViewerMixin.export_current_frame_as_shown()ViewerMixin.find_strongest_frame()ViewerMixin.go_to_strongest_frame()ViewerMixin.handle_image_update()ViewerMixin.keyPressEvent()ViewerMixin.load_image_from_hdf5()ViewerMixin.next_frame()ViewerMixin.on_frame_order_changed()ViewerMixin.on_show_strong_peaks_toggled()ViewerMixin.on_slider_release()ViewerMixin.on_slider_start()ViewerMixin.open_aurora_plot()ViewerMixin.open_map()ViewerMixin.previous_frame()ViewerMixin.resizeEvent()ViewerMixin.set_vdf_overlay()ViewerMixin.show_pixel_index()ViewerMixin.update_image()ViewerMixin.update_map_thumbnail()
- cosedaUI.mainwindow_sections.workflow module
WorkflowMixinWorkflowMixin.display_log_file()WorkflowMixin.open_check_metadata_window()WorkflowMixin.open_export_window()WorkflowMixin.open_index_integrate_window()WorkflowMixin.open_index_window()WorkflowMixin.open_merge_window()WorkflowMixin.open_strip_files_window()WorkflowMixin.open_unit_cell_hist_window()WorkflowMixin.open_workspace_unit_cell_fit_window()WorkflowMixin.report_issue()
- cosedaUI.mainwindow_sections.workspace module
WorkspaceMixinWorkspaceMixin.add_generated_ini_paths()WorkspaceMixin.add_ini_files()WorkspaceMixin.add_ini_paths()WorkspaceMixin.apply_center_finder_settings()WorkspaceMixin.apply_peakfinder_settings()WorkspaceMixin.calculate_radial_profiles()WorkspaceMixin.ensure_index_dataset()WorkspaceMixin.highlight_selected_file()WorkspaceMixin.load_last_directory()WorkspaceMixin.load_last_workspace_state()WorkspaceMixin.new_workspace()WorkspaceMixin.on_indexintegrate_requested_select_ini()WorkspaceMixin.on_ini_select()WorkspaceMixin.open_centerfinder_settings_window()WorkspaceMixin.open_centerrefinement_settings_window()WorkspaceMixin.open_file()WorkspaceMixin.open_peakfinder_settings_window()WorkspaceMixin.open_workspace()WorkspaceMixin.reload_current_file()WorkspaceMixin.reload_file_preserve_frame()WorkspaceMixin.remove_ini_files()WorkspaceMixin.save_workspace()WorkspaceMixin.save_workspace_state()WorkspaceMixin.start_coordinate_selection()WorkspaceMixin.stop_live_preview()WorkspaceMixin.update_frame_from_map_click()WorkspaceMixin.update_workflow_buttons()
- Module contents
ClusterMixinImportMixinIndexingMixinViewerMixinViewerMixin.adjust_brightness()ViewerMixin.adjust_brightness_value()ViewerMixin.adjust_contrast()ViewerMixin.adjust_contrast_value()ViewerMixin.adjust_gamma()ViewerMixin.adjust_gamma_value()ViewerMixin.change_frame()ViewerMixin.change_frame_from_entry()ViewerMixin.clear_vdf_overlay()ViewerMixin.draw_peak_preview()ViewerMixin.ensure_atlas_for_current_file()ViewerMixin.export_current_frame()ViewerMixin.export_current_frame_as_shown()ViewerMixin.find_strongest_frame()ViewerMixin.go_to_strongest_frame()ViewerMixin.handle_image_update()ViewerMixin.keyPressEvent()ViewerMixin.load_image_from_hdf5()ViewerMixin.next_frame()ViewerMixin.on_frame_order_changed()ViewerMixin.on_show_strong_peaks_toggled()ViewerMixin.on_slider_release()ViewerMixin.on_slider_start()ViewerMixin.open_aurora_plot()ViewerMixin.open_map()ViewerMixin.previous_frame()ViewerMixin.resizeEvent()ViewerMixin.set_vdf_overlay()ViewerMixin.show_pixel_index()ViewerMixin.update_image()ViewerMixin.update_map_thumbnail()
WorkflowMixinWorkflowMixin.display_log_file()WorkflowMixin.open_check_metadata_window()WorkflowMixin.open_export_window()WorkflowMixin.open_index_integrate_window()WorkflowMixin.open_index_window()WorkflowMixin.open_merge_window()WorkflowMixin.open_strip_files_window()WorkflowMixin.open_unit_cell_hist_window()WorkflowMixin.open_workspace_unit_cell_fit_window()WorkflowMixin.report_issue()
WorkspaceMixinWorkspaceMixin.add_generated_ini_paths()WorkspaceMixin.add_ini_files()WorkspaceMixin.add_ini_paths()WorkspaceMixin.apply_center_finder_settings()WorkspaceMixin.apply_peakfinder_settings()WorkspaceMixin.calculate_radial_profiles()WorkspaceMixin.ensure_index_dataset()WorkspaceMixin.highlight_selected_file()WorkspaceMixin.load_last_directory()WorkspaceMixin.load_last_workspace_state()WorkspaceMixin.new_workspace()WorkspaceMixin.on_indexintegrate_requested_select_ini()WorkspaceMixin.on_ini_select()WorkspaceMixin.open_centerfinder_settings_window()WorkspaceMixin.open_centerrefinement_settings_window()WorkspaceMixin.open_file()WorkspaceMixin.open_peakfinder_settings_window()WorkspaceMixin.open_workspace()WorkspaceMixin.reload_current_file()WorkspaceMixin.reload_file_preserve_frame()WorkspaceMixin.remove_ini_files()WorkspaceMixin.save_workspace()WorkspaceMixin.save_workspace_state()WorkspaceMixin.start_coordinate_selection()WorkspaceMixin.stop_live_preview()WorkspaceMixin.update_frame_from_map_click()WorkspaceMixin.update_workflow_buttons()
Submodules¶
cosedaUI.about_window module¶
About dialog for COSEDA.
cosedaUI.aurora_window module¶
Aurora plot dialog for detector saturation inspection.
- class cosedaUI.aurora_window.AuroraPlotWindow(*args, **kwargs)[source]¶
Bases:
QDialogSmall non-modal window that renders peak max intensity versus detector radius.
- Parameters:
hdf5_path (Optional[str])
ini_path (Optional[str])
workspace_files (Optional[list[dict]])
- property hdf5_path¶
- class cosedaUI.aurora_window.AuroraPlotWorker(*args, **kwargs)[source]¶
Bases:
QObjectWorker object for computing aurora histograms outside the UI thread.
- Parameters:
file_specs (list[dict])
force_recompute (bool)
window_size (int)
- failed¶
alias of
str
- finished¶
alias of
object
- progress¶
alias of
str
cosedaUI.cellfile_window module¶
Modal editor to create and persist CrystFEL .cell files from an INI workspace.
cosedaUI.export module¶
UI for exporting SHELX HKLF4 files and generating INS/P4P from merged streams (cell parsed from stream header).
cosedaUI.findcenters_window module¶
UI for running and reviewing center finding workflows.
- class cosedaUI.findcenters_window.CenterFinderSettingsWindow(*args, **kwargs)[source]¶
Bases:
QDialogSettings dialog for configuring and running centerfinding across datasets.
- add_plot_to_viewer(batch_num, iter_num, file_path)[source]¶
Adds a plot to the QTreeWidget under the appropriate batch and iteration.
- get_parameter_from_config(config, section, parameter, default_value, is_optional=False, value_type=<class 'int'>, aliases=None)[source]¶
Retrieve parameter from config. If optional and not present, return empty string. Otherwise, return value converted to specified type or default.
- on_field_focused()[source]¶
Request coordinate selection from the main viewer when x0/y0 gains focus.
- on_find_centers_all()[source]¶
Initiates center finding on all INI files in the directory using the selected method.
- on_find_centers_current()[source]¶
Initiates center finding on the current INI file using the selected method.
- on_force_linear_toggled(checked)[source]¶
Force cannot stay enabled when skip is active.
- Parameters:
checked (bool)
- on_method_change(index)[source]¶
Toggle visibility of settings panels depending on method selection.
- on_skip_linear_toggled(checked)[source]¶
Skip and force are mutually exclusive; skip wins.
- Parameters:
checked (bool)
- progress_updated¶
alias of
int
- receive_coordinate(x_value, y_value)[source]¶
Receive picked coordinates from the main viewer and populate x0/y0 fields.
- Parameters:
x_value (int)
y_value (int)
- settings_applied¶
alias of
dict
- class cosedaUI.findcenters_window.FocusableLineEdit(*args, **kwargs)[source]¶
Bases:
QLineEdit- Parameters:
args (Any)
kwargs (Any)
- Return type:
Any
- class cosedaUI.findcenters_window.NumericSortTreeWidgetItem(*args, **kwargs)[source]¶
Bases:
QTreeWidgetItemTree item that sorts batch numbers numerically on column 0.
- Parameters:
args (Any)
kwargs (Any)
- Return type:
Any
- class cosedaUI.findcenters_window.PreviewWindow(*args, **kwargs)[source]¶
Bases:
QDialogPop-out preview showing per-batch centerfinding plots and metadata.
cosedaUI.geomfile_window module¶
UI to build and validate a CrystFEL geometry file from an INI workspace.
cosedaUI.h5_metadata_loader module¶
Background worker for collecting essential HDF5 metadata.
cosedaUI.ici_window module¶
- class cosedaUI.ici_window.GuiStream(callback)[source]¶
Bases:
objectSimple stream object that forwards writes to a callback. Used to capture stdout/stderr and send to the GUI.
- class cosedaUI.ici_window.OrchestratorWidget(*args, **kwargs)[source]¶
Bases:
QWidget
- class cosedaUI.ici_window.OrchestratorWorker(*args, **kwargs)[source]¶
Bases:
QObjectWorker object that runs orch.main(argv) inside a QThread and forwards stdout/stderr and progress to the GUI via signals.
- finished¶
alias of
int
- progress_init¶
alias of
int
- progress_step¶
alias of
int
- text_ready¶
alias of
str
cosedaUI.image_tools module¶
Utilities for inspecting and exporting images in the COSEDA UI.
- class cosedaUI.image_tools.HoverLabel(*args, **kwargs)[source]¶
Bases:
QLabelQLabel that emits cursor position while hovering (mouse tracking on).
- hovered¶
alias of
int
- class cosedaUI.image_tools.ImageInspector(image_label, original_image_getter, parent)[source]¶
Bases:
objectInteractive ROI inspector that shows zoomed pixel values from the displayed image.
- cosedaUI.image_tools.draw_pixmap_scalebar(pixmap, x_span_m, font_frac=0.045, margin_x_frac=0.05)[source]¶
Draw a 1-2-5 ‘nice’ scalebar (nm/µm/mm) bottom-left onto a QPixmap.
x_span_mis the physical width the pixmap spans, in metres. Fractions size the font / horizontal inset relative to the pixmap so it works at any scale.
- cosedaUI.image_tools.export_display_image(parent, pil_image)[source]¶
Prompt for a filename and save the displayed PIL image (RGB) as PNG or JPEG.
cosedaUI.indexing_stream_manager module¶
Helper class for parsing CrystFEL streams and matching them to HDF5 frames.
- class cosedaUI.indexing_stream_manager.IndexingStreamManager(stream_parser, get_hdf5_path, get_total_frames, log_fn=None)[source]¶
Bases:
objectEncapsulates stream parsing, frame matching, and overlay caching.
- Parameters:
get_hdf5_path (Callable[[], Optional[str]])
get_total_frames (Callable[[], Optional[int]])
log_fn (Optional[Callable[[str], None]])
- compare_peaks(h5_peaks, stream_peaks, tolerance=0.6)[source]¶
Return counts of unmatched peaks between HDF5 and stream within +/- tolerance.
- Parameters:
tolerance (float)
- find_chunk_with_reflections_from(start_index, step)[source]¶
- Parameters:
start_index (int)
step (int)
- get_reflections_for_frame(frame_index, chunk, image_shape=(None, None))[source]¶
- Parameters:
frame_index (int)
image_shape (Tuple[int | None, int | None])
cosedaUI.indexintegrate_window module¶
UI for configuring and running CrystFEL indexing/integration from the workspace.
- class cosedaUI.indexintegrate_window.IndexingControlWindow(*args, **kwargs)[source]¶
Bases:
IndexSettingsMixin,CellfileMixin,GeomfileMixin,IciMixin,RunControlMixin,QWidgetTabbed dialog for managing runs, editing params, and launching indexamajig.
- MAX_INDEXER_THREADS = 1¶
- class ProcessOutputThread(*args, **kwargs)[source]¶
Bases:
QThreadStream stdout from a subprocess and emit lines to the UI.
- output_received¶
alias of
str
- ini_selection_changed¶
alias of
str
cosedaUI.mainwindow module¶
Main application window for COSEDA UI.
- class cosedaUI.mainwindow.AspectRatioWidget(*args, **kwargs)[source]¶
Bases:
QWidgetA container that maintains a fixed aspect ratio based on the latest image loaded.
- class cosedaUI.mainwindow.IniListWidget(*args, **kwargs)[source]¶
Bases:
QListWidgetQListWidget that accepts dropped INI files and emits their paths.
- files_dropped¶
alias of
list
- class cosedaUI.mainwindow.cosedaUI(*args, **kwargs)[source]¶
Bases:
ClusterMixin,WorkflowMixin,ImportMixin,IndexingMixin,ViewerMixin,WorkspaceMixin,QMainWindowPrimary UI shell: workspace browser, viewers, and workflow launchers.
- add_generated_ini_paths(paths, show_warnings=True)¶
Add importer-generated INI files to the workspace.
Returns a dict with added/skipped/invalid path lists so import dialogs can report concise status without duplicating workspace mutation logic.
- add_ini_files()¶
Open a dialog to add INI files to the workspace list.
- add_ini_paths(paths)¶
Add provided INI file paths to the workspace list (no file dialog).
- adjust_brightness(image, brightness_factor)¶
- adjust_brightness_value()¶
- adjust_contrast(image, contrast_factor)¶
- adjust_contrast_value()¶
- adjust_gamma(image, gamma=1.0)¶
- adjust_gamma_value()¶
- apply_center_finder_settings(settings)¶
- apply_peakfinder_settings(settings)¶
Slot function to apply peak finder settings emitted from PeakFinderSettingsWindow.
- calculate_radial_profiles()¶
Compute radial intensity profiles for this file or all workspace files.
- change_frame(value)¶
Slot to handle changes in the frame_slider’s value.
- Parameters:
value (int) – The new value from the slider representing the frame index.
- change_frame_from_entry()¶
- clear_vdf_overlay()¶
Remove the virtual dark-field detector overlay from the main preview.
- display_log_file()¶
- draw_peak_preview(image, peaks)¶
- ensure_atlas_for_current_file()¶
Create the default saved atlas when all inputs exist and no atlas is saved.
- ensure_index_dataset(hdf5_path)¶
Ensure that an ‘index’ dataset exists in the ‘entry/data’ group. If not, and if the length of the ‘images’ dataset matches one of the stage position datasets, create the ‘index’ dataset as a sequence [0, 1, …, num_frames-1].
- Parameters:
hdf5_path (str) – The path to the HDF5 file.
- export_current_frame()¶
Use helper to export the raw HDF5 frame as a TIFF.
- export_current_frame_as_shown()¶
Use helper to export the displayed (adjusted) image.
- find_strongest_frame()¶
Scan nPeaks lazily so the UI stays responsive even for large files.
- go_to_strongest_frame()¶
- handle_image_update(message)¶
- highlight_selected_file()¶
- ini_selection_changed¶
alias of
str
- keyPressEvent(event)¶
Handle left/right arrow keys to navigate frames.
- load_image_from_hdf5()¶
- load_last_directory()¶
Restore last directory and last workspace (file or INI list) from config.
- load_last_workspace_state()¶
Restore workspace state from configuration (named file or INI list).
- new_workspace()¶
Clear the current workspace list and reset state.
- next_frame()¶
- on_frame_order_changed(index)¶
- on_indexing_run_stream_changed(stream_path)¶
Called by the Index & Integrate window whenever the selected run changes. Updates the available stream path and resets cached overlays.
- Parameters:
stream_path (str | None)
- on_indexintegrate_requested_select_ini(ini_path)¶
Slot: the Index & Integrate window asked us to select a given INI path. We set the QListWidget selection accordingly; this triggers on_ini_select().
- Parameters:
ini_path (str)
- on_ini_select()¶
- on_kill_all_clusters()¶
Kill all Dask clusters on this machine and inform the user.
- on_kill_current_cluster()¶
Kill the current Dask cluster and inform the user.
- on_open_dashboard()¶
Opens the Dask dashboard URL for the current cluster in the default browser.
- on_set_cluster_address()¶
Prompt for and set the Dask scheduler address override.
- on_show_strong_peaks_toggled(state)¶
- on_slider_release()¶
- on_slider_start()¶
- on_toggle_indexing_results(checked)¶
Handle enabling/disabling the indexing overlay.
- Parameters:
checked (bool)
- open_aurora_plot()¶
- open_centerfinder_settings_window()¶
Opens the Center Finder Settings window.
- open_centerrefinement_settings_window()¶
Opens the Center Refinement Settings window.
- open_check_metadata_window()¶
Opens the metadata dialog showing acquisition details.
- open_export_window()¶
Open the Export window which lists available CrystFEL HKL files and converts them to SHELX HKLF4, and can also write RES/P4P from CrystFEL cell files.
- open_file(ini_file_path=None, preserve_frame=False)¶
- open_import_emd_window()¶
- open_import_h5_window()¶
- open_import_mrc_window()¶
- open_import_tiff_window()¶
- open_index_integrate_window()¶
- open_index_window()¶
- open_map()¶
- open_merge_window()¶
- open_peakfinder_settings_window()¶
- open_strip_files_window()¶
- open_unit_cell_hist_window(auto_refresh=False)¶
Open the unit cell histogram viewer for the current stream.
- Parameters:
auto_refresh (bool)
- open_workspace()¶
Load a saved workspace file (.cosedawsp) and populate the INI list.
- open_workspace_unit_cell_fit_window()¶
Open the workspace-wide unit-cell Gaussian fit tool.
- previous_frame()¶
- reload_current_file()¶
Reload the currently loaded INI/HDF5 while keeping the current frame.
- reload_file_preserve_frame()¶
Reload the current INI/HDF5 but keep the same frame index.
- remove_ini_files()¶
Remove selected INI files from the workspace list.
- report_issue()¶
- resizeEvent(event)¶
On window resize, immediately refresh the image to fit the new width and adjust the container height to maintain the original aspect ratio.
- save_workspace()¶
Save the current workspace INI paths to a .cosedawsp file.
- save_workspace_state()¶
Save workspace paths (or workspace file) to the config file.
- set_vdf_overlay(center, width, enabled=True)¶
Set the virtual dark-field overlay shown on the main diffraction preview.
- show_latest_indexed_frame()¶
Jump to the most recently indexed frame based on the current stream.
- show_next_indexed_frame()¶
Jump to the next indexed frame relative to the current chunk.
- show_pixel_index(event)¶
- show_previous_indexed_frame()¶
Jump to the previous indexed frame relative to the current chunk.
- start_coordinate_selection()¶
- stop_live_preview()¶
- update_frame_from_map_click(frame_index)¶
Slot to update the frame index when a point is clicked in the map.
- update_image()¶
- update_map_thumbnail()¶
Show a saved atlas (entry/atlas/<zdim>) as a thumbnail in the Map preview box.
Renders with the current colormap and fits it within the workflow column so it never widens that column. Keeps the Atlas group available when the file has enough data to open the atlas viewer, even before a saved atlas exists.
- update_workflow_buttons()¶
cosedaUI.map_window module¶
Interactive stage map viewer for navigating frames and intensities.
- class cosedaUI.map_window.MapWindow(*args, **kwargs)[source]¶
Bases:
QDialog- find_closest_available_frame(x_clicked, y_clicked)[source]¶
Return the nearest available frame index to the clicked stage coordinates.
- get_unique_alphatilts(hdf5_path)[source]¶
Sorted unique alpha tilts, rounded to 1 decimal, without the 999999 placeholder.
- on_backlash_offset_changed(value)[source]¶
Update the persistent left-streak backlash offset and refresh the map.
- on_crystallinity_checkbox_toggle()[source]¶
Enable/disable crystallinity thresholding and refresh the plot.
- on_crystallinity_threshold_changed(text)[source]¶
Parse user threshold and refresh plot when highlighting diffracting regions.
- point_clicked_signal¶
alias of
int
cosedaUI.merging_window module¶
UI for configuring and running CrystFEL Partialator merges from stream files.
cosedaUI.metadata_window module¶
Preflight/metadata dialog for viewing and editing acquisition details and masks.
- class cosedaUI.metadata_window.MetadataWindow(*args, **kwargs)[source]¶
Bases:
QDialogDialog to view/edit acquisition metadata and manage detector masks.
- apply_to_workspace()[source]¶
Copy current metadata (AcquisitionDetails) and mask (if present) to all INIs in the workspace. Requires confirmation that datasets were collected under the same conditions.
- confirm_metadata_edit()[source]¶
Warn before unlocking metadata fields that were populated automatically.
- is_metadata_complete()[source]¶
Returns True if all required metadata fields have values (non-empty).
- Return type:
bool
- load_and_print_acquisition_details()[source]¶
Populate widgets from the current INI and set read-only/editable states.
- on_generate_full_mask_clicked()[source]¶
Generate a full-valid mask and save it to the HDF5, then show the remove button.
- on_pixelmask_btn_clicked()[source]¶
Load a mask image, generate mask data, and store it into the current HDF5.
- on_remove_mask_clicked()[source]¶
Remove the mask dataset from the current HDF5 and update button visibility.
- open_pixel_calc_dialog()[source]¶
Open the PixelCalcDialog and link its result back to the pixels_per_meter field.
- save_acceleration_voltage(value)[source]¶
Convert back to volts and write acceleration_voltage to INI.
- Parameters:
value (str)
- save_camera_length_correction(value)[source]¶
Write the updated camera_length_correction value back to the INI file.
- Parameters:
value (str)
cosedaUI.peakfinder_window module¶
UI for configuring peakfinder settings and launching batch peakfinding runs.
- class cosedaUI.peakfinder_window.FocusableLineEdit(*args, **kwargs)[source]¶
Bases:
QLineEditQLineEdit subclass that emits signals on focus in/out.
- Parameters:
args (Any)
kwargs (Any)
- Return type:
Any
- class cosedaUI.peakfinder_window.PeakFinderSettingsWindow(*args, **kwargs)[source]¶
Bases:
QDialogSettings dialog for configuring peakfinder_8 / peakfinder9 and running them.
- check_and_enable_findpeaks_button()[source]¶
Enable Find Peaks buttons only when all required keys exist in the INI.
- file_progress_updated¶
alias of
str
- peakfinding_error¶
alias of
str
- progress_updated¶
alias of
int
- run_findpeaks(input_paths, algo)[source]¶
Execute peak finding with the chosen algorithm in a background thread.
- settings_applied¶
alias of
dict
cosedaUI.refinecenters_window module¶
UI for configuring and running center refinement for beamstop/direct methods.
- class cosedaUI.refinecenters_window.CenterRefinementSettingsWindow(*args, **kwargs)[source]¶
Bases:
QDialogSettings dialog to launch center refinement across selected INIs.
- add_plot_to_viewer(iter_num, plot_type, file_path)[source]¶
Adds a plot to the QTreeWidget under the appropriate iteration and plot type.
- get_parameter_from_config(config, section, parameter, default_value, is_optional=False)[source]¶
Retrieve parameter from config. If optional and not present, return default. Otherwise, return integer or float value or default.
- on_find_refinement_all()[source]¶
Initiates center refinement on all INI files in the directory using the selected method.
- on_find_refinement_current()[source]¶
Initiates center refinement on the current INI file using the selected method.
- on_plot_display_label_clicked()[source]¶
Displays the current plot image in a larger dialog when the label is clicked.
- class cosedaUI.refinecenters_window.ClickableLabel(*args, **kwargs)[source]¶
Bases:
QLabelLabel that emits a clicked signal when the user releases the left mouse button.
- Parameters:
args (Any)
kwargs (Any)
- Return type:
Any
- class cosedaUI.refinecenters_window.PreviewWindow(*args, **kwargs)[source]¶
Bases:
QDialogNon-modal preview window for inspecting refinecenters outputs and runs.
- class cosedaUI.refinecenters_window.TrimmingDoubleSpinBox(*args, **kwargs)[source]¶
Bases:
QDoubleSpinBox- Parameters:
args (Any)
kwargs (Any)
- Return type:
Any
- class cosedaUI.refinecenters_window.Worker(*args, **kwargs)[source]¶
Bases:
QObjectThreaded worker that runs center refinement and reports success/errors.
- cancelled¶
alias of
str
- error¶
alias of
str
- finished¶
alias of
str
cosedaUI.strip_file_window module¶
UI for stripping empty/low-peak frames from HDF5 datasets.
cosedaUI.unitcell_window module¶
Dialog for plotting unit cell histograms from CrystFEL stream files.
- class cosedaUI.unitcell_window.UnitCellHistogramWindow(*args, **kwargs)[source]¶
Bases:
QDialogPlot unit cell parameter histograms for the current CrystFEL stream.
- Parameters:
stream_path (Optional[str])
- set_stream_path(path, auto_plot=False)[source]¶
Update the linked stream path (called when selection changes externally).
- Parameters:
path (str | None)
auto_plot (bool)
cosedaUI.update module¶
In-app update checks via Homebrew.
- cosedaUI.update.check_for_updates(_checked=False, formula=None, parent=None, silent=False, notify_only_on_update=False)[source]¶
Refresh Homebrew metadata, then check if the COSEDA formula is outdated. Prompts the user with the result and suggests upgrading via Homebrew.
- Parameters:
_checked (bool)
formula (str | None)
silent (bool)
notify_only_on_update (bool)
- Return type:
None
cosedaUI.windowsettings module¶
Utilities for UI settings: version, changelog, and OS-specific style hints.
- cosedaUI.windowsettings.get_version_from_log(versionlog)[source]¶
Return the most recent version entry from the version log; fallback to ‘Unknown’ on error.
- cosedaUI.windowsettings.load_changelog(versionlog='CHANGELOG')[source]¶
Return changelog text safely.
- Lookup order:
packaged resource: cosedaUI/resources/CHANGELOG (wheel/Homebrew safe)
local resources dir next to the module (editable installs)
3) project root one level above the package (dev tree) If none found, return an empty string.
cosedaUI.workflow_wizzard module¶
Workflow guards to decide which steps are available based on HDF5 contents.
- cosedaUI.workflow_wizzard.check_findcenters_allowed(h5file_path)[source]¶
Find centers only allowed if there are peaks.
- cosedaUI.workflow_wizzard.check_index_integrate_allowed(h5file_path)[source]¶
Index & Integrate requires a mask dataset.
- cosedaUI.workflow_wizzard.check_peakfinding_allowed(h5file_path)[source]¶
Peakfinding is allowed only when a mask dataset exists.
- cosedaUI.workflow_wizzard.check_refinecenters_allowed(h5file_path)[source]¶
Refine centers only allowed if detector shift present.
- cosedaUI.workflow_wizzard.has_detector_shift(h5file_path)[source]¶
Return True if the HDF5 file has detector shift/center datasets.
cosedaUI.workspace_functions module¶
Helpers for saving, loading, and manipulating workspace INI lists and view state.
- cosedaUI.workspace_functions.add_generated_ini_paths(self, paths, show_warnings=True)[source]¶
Add importer-generated INI files to the workspace.
Returns a dict with added/skipped/invalid path lists so import dialogs can report concise status without duplicating workspace mutation logic.
- cosedaUI.workspace_functions.add_ini_files(self)[source]¶
Open a dialog to add INI files to the workspace list.
- cosedaUI.workspace_functions.add_ini_paths(self, paths)[source]¶
Add provided INI file paths to the workspace list (no file dialog).
- cosedaUI.workspace_functions.load_last_directory(self)[source]¶
Restore last directory and last workspace (file or INI list) from config.
- cosedaUI.workspace_functions.load_last_workspace_state(self)[source]¶
Restore workspace state from configuration (named file or INI list).
- cosedaUI.workspace_functions.new_workspace(self)[source]¶
Clear the current workspace list and reset state.
- cosedaUI.workspace_functions.open_workspace(self)[source]¶
Load a saved workspace file (.cosedawsp) and populate the INI list.
- cosedaUI.workspace_functions.remove_ini_files(self)[source]¶
Remove selected INI files from the workspace list.
cosedaUI.workspace_unitcell_fit_window module¶
Workspace-wide unit-cell histogram and Gaussian fit dialog.
- class cosedaUI.workspace_unitcell_fit_window.WorkspaceUnitCellFitWindow(*args, **kwargs)[source]¶
Bases:
QDialogAggregate unit-cell values from all workspace files and fit selected peaks.
- Parameters:
workspace_ini_paths (Optional[list[str]])
workspace_path (Optional[str])