๐ก Immersive medical training platform with realistic surgical simulations and advanced physics
Comprehensive VR training for medical students and surgical trainees. Interactive simulations powered by real-time physics engines.
- โจ Features
- ๐๏ธ System Architecture
- ๐ Installation
- ๐ฏ Module Overview
- ๐ Usage Guide
- ๐ฅ Demo Videos
- ๐ป Technical Documentation
- ๐ฅ Development Team
- ๐ License
- ๐ฑ๏ธ Dual Interaction Systems: Mouse-based precision controls and VR hand emulation (WASD+QE movement)
- โก Real-Time Physics Engine: Advanced soft-body deformation using spring-mass dynamics
- ๐จ High-Fidelity Rendering: PBR materials with dynamic lighting and shadow mapping
- ๐ Medical Documentation: Integrated note-taking system with persistent storage for clinical observations
- ๐ Immersive Audio: Realistic surgical soundscapes and haptic feedback simulation
- ๐พ Data Persistence: Patient record management with export capabilities
Each module targets specific surgical skills and anatomical understanding:
- โค๏ธ Cardiac Surgery (Heart) - Rhythmic deformation animation simulating cardiac cycles
- ๐ค Hepatic Procedures (Liver) - Interactive soft-tissue manipulation with force feedback
- ๐ ENT Surgery (Nose) - Internal cavity exploration with zoom navigation
- ๐ง Vascular Flow - Dynamic blood flow visualization with clotting mechanics
- ๐ช Orthopedic Trauma (Abdomen) - Multi-layer tissue cutting with depth visualization
- ๐ฆท Dental Training (Teeth) - Tooth extraction and replacement procedures
Medical-VR-Suite/
โโโ ๐ main.py # Application launcher and menu interface
โโโ liver.py # Hepatic simulation module (Panda3D)
โโโ โ๏ธ cutting.py # Surgical cutting mechanics (NumPy)
โโโ ๐ note.py # Medical notes documentation system
โโโ Patient_Records/ # Clinical data storage
โ โโโ Patient_Log.txt
โโโ ๐ฎ Unity Scripts/ # VR interaction controllers
โ โโโ MeshDeformer.cs # Tissue deformation physics
โ โโโ VRKnife.cs # Surgical instrument controller
โ โโโ ThrustingKnife.cs # Advanced cutting mechanics
โ โโโ PowerKnife.cs # Force-feedback cutting tool
โ โโโ SimpleExtraction.cs # Dental extraction mechanics
โโโ ๐ models/ # 3D anatomical assets (Git LFS)
โ โโโ NasalBlender.obj # Nasal cavity model (70.8 MB)
โ โโโ hepatitis liver.obj # Liver pathology model (8.3 MB)
โโโ ๐ sounds/ # Audio feedback assets
โ โโโ squash-sound.wav
โโโ ๐ README.md
| Component | Technology | Purpose |
|---|---|---|
| Graphics Engine | Panda3D | 3D rendering and physics simulation |
| Game Engine | Unity 2021.3+ | VR interaction and haptics |
| Scientific Computing | NumPy, Trimesh | Mesh manipulation and analysis |
| UI Framework | Tkinter | Cross-platform menu interface |
| Version Control | Git LFS | Large 3D model asset management |
| Format | Import | Export | Notes |
|---|---|---|---|
| OBJ | โ | โ | Primary 3D model format |
| STL | โ | โ | Requires trimesh library |
| PLY | โ | โ | Point cloud and mesh data |
| FBX | โ | โ | Animation-compatible format |
| GLTF/GLB | โ | โ | Modern web-ready format |
| TXT | โ | โ | Medical notes export only |
# Python Version
Python 3.8 or higher
# System Requirements
- OS: Windows 10/11, Linux (Ubuntu 20.04+), macOS 10.15+
- RAM: 8GB minimum, 16GB recommended for complex models
- GPU: Dedicated graphics card with OpenGL 3.3+ support
- Storage: 2GB available space1๏ธโฃ Clone the Repository
git clone https://github.com/yourusername/medical-vr-suite.git
cd medical-vr-suite2๏ธโฃ Install Python Dependencies
pip install numpy panda3d trimesh3๏ธโฃ Configure Git LFS (for 3D models)
git lfs install
git lfs pull๐ Important: This repository uses Git LFS to manage large 3D model files. GitHub's file size limitations require this approach for anatomical meshes.
4๏ธโฃ Verify Audio Configuration
Edit liver.py line 47 to match your system's audio file path:
SOUND_FILE_PATH = r"path/to/your/sounds/squash-sound.wav"5๏ธโฃ Launch Application
python main.py๐ฏ Training Objectives:
- Understanding cardiac anatomy and rhythm
- Observing myocardial contraction patterns
- Recognizing abnormal heartbeat variations
โจ Features:
- ๐ซ Realistic heartbeat animation with rhythmic deformation
- ๐ Multiple cardiac cycle phase visualization
- ๐ Adjustable heart rate simulation
- ๐ Dynamic muscle tissue response
๐ฎ Controls:
- Observation Mode: Automatic beating animation
- Parameter Adjustment: UI sliders for rate control
๐น Demo:
video_2025-11-27_10-24-03.mp4
๐ฏ Training Objectives:
- Soft tissue manipulation techniques
- Force application and tactile feedback
- Organ handling and positioning skills
โจ Features:
- โก Dual interaction modes: Precision mouse control and 3D VR hand emulation
- โ๏ธ Adjustable compression force (0-200N) with real-time visual feedback
- ๐งฑ Two tissue density presets: Hard (bone-like) and Soft (flesh-like)
- ๐ Spring-mass physics with natural recovery dynamics
- ๐ฏ Volumetric interaction radius for realistic contact
๐ฎ Controls:
| Mode | Control | Action |
|---|---|---|
| VR Hand | W/A/S/D |
Move hand in X/Z plane |
| VR Hand | Q/E |
Push forward/pull back (depth) |
| VR Hand | Auto | Continuous squeeze on contact |
| Mouse | Left Click | Apply compression force |
| Mouse | Right Click + Drag | Rotate organ view |
| UI | Force Slider | Adjust compression strength (0-200N) |
| UI | Reset Button | Restore original mesh geometry |
๐ฌ Technical Physics:
# Soft-Body Dynamics Parameters
user_force: 0-200N # Adjustable via UI slider
recovery_speed: 8.0 # Spring constant (k)
damping: 10.0 # Velocity damping coefficient
interaction_radius: 2.0 # Hard tissue mode
interaction_radius: 4.0 # Soft tissue mode๐น Demo:
Liver.2.mp4
๐ฏ Training Objectives:
- Nasal cavity anatomy exploration
- Endoscopic navigation techniques
- Internal structure identification
โจ Features:
- ๐ฌ High-resolution nasal cavity model (70.8MB detailed mesh)
- ๐ Dynamic camera zoom for internal exploration
- ๐งญ Free navigation through nasal passages and sinus cavities
- ๐งฑ Squeeze mechanics functional on internal and tissues
- ๐๏ธ Real-time tissue response during cavity exploration
๐ฎ Controls:
- Zoom: Mouse scroll wheel or designated keys
- Navigate:
W/A/S/Dfor camera movement inside cavity - Squeeze: Left-click on internal structures
- Rotate View: Right-click and drag
๐ฅ Clinical Applications:
- ๐งญ Turbinate structure visualization
- ๐ Sinus cavity exploration
- ๐ Endoscopic procedure practice
- ๐ Septal deviation assessment
๐น Demo:
Nose.mp4
๐ฏ Training Objectives:
- Understanding hemodynamic principles
- Visualizing blood flow patterns
- Recognizing thrombotic events
โจ Features:
- ๐ Particle-based blood flow visualization
- ๐จ Laminar and turbulent flow pattern simulation
- ๐ฉธ Interactive clotting mechanism
- ๐งฑ Vessel wall interaction dynamics
- โก Adjustable flow velocity parameters
๐ฎ Controls:
- ** Flow Rate Slider**: Adjust blood velocity
- ** Clotting Button**: Introduce thrombotic factors
- ** Camera Controls**: Observe flow from multiple angles
๐ฅ Medical Applications:
- ๐ซ Thrombosis visualization and progression
- ๐ Embolism event simulation
- ๐ฉบ Vascular occlusion training scenarios
- ๐ Hemodynamic principle demonstration
๐น Demo:
BloodFlow.mp4
๐ฏ Training Objectives:
- Surgical incision techniques
- Multi-layer tissue identification
- Depth perception and control
โจ Features:
- โ๏ธ Multi-layer tissue cutting simulation
- ๐จ Depth-based color mapping system:
- ๐ค Beige: Superficial skin layer (intensity โค 0.2)
- ๐ด Red: Intermediate muscle tissue (0.2 < intensity โค 0.6)
- โช White: Deep bone structure (intensity > 0.6)
- ๐ Adjustable cutting position (0.0 - 5.0 height units)
- โ๏ธ Variable incision depth strength (0.5 - 2.0 multiplier)
- ๐พ PLY file generation for external 3D analysis
๐ฌ Technical Implementation:
# Layer Classification Algorithm
if intensity > 0.6: โ Bone (white)
elif intensity > 0.2: โ Muscle (red)
else: โ Skin (beige)
# Deformation Formula
push_vector = normal ร (-1) ร intensity ร depth_factor
new_position = original_position + push_vector๐ฎ Controls & Usage:
python cutting.py
# Interactive Prompts:
Enter cutter height (0.0 to 5.0) [default 2.5]: 3.0
Enter cut depth strength (0.5 to 2.0) [default 1.2]: 1.5
# Output: cut_simulation.ply๐ Output File:
- Opens in Windows 3D Viewer, Blender, or MeshLab
- Displays color-coded anatomical layers
- Suitable for surgical planning review
๐น Demo:
Abdomen.mp4
๐ฏ Training Objectives:
- Tooth extraction procedures
- Grip force calibration
- Dental anatomy understanding
โจ Features:
- ๐ฆท Individual tooth and molar selection
- ๐ช Extraction mechanics with realistic resistance simulation
- ๐ Replacement and repositioning capabilities
- ๐ณ Root structure visualization
- ๐ Force feedback during extraction process
๐ฎ Controls:
- ๐ฏ Select Tooth: Left-click on desired tooth
- โฌ๏ธ Extract: Click and drag upward motion
- โฌ๏ธ Replace: Drag tooth back to original socket
- ๐ Rotate View: Right-click and drag
๐ฅ Clinical Applications:
- Simple extraction practice
- Forceps grip technique training
- Socket preservation procedures
- Post-extraction assessment
๐น Demo:
Teath.mp4
1๏ธโฃ Start Main Menu
python main.py2๏ธโฃ Navigate Interface
- ๐ฏ Click any module card to launch simulation
- ๐ Use "Notes/Whiteboard" button for clinical documentation
- โน๏ธ Access "Records & Info" for patient history management
The VR hand emulator provides 3D spatial control without requiring physical VR hardware:
๐ฎ Movement Controls:
| Key | Axis | Action |
|---|---|---|
W |
+Z | Move hand upward |
S |
-Z | Move hand downward |
A |
-X | Move hand left |
D |
+X | Move hand right |
Q |
+Y | Push hand forward (into scene) |
E |
-Y | Pull hand backward (toward camera) |
๐๏ธ Visual Feedback:
- ๐ข Green Wireframe Sphere: VR hand boundary volume
- โช White Center Marker: Precise interaction point
- ๐ป 30% Transparency: Maintains visibility of underlying anatomy
โก Interaction Mechanics:
- ๐คฒ Hand exerts continuous force upon contact (no button press required)
- โ๏ธ Force magnitude controlled by UI slider (0-200N)
- ๐ Tissue responds with spring-mass physics in real-time
- ๐ฏ Volumetric interaction radius adapts to tissue density
โจ Features:
- ๐๏ธ Digital whiteboard for surgical annotations
- ๐ Patient record creation with timestamping
- ๐พ Persistent local storage (no cloud upload)
- ๐ Search and filter capabilities for record retrieval
- ๐ค Export functionality: Save notes as
.txtfiles
๐ Access Method: Click "๐ Notes / Whiteboard" button on main menu
๐ Storage Location:
Medical-VR-Suite/
โโโ Patient_Records/
โโโ Patient_Log.txt
โโโ patient_001_notes.txt
โโโ patient_002_notes.txt
โโโ ...
๐ก Use Cases:
- โ๏ธ Document surgical observations during simulation
- ๐ Track training progress and skill development
- ๐ Create study notes for anatomy review
- ๐ Log clinical decision-making rationale
All demonstration videos are embedded throughout the module descriptions above. Each video showcases:
- โ Real-time interaction mechanics
- โ Physics-based deformation behavior
- โ User interface and control schemes
- โ Clinical training applications
๐ฌ Soft-Body Deformation Algorithm:
The system uses a spring-mass model with Verlet integration:
# Force Calculations
F_spring = -k ร displacement # Hooke's Law
F_damping = -c ร velocity # Viscous damping
F_external = user_force ร influence_factor # User interaction
# Verlet Integration Scheme
acceleration = (F_spring + F_damping + F_external) / mass
velocity_new = velocity_old + acceleration ร ฮt
position_new = position_old + velocity_new ร ฮt๐ Influence Function:
Implements cubic falloff for realistic tissue compression:
influence = (1 - distance/radius)ยณ # Cubic distance falloff
force_vector = base_force ร influence ร direction_normalized๐จ Rendering Pipeline:
- Vertex Transformation: CPU-side deformation calculations
- Normal Recalculation: Per-frame surface normal updates
- PBR Shading: Physically-based rendering with Blinn-Phong model
- Shadow Mapping: 2048ร2048 resolution shadow atlas
- Anti-Aliasing: Multi-sample anti-aliasing (MSAA 4x)
The repository includes Unity C# scripts for advanced VR interactions:
| Script | Purpose | Key Features |
|---|---|---|
| MeshDeformer.cs | Soft-body physics | Spring-mass system, collision handling |
| VRKnife.cs | Basic cutting tool | Haptic feedback, deformation on contact |
| ThrustingKnife.cs | Motor-powered scalpel | Trigger-activated thrust, enhanced cutting |
| PowerKnife.cs | Advanced cutting | Dual cutting modes, variable depth |
| SimpleExtraction.cs | Dental extraction | Velocity-based extraction detection |
โ Issue: "Model appears black or unlit"
โ
Solution:
1. Update GPU drivers to the latest version
2. Verify OpenGL version: Must be 3.3 or higher
3. Check graphics card compatibility with Panda3D
โ Issue: "VR hand not responding to keyboard"
โ
Solution:
1. Verify VR mode is enabled (button should display green)
2. Ensure keyboard focus is on the application window
3. Check that no other application is capturing WASD input
โ Issue: "Lag during tissue deformation"
โ
Solution:
1. Reduce mesh resolution in cutting.py (mesh_res parameter)
2. Lower force slider value to reduce physics calculations
3. Close unnecessary background applications
4. Consider upgrading RAM if using complex models
โ Issue: "Git LFS models not downloading"
โ
Solution:
1. Install Git LFS: git lfs install
2. Pull LFS files: git lfs pull
3. Verify .gitattributes configuration
This project was developed by a dedicated team of medical simulation enthusiasts:
- ๐ง Email: maryam23shabaan@gmail.com
- GitHub
- ๐ง Email: aya.sayed14827@gmail.com
- GitHub
- ๐ง Email: youssef.abdelrauf23@gmail.com
- GitHub
- ๐ง Email: ashrafrahma402@gmail.com
- GitHub
- ๐ฎ Full VR headset integration (Oculus Quest, HTC Vive)
- ๐ค Multi-user collaborative training mode
- ๐ฉธ Advanced cardiovascular system simulation
- ๐ MRI/CT scan data import and visualization
- AI-powered surgical guidance and error detection
- Performance assessment and skill tracking system
- Cloud-based patient record synchronization
- Web-based deployment for browser access
๐ป System Performance:
- ๐ฎ Render FPS: 60+ (with recommended GPU)
- โก Physics Update: 120Hz refresh rate
- โจ๏ธ Input Latency: <16ms response time
- ๐พ Memory Usage: ~500MB base + model size
๐๏ธ Supported Model Complexity:
- Minimum: 10,000 vertices
- Recommended: 50,000 - 100,000 vertices
- Maximum tested: 500,000 vertices
This project is licensed under the MIT License - see the LICENSE file for complete terms and conditions.
Special thanks to:
- ๐ Medical education advisors for clinical accuracy review
- ๐จ 3D modeling community for anatomical asset resources
- ๐ป Open-source contributors to Panda3D and Unity ecosystems
- ๐ฅ Medical students who provided valuable testing feedback
** Made with โค๏ธ for advancing medical education through immersive technology**