Skip to content

Commit f4c5ca5

Browse files
authored
Merge pull request #110 from Brain-Modulation-Lab/feat/improving-readthedocs
Feat/improving readthedocs
2 parents 070f8ae + e27f2e3 commit f4c5ca5

20 files changed

Lines changed: 179 additions & 139 deletions

CHANGELOG.md

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1717
width so dialogs are not upscaled on wide screens.
1818
- ``COPYRIGHT_HOLDERS`` and ``APP_LICENSE_NAME`` in ``config.py`` (shared with
1919
documentation).
20+
- ``APP_MAINTAINER`` in ``config.py``; **Help** dialog lists **Maintainer: Richard
21+
Köhler** under lead developer.
2022

2123
### Changed
2224

@@ -26,20 +28,39 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2628
- Annotations-only file step header title: **Clinical Annotations Setup** (was
2729
"Output File").
2830
- Home screen buttons: **Complete Workflow** and **Annotations-only Workflow**.
29-
- Read the Docs: installation aligned with README; workflow pages renamed
30-
(**Complete Workflow**, **Annotation-only Workflow**); ``workflow_session.rst``
31-
documents per-session scales (**** / **+**, settings dialogs);
32-
``longitudinal_report.rst`` and ``quickstart.rst`` specify ``task-programming``
33-
BIDS files for longitudinal reports.
31+
- Annotations-only TSV column ``annotation`` renamed to ``notes`` (aligned with
32+
the Complete Workflow); legacy files with an ``annotation`` header remain
33+
readable and appendable.
34+
- Read the Docs: ``workflow_session.rst`` renamed to ``workflow_complete.rst``;
35+
``quickstart.rst`` documents launching the installed app (Start Menu / MSI /
36+
install script), all three workflows in home-screen order, and links to the
37+
full guides; ``index.rst`` Quick Overview matches the same order.
38+
- ``workflow_complete.rst``: Step 0 file setup (**Open** / **New**, Session ID /
39+
Run ID); UI actions documented as **Insert** and **Close session**; only one
40+
overview video at the top of the page.
41+
- ``workflow_annotations.rst``: dedicated ``task-notes`` schema (``date``, ``time``,
42+
``timezone``, ``notes``); no merge of multiple TSV files; **Insert** /
43+
**Close Session**; overview video removed.
44+
- ``longitudinal_report.rst``: single overview video at the top; **Create
45+
Longitudinal Report** button naming.
46+
- ``output_format.rst``: ``task-programming`` vs ``task-notes`` / annotations
47+
workflow called out in filename convention; generated schema uses ``notes`` for
48+
annotations-only files.
49+
- ``faq.rst``: TSV save path references Step 0 file setup.
50+
- README **What It Does** aligned with RTD (four Complete Workflow steps, three
51+
workflows, link to ``workflow_complete.rst``); installation and Contributing
52+
sections unchanged.
3453
- Documentation copyright: Massachusetts General Hospital, Wyss Center for Bio
3554
and Neuroengineering, and Charité Universitätsmedizin Berlin.
3655
- Screenshot capture uses the app's responsive window geometry (step 0 compact,
3756
steps 1+ full workflow) instead of a fixed 1600×1000 frame.
38-
- ``workflow_session.rst``: drop standalone ``electrode_diagram.png`` (electrode
57+
- ``workflow_complete.rst``: drop standalone ``electrode_diagram.png`` (electrode
3958
UI is already visible in the Step 1 screenshot).
4059

4160
### Fixed
4261

62+
- Dependency audit: pin ``idna>=3.15`` (GHSA-65pc-fj4g-8rjx); allow ``idna`` in
63+
``exclude-newer-package`` so the fix is not blocked by the one-week cooldown.
4364
- Update checker: HTTPS uses the ``certifi`` CA bundle (fixes failed or empty
4465
GitHub API responses in Briefcase MSI/ZIP on Windows); compares against
4566
``APP_VERSION``; empty or invalid release data surfaces as errors instead of

README.md

Lines changed: 39 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ powershell -ExecutionPolicy Bypass -NoProfile -Command "irm https://raw.githubus
3030

3131
### macOS / Linux — shell install (curl / wget)
3232

33-
3433
```sh
3534
curl -LsSf https://raw.githubusercontent.com/Brain-Modulation-Lab/DBSAnnotator/main/scripts/install.sh | sh
3635
```
@@ -41,28 +40,52 @@ wget -qO- https://raw.githubusercontent.com/Brain-Modulation-Lab/DBSAnnotator/ma
4140

4241
## What It Does
4342

44-
The application guides you through a DBS programming session in three steps:
43+
From the home screen you can start three workflows (full guide:
44+
[Read the Docs](https://brain-modulation-lab.github.io/DBSAnnotator/)):
45+
46+
### Complete Workflow
47+
48+
Four steps — stimulation parameters, clinical scales, session scales, and notes;
49+
data saved automatically after each entry:
50+
51+
1. **Step 0 — File setup** — Open or create a programming-session TSV
52+
(`sub-XX_ses-YYYYMMDD_task-programming_run-XX_events.tsv`); **New** asks for
53+
Patient ID and Run ID (Session ID is today's date).
54+
2. **Step 1 — Initial Configuration** — Electrode model, baseline stimulation
55+
parameters, and clinical scales.
56+
3. **Step 2 — Session Scale Selection** — Scales rated at each configuration
57+
during programming (e.g. Tremor, Mood).
58+
4. **Step 3 — Active Recording** — Adjust parameters, rate scales, add notes;
59+
click **Insert** to record an entry; export a Word/PDF report when finished.
60+
61+
See `[docs/workflow_complete.rst](docs/workflow_complete.rst)` for the full
62+
step-by-step guide (screenshots, scale presets, and report sections).
63+
64+
### Annotations-only Workflow
65+
66+
Timestamped text notes only — no stimulation parameters or scale values. Uses a
67+
dedicated TSV (`task-notes`) with columns `date`, `time`, `timezone`, and
68+
`notes`. See `[docs/workflow_annotations.rst](docs/workflow_annotations.rst)`.
4569

46-
1. **Initial Setup** — Select output file, electrode model, initial stimulation parameters, and baseline clinical scales
47-
2. **Session Scales** — Choose which scales to track during the session (Mood, Anxiety, Energy, etc.)
48-
3. **Active Recording** — Adjust stimulation parameters in real-time, record scale values at each timepoint, add notes, and export a clinical report
70+
### Create Longitudinal Report
4971

50-
There is also a **Free Annotations** mode for quick timestamped text annotations without the full stimulation workflow.
72+
Combine multiple programming-session TSV files from the same subject into one
73+
comparative Word/PDF report. See `[docs/longitudinal_report.rst](docs/longitudinal_report.rst)`.
5174

5275
### Key Features
5376

77+
- **Clinical and session scale presets** for OCD, MDD, PD, ET, Dystonia, TS
78+
- **Timestamps aligned** notes, configuration parameters and scale scores
79+
- **Export to Word / PDF** with electrode diagrams, tables, and timeline charts
80+
- **BIDS-compliant file naming** for programming and annotations TSV files
5481
- **Electrode visualization** with interactive contact selection (supports directional leads)
55-
- **Clinical scale presets** for OCD, MDD, PD, ET
56-
- **BIDS-compliant file naming** (sub-XX_ses-YYYYMMDD_task-programming_run-XX_events.tsv)
57-
- **Export to Word** with electrode configuration images, clinical notes, and session data tables
5882
- **Dark/Light theme** toggle
59-
- **Timestamps aligned** with Medtronic Percept data (Eastern Time)
6083

6184
### Output Format
6285

63-
Data is saved as TSV. The canonical schema is documented in
64-
`[docs/output_format.rst](docs/output_format.rst)` and auto-generated from the
65-
code-level constants in `dbs_annotator.config` to prevent drift.
86+
Programming and annotations data are saved as TSV. The canonical schema is
87+
documented in `[docs/output_format.rst](docs/output_format.rst)` and
88+
auto-generated from `dbs_annotator.config` to prevent drift.
6689

6790
## Contributing
6891

@@ -160,9 +183,9 @@ uv run briefcase package windows -p zip # avoids WiX; omit -p (MSI) when WiX
160183

161184
**Windows Briefcase quirks:** keep `[tool.briefcase].version` in sync with `dbs_annotator.__version__` (Briefcase does not use Hatch’s dynamic `[project]` version). Bump both in one step with `uv run python scripts/release_prepare.py <version>` (or `--bump …`). If `briefcase build` fails at **“Setting stub app details”** / RCEdit with **“Unable to commit changes”**, exclude the repo or `build\` from real-time antivirus scanning and retry (see [Briefcase issue #1530](https://github.com/beeware/briefcase/issues/1530)).
162185

163-
The Windows stub binary is named `**DBSAnnotator.exe`** (from `[tool.briefcase.app.dbs_annotator].formal_name`). After changing that field, run `**briefcase create windows app**` again (or delete `build\dbs_annotator\windows`) before `**briefcase build**`.
186+
The Windows stub binary is named `**DBSAnnotator.exe`** (from `[tool.briefcase.app.dbs_annotator].formal_name`). After changing that field, run `**briefcase create windows app`** again (or delete `build\dbs_annotator\windows`) before `**briefcase build**`.
164187

165-
Icons for the **stub**, **MSI/ZIP**, and **Qt** (`QApplication` / window chrome) live under `**icons/logosimple/`**: `**logosimple.ico**`, `**logosimple.png**`, plus `**logosimple-{16,32,64,128,256,512}.png**` for **Linux system** (BeeWare copies them into the Freedesktop hicolor tree; all six are listed in the upstream `briefcase-linux-system-template`). `**logosimple.icns`** is for macOS (build with `iconutil` on a Mac; see `scripts/build_app_icons.py`). Configure with `icon = "icons/logosimple/logosimple"` in `pyproject.toml`. The repo-root `**icons/**` tree is a Briefcase `**sources**` entry and is shipped next to the app package; runtime lookup uses `resource_path()` (package dir, then `src/icons`, then repo-root `icons/`).
188+
Icons for the **stub**, **MSI/ZIP**, and **Qt** (`QApplication` / window chrome) live under `**icons/logosimple/`**: `**logosimple.ico`**, `**logosimple.png**`, plus `**logosimple-{16,32,64,128,256,512}.png**` for Linux system (BeeWare copies them into the Freedesktop hicolor tree; all six are listed in the upstream `briefcase-linux-system-template`). `**logosimple.icns**` is for macOS (build with `iconutil` on a Mac; see `scripts/build_app_icons.py`). Configure with `icon = "icons/logosimple/logosimple"` in `pyproject.toml`. The repo-root `**icons/**` tree is a Briefcase `**sources**` entry and is shipped next to the app package; runtime lookup uses `resource_path()` (package dir, then `src/icons`, then repo-root `icons/`).
166189

167190
**Inventory (for packaging):**
168191

@@ -171,7 +194,7 @@ Icons for the **stub**, **MSI/ZIP**, and **Qt** (`QApplication` / window chrome)
171194
| ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
172195
| App type | Qt **GUI** (`console_app` is false by default). |
173196
| Heavy deps | `PySide6`, `matplotlib`, `pandas`, `python-docx`, `docx2pdf` (Windows: `pywin32`; macOS: `appscript` via `docx2pdf`). |
174-
| Data files | JSON presets under `src/dbs_annotator/config/`; QSS and SVG under repo-root `**styles/`** (also a Briefcase `**sources**` entry); app icons under `**icons/logosimple/**` (Briefcase + Qt). |
197+
| Data files | JSON presets under `src/dbs_annotator/config/`; QSS and SVG under repo-root `**styles/`** (also a Briefcase `**sources`** entry); app icons under `**icons/logosimple/**` (Briefcase + Qt). |
175198
| macOS entitlements | Add an entitlements plist only if you enable the Hardened Runtime and need extra capabilities (network is usually fine without custom entitlements). |
176199

177200

docs/_generated/tsv_schema.inc.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,6 @@ Annotations-only TSV columns
9595
* - ``timezone``
9696
- string
9797
- Timezone abbreviation/offset at capture time.
98-
* - ``annotation``
98+
* - ``notes``
9999
- string
100-
- Free-text annotation.
100+
- Free-text note for this entry.

docs/api.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ API Reference
44
This page is generated automatically from the docstrings of the
55
``dbs_annotator`` package. It is aimed at developers extending or embedding
66
the application; clinicians and researchers should prefer the
7-
:doc:`quickstart` and :doc:`workflow_session` guides.
7+
:doc:`quickstart` and :doc:`workflow_complete` guides.
88

99
The reference deliberately covers the **data, configuration, and control
1010
layers** of the application. The Qt UI layers (``dbs_annotator.ui`` and

docs/faq.rst

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,9 @@ Files & Data
5050

5151
**Where are TSV files saved?**
5252

53-
In the folder you selected in Step 0 of the Complete Workflow. The application
54-
never writes files outside that folder.
53+
In the folder of the ``.tsv`` file you chose in **Step 0 — File setup** of the
54+
Complete Workflow (or in the Annotations-only Workflow). The application never
55+
writes files outside that path.
5556

5657
**Can I open the TSV files in Excel?**
5758

@@ -127,11 +128,6 @@ you selected an electrode model in Step 1 before recording entries.
127128
Troubleshooting
128129
---------------
129130

130-
**The application does not start / shows a black window.**
131-
132-
Try running it as administrator (right-click → *Run as administrator*). This is
133-
sometimes needed on machines with strict execution policies.
134-
135131
**The application is very slow on first launch.**
136132

137133
Windows Defender or other antivirus software may be scanning the executable.

docs/index.rst

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ the **Wyss Center for Bio and Neuroengineering** (Geneva, Switzerland), and
3838
:maxdepth: 2
3939
:caption: User Guide
4040

41-
workflow_session
41+
workflow_complete
4242
workflow_annotations
4343
longitudinal_report
4444
output_format
@@ -71,13 +71,14 @@ Quick Overview
7171
- Record stimulation parameters, clinical scales, and notes step-by-step.
7272
Export a structured report (Word / PDF) with tables, electrode diagrams,
7373
and session-scale timeline charts.
74+
* - **Annotations-only Workflow**
75+
- Quick timestamped text notes without the full stimulation workflow.
7476
* - **Longitudinal report**
7577
- Combine multiple session files into a single comparative document with
7678
overview tables, clinical and session-scale charts, electrode diagrams,
7779
and programming summaries.
78-
* - **Annotation-only Workflow**
79-
- Quick timestamped text notes without the full stimulation workflow.
8080
* - **BIDS-compliant output**
8181
- Data saved as ``sub-XX_ses-YYYYMMDD_task-programming_run-XX_events.tsv``.
82-
* - **No installation required**
83-
- The application ships as a single self-contained ``.exe`` (Windows).
82+
* - **Self-contained desktop app**
83+
- Packaged installers (``.msi``, ``.dmg``, ``.deb``); no separate Python
84+
runtime required.

docs/longitudinal_report.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,6 @@ A table with one row per session showing:
224224
Tips
225225
----
226226

227-
* Load files in **chronological order** for the most readable report.
228227
* The report can be re-generated at any time — the source TSV files are never
229228
modified.
230229
* For very long longitudinal histories (> 10 sessions) consider splitting the

docs/output_format.rst

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,16 @@ are recorded.
1616
Filename Convention
1717
^^^^^^^^^^^^^^^^^^^
1818

19-
The filename follows the `BIDS <https://bids.neuroimaging.io/>`_ specification::
19+
Filenames follow the `BIDS <https://bids.neuroimaging.io/>`_ pattern::
2020

21-
sub-<PatientID>_ses-<YYYYMMDD>_task-programming_run-<NN>_events.tsv
21+
sub-<PatientID>_ses-<YYYYMMDD>_task-<TASK>_run-<NN>_events.tsv
22+
23+
The ``task`` segment depends on which workflow created the file:
24+
25+
* **Complete Workflow** — ``task-programming`` (stimulation parameters, clinical
26+
and session scales, notes).
27+
* **Annotations-only Workflow** — ``task-annotations`` (timestamped text annotations
28+
only; dedicated column schema — see *Annotations-only TSV columns* below).
2229

2330
Examples::
2431

@@ -43,7 +50,7 @@ Row layout and ``block_ID``
4350
^^^^^^^^^^^^^^^^^^^^^^^^^^^
4451

4552
Each **scale** is stored on its own row. Rows that belong to the same
46-
recording event (one Step 1 baseline or one Step 3 **Record entry**) share the
53+
recording event (one Step 1 baseline or one Step 3 **Insert**) share the
4754
same ``block_ID``; stimulation parameters, ``date``, ``time``, ``timezone``,
4855
``program_ID``, ``electrode_model``, and ``notes`` are repeated on every row of
4956
that block. After each write, ``block_ID`` increments by one.
@@ -117,10 +124,6 @@ Example export
117124
:alt: Example single-session Word report (graph, table, electrode diagrams)
118125
:class: screenshot-native
119126

120-
.. tip::
121-
Add a representative screenshot as ``docs/_static/session_report_example.png``
122-
(e.g. session data graph + table + electrode configuration section).
123-
124127
Longitudinal Report
125128
^^^^^^^^^^^^^^^^^^^^
126129

@@ -145,11 +148,6 @@ Example export
145148
:alt: Example longitudinal Word report (overview chart and session data)
146149
:class: screenshot-native
147150

148-
.. tip::
149-
Add a representative screenshot as
150-
``docs/_static/longitudinal_report_example.png`` (e.g. sessions overview with
151-
clinical-scales chart and combined session data).
152-
153151
----
154152

155153
Timestamps and timezone

docs/quickstart.rst

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,18 @@ choosing the right workflow for your needs.
99
Launching the Application
1010
--------------------------
1111

12-
Double-click **DBSAnnotator.exe** (or the Desktop shortcut). The main
13-
window opens, showing the **Home screen**.
12+
After :doc:`installation`, open **DBS Annotator** from your system's
13+
application launcher (the installed app, not a loose ``.exe`` in a download
14+
folder):
15+
16+
* **Windows** — **Start** menu entry **DBS Annotator** (from the ``.msi``
17+
installer or the PowerShell install script shortcut).
18+
* **macOS** — *Applications* after installing from the ``.dmg`` or install
19+
script.
20+
* **Linux** — application menu after installing the ``.deb`` or install
21+
script.
22+
23+
The main window opens on the **Home screen**.
1424

1525
.. image:: _static/home_screen.png
1626
:alt: Application home screen
@@ -32,6 +42,9 @@ From the home screen you can start one of three workflows:
3242
* - **Complete Workflow**
3343
- You are about to perform a DBS programming session and want to record
3444
stimulation parameters, clinical scales, and notes in real-time.
45+
* - **Annotations-only Workflow**
46+
- You only need timestamped text notes — no stimulation parameters or
47+
clinical scale values.
3548
* - **Create Longitudinal Report**
3649
- You already have multiple programming-session TSV files from the same
3750
subject (BIDS example:
@@ -66,6 +79,6 @@ immediately and maintained between pages.
6679
Next Steps
6780
----------
6881

69-
* :doc:`workflow_session` — **Complete Workflow**
82+
* :doc:`workflow_complete` — **Complete Workflow**
83+
* :doc:`workflow_annotations` — **Annotations-only Workflow**
7084
* :doc:`longitudinal_report` — **Create Longitudinal Report**
71-
* :doc:`workflow_annotations` — **Annotation-only Workflow**

0 commit comments

Comments
 (0)