TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/Rubick65/dcemapper/llms.txt
Use this file to discover all available pages before exploring further.
MainWindow class in src.ui.interface.PyQT_interface is the top-level PyQt6 application window for DCEMapper. It wires together the NIfTI canvas, the slice selector panel, the intensity graph, the toolbar, and all keyboard shortcuts into a single resizable three-panel layout. Understanding its public API lets you launch the application programmatically, pre-load data, and drive the preprocessing and processing pipelines without touching the GUI manually.
MainWindow(nifty_path=None)
Constructs and initialises the main application window.
Optional path to a NIfTI file. When provided,
set_nifti is called immediately during __init__ so the file is displayed as soon as window.show() is called. When omitted, the window starts empty and the user loads data through the File menu.MainWindow must always be instantiated inside a live QApplication context. Creating a MainWindow before calling QApplication(sys.argv) will raise a RuntimeError from Qt.Key public methods
set_nifti(nifty_path)
Loads a NIfTI file and rebuilds the entire three-panel UI. Resets the canvas, the intensity graph, and all ROI state before constructing fresh left, centre, and right containers. Called internally by set_various_files() when the user opens a file through the menu, and by set_proc_files() when switching to a processed view.
preprocessing(selected_preprocess_options)
Runs the selected preprocessing pipeline in sequence: optional denoising followed by optional Gibbs removal. Output is written to the subject’s derivatives folder. On success, calls set_new_data to reload the UI with the preprocessed file.
A two-element tuple
(denoise_filter_name, gibbs_option):denoise_filter_name(stror falsy) — filter string passed todenoise_init_one_file. Set toNoneor""to skip denoising.gibbs_option(boolor truthy) — when truthy, Gibbs ringing removal is applied after denoising.
processing(selected_process_option)
Runs the selected quantitative processing pipeline and updates the canvas with the primary output file. Currently supports semi-quantitative mapping (dispatched when the option string starts with "s" or "S").
Processing pipeline name. The function matches on the first character (case-insensitive). Supported values:
| String | Pipeline |
|---|---|
"Semi-quantitative" | Calls semi_quantitative; produces RCE, RCE-max, and TTP maps. |
"jet" and the viewer toolbar is activated to allow switching between RCE, RCE-max, and TTP views.
set_new_data(data)
Reloads the canvas, slice selector, and toolbar state with a new NIfTI file path without rebuilding the entire layout. Use this to switch between related files (e.g. after applying a preprocessing step) while keeping the current ROI state intact.
Path to the new NIfTI file to display.
toggle_movie_mode()
Starts or stops the QTimer-driven cine playback mode. When the timer is active, the canvas advances one time frame every movie_speed milliseconds. When it reaches the last frame, the timer stops and the slider resets to frame 0.
The frame interval is controlled by window.movie_speed (in milliseconds, default 30 ms ≈ 33 fps). The FPS slider in the left panel updates movie_speed in real time via 1000 / fps.
reset_layout()
Restores the three-panel splitter to its default proportions and resets the vertical split between the intensity graph and the click record. Useful after the user has dragged panels to unusual sizes.
Default proportions (relative to window.total_w / window.total_h):
| Panel | Width share |
|---|---|
| Left — slice selector | 20 % |
| Centre — main canvas | 40 % |
| Right — graph + record | 40 % |
Keyboard shortcuts summary
The shortcuts below are registered byinit_shortcuts() every time a file is opened. They map directly to the public methods listed above.
| Key | Action |
|---|---|
Space | toggle_movie_mode() |
R | reset_layout() |
↑ / ↓ | Advance / rewind one time frame |
← / → | Navigate slice history (back / forward) |
Ctrl+Z | Undo last ROI on current slice (restar_mask) |
Ctrl+R | Activate rectangle ROI selector |
Ctrl+E | Activate ellipse ROI selector |
Ctrl+P | Activate polygon ROI selector |
Tab | Confirm and apply current ROI selection |
Esc | Cancel current ROI selection |
H | Reset zoom / pan (home view) |
Z | Toggle zoom mode |
M | Toggle pan mode |
F | Toggle fullscreen |