Skip to content

feat: VHS annotation tool#564

Open
laura-borghesi-lum00n wants to merge 7 commits intomasterfrom
feat-vhs-tool
Open

feat: VHS annotation tool#564
laura-borghesi-lum00n wants to merge 7 commits intomasterfrom
feat-vhs-tool

Conversation

@laura-borghesi-lum00n
Copy link
Copy Markdown
Contributor

No description provided.

@laura-borghesi-lum00n laura-borghesi-lum00n self-assigned this Mar 13, 2026
@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

Questa pull request introduce una significativa funzionalità per l'analisi delle immagini mediche, aggiungendo uno strumento di annotazione per il calcolo del Vertebral Heart Score (VHS). Questo strumento facilita la valutazione cardiaca fornendo un processo guidato e automatizzato per misurare punti anatomici chiave e calcolare un punteggio standardizzato, migliorando l'efficienza e la precisione diagnostica.

Highlights

  • Nuovo Strumento di Annotazione VHS: È stato introdotto un nuovo strumento di annotazione per il calcolo del Vertebral Heart Score (VHS), che guida l'utente attraverso un processo di misurazione in più fasi.
  • Misurazione Multi-Fase: Lo strumento implementa una macchina a stati per definire sequenzialmente i punti di misurazione vertebrale, dell'asse lungo e dell'asse corto, garantendo un flusso di lavoro guidato.
  • Calcolo Automatico del VHS: Il tool calcola automaticamente il Vertebral Heart Score basandosi sulle misurazioni effettuate, fornendo un risultato finale visualizzato sull'immagine.
  • Visualizzazione delle Proiezioni: Sono state aggiunte funzionalità per visualizzare le proiezioni degli assi lungo e corto sulla linea vertebrale, con indicatori visivi per chiarezza.
  • Integrazione del Tool: Il nuovo VHSAnnotationTool è stato integrato nel set di strumenti predefiniti dell'applicazione, rendendolo disponibile per l'uso.
Changelog
  • imaging/tools/custom/VHSAnnotationTool.ts
    • Aggiunta la classe VHSAnnotationTool, che estende BaseAnnotationTool.
    • Implementata una macchina a stati (MeasurementState) per guidare l'utente attraverso il processo di misurazione VHS in più fasi.
    • Definito createNewMeasurement per inizializzare i punti di controllo (handles) e le statistiche memorizzate nella cache per il calcolo del VHS.
    • Inclusi mouseMoveCallback, mouseDragCallback, mouseUpCallback e preMouseDownCallback per gestire l'interazione dell'utente durante la misurazione.
    • Sviluppato renderToolData per disegnare la linea di riferimento vertebrale, l'asse lungo, l'asse corto e le relative caselle di testo sulla tela.
    • Aggiunti i metodi drawProjectionVisualization e drawTick per la rappresentazione visiva delle proiezioni.
    • Implementato updateCachedStats per calcolare la lunghezza vertebrale, le lunghezze degli assi lungo/corto, le proiezioni e il VHS finale.
    • Forniti pointNearTool, isPointNearHandle, isPointNearLine e distanceToLineSegment per il rilevamento dell'interazione con i punti di controllo e le linee.
    • Incluso getHandleNearImagePoint per identificare i punti di controllo attivi.
  • imaging/tools/default.ts
    • Importato VHSAnnotationTool.
    • Aggiunto VHSAnnotation alla configurazione DEFAULT_TOOLS.
    • Registrato VHSAnnotationTool nell'oggetto dvTools.
  • imaging/tools/types.ts
    • Espansa l'interfaccia Handles per includere le proprietà vertebralStart, vertebralEnd, longAxisStart, longAxisEnd, shortAxisStart e shortAxisEnd.
Activity
  • Nessuna attività umana registrata su questa pull request finora.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a new VHSAnnotationTool for vertebral heart score measurements. The implementation is well-structured, using a state machine to guide the user through the multi-step measurement process. The changes also include registering the new tool and updating type definitions.

While the tool is a great addition, I've identified several areas for improvement. There is a critical bug related to a potential division-by-zero error in the statistics calculation that should be addressed. Additionally, I've noted opportunities to enhance performance by throttling image updates, improve maintainability by refactoring duplicated code, and increase type safety by replacing any types with specific interfaces. The use of hardcoded strings for user instructions should also be revisited for better internationalization and user experience.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 13, 2026

🔍 Cypress Test Results

Status: ✅ All tests passed
Pass Rate: 100.00%
Total Tests: 32
Passed: 32
Failed: 0
Pending/Skipped: 0
Duration: 154.32s

📊 Test Suite Details

Suite Status Pass % Total Passed Failed Pending
Root > Testing the base.html functionalities 100.00% 13 13 0 0
Root > Larvitar DICOM Viewer 100.00% 1 1 0 0
Root > Larvitar - Default Tools Example 100.00% 3 3 0 0
Root > Larvitar DSA Rendering 100.00% 2 2 0 0
Root > Larvitar ECG Rendering 100.00% 6 6 0 0
Root > Larvitar Multiframe Rendering 100.00% 4 4 0 0
Root > Larvitar DICOM PDF Rendering 100.00% 1 1 0 0
Root > Testing the 4d.html functionalities 100.00% 2 2 0 0

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 13, 2026

🧪 Type Coverage

93.43%

(20770 / 22230)

███████████████████░ 93.43%
Target: 90%

Top hotspots (untyped occurrences)

File Uncovered
imaging/imageRendering.ts 240
imaging/imageUtils.ts 142
imaging/parsers/nrrd.js 138
imaging/imageTools.ts 112
imaging/imageParsing.ts 100

@laura-borghesi-lum00n laura-borghesi-lum00n marked this pull request as ready for review March 17, 2026 15:27
@daron1337
Copy link
Copy Markdown
Member

Check auto-review

@laura-borghesi-lum00n laura-borghesi-lum00n marked this pull request as draft April 2, 2026 07:56
@laura-borghesi-lum00n laura-borghesi-lum00n marked this pull request as ready for review April 2, 2026 08:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants