Minimal PySide6 app for streaming Clarius ultrasound and showing two views:
- Original ultrasound image
- Processed image with YOLO detection or UNet segmentation
sidecaster.py imports the UNet model from UNet.py.
sidecaster.py treats its parent directory as the asset directory:
<asset-dir>/
├── libraries/
│ ├── cast.dll # Windows
│ ├── libcast.so # Linux
│ └── pyclariuscast.so # Linux
├── models/
│ ├── yolo_x_phantom_best.pt
│ ├── unet_phantom_latest.pth
│ └── training_parameters.txt # optional
└── <app-dir>/
├── sidecaster.py
├── UNet.py
└── src/ # optional guidance icons
- Python 3
- PySide6
- NumPy
- Ultralytics
- PyTorch
- Clarius Cast library files
- Clarius scanner on the network
pip install PySide6 numpy ultralytics torchpython sidecaster.pyDefault connection:
IP: 192.168.1.1
Port: 5828
Click Connect, then Run.
- YOLO / UNet – choose detection or segmentation
- ROI – limit processing to the centre of the image
- UNet Threshold – adjust the segmentation threshold
- RL / AP / SI – show measurements on the processed image
- Record Boundaries – plot UNet boundary points in 3D when IMU data is available
- Save Local – save current original and processed images
Saved images:
~/Pictures/clarius_original_image.png
~/Pictures/clarius_processed_image.png
- YOLO and UNet are mutually exclusive in the processed view.
- UNet uses
models/unet_phantom_latest.pthand the architecture inUNet.py. - If the app connects but no image appears, check firewall and network settings.