Troubleshooting
This guide covers common issues and their solutions when using SCOPE-XR.
Installation Issues
Package Installation Fails
Symptom: pip install fails with dependency errors.
Solutions:
Upgrade pip:
pip install --upgrade pip
Install in a fresh virtual environment:
python -m venv fresh_env # Windows: .\fresh_env\Scripts\activate # Linux/macOS: source fresh_env/bin/activate pip install git+https://github.com/jacopoaltieri/scope-xr.git
If OpenCV fails, try the headless version:
pip install opencv-python-headless
PyQt6 Installation Problems
Symptom: GUI won’t start due to PyQt6 errors.
Solutions:
On Linux, install system dependencies:
# Ubuntu/Debian sudo apt-get install python3-pyqt6 # Fedora sudo dnf install python3-qt6
Try PyQt5 as alternative (requires code modification)
Image Loading Issues
“File not found” Error
Symptom: Cannot load image file.
Checklist:
Verify file path is correct (use absolute paths)
Check file extension is
.png,.tif, or.rawFor RAW files, ensure corresponding
.xmlmetadata file existsCheck file permissions
RAW Image Format Not Recognized
Symptom: RAW file loads but produces errors.
Requirements for RAW files:
Must have accompanying XML metadata file with same name
XML must contain:
<ImageWidth>,<ImageHeight>Raw data must be in little-endian format
Example XML structure:
<?xml version="1.0"?>
<Image>
<ImageWidth>2048</ImageWidth>
<ImageHeight>2048</ImageHeight>
<BitsPerPixel>16</BitsPerPixel>
</Image>
TIF Images Appear Black
Symptom: Image loads but appears completely black.
Solutions:
Check bit depth - SCOPE-XR supports 8-bit and 16-bit images
Verify image is not inverted (dark background required)
Check that pixel values aren’t all zeros (corrupted file)
Try opening in ImageJ/FIJI to verify image integrity
Circle Detection Problems
“No circular object detected”
Symptom: Hough Transform fails to find the aperture.
Solutions:
Adjust Hough parameters in YAML config or via GUI:
hough_params: minRadius: 30 # Reduce if object is small maxRadius: 800 # Increase if object is large dp: 1.5 # Increase for faster, coarser search param1: 50 # Lower for low contrast param2: 30 # Lower for incomplete circles
Increase image contrast before analysis
Check image orientation - circle must be clearly visible
Use manual center selection (bypass Hough):
scopexr-fs --f "image.tif" --no_hough
Multiple Circles Detected
Symptom: Program detects multiple circles or wrong circle.
Solutions:
Increase
param2in Hough parameters (makes detection stricter)Crop image to show only the test object
Set tighter
minRadiusandmaxRadiusconstraints
Reconstruction Quality Issues
Noisy or Blurry Results
Symptom: Reconstructed focal spot or PSF looks noisy.
Solutions:
Enable symmetrization:
scopexr-fs --f "image.tif" --sym
Change reconstruction filter:
# Try smoother filters scopexr-fs --f "image.tif" --filter hamming # Options: ramp, shepp-logan, cosine, hamming, hann
Increase profile averaging:
avg: true avg_number: 5 # Must be odd number
Check input image quality - noise in input propagates to output
Asymmetric Reconstruction
Symptom: Focal spot appears stretched or asymmetric.
Solutions:
Use axis shift correction:
axis_shifts: 50 # Try larger values for more correction
Verify magnification is correct:
scopexr-fs --f "image.tif" --m 1.42 # Provide known value
Check for centering errors - re-run with better Hough parameters
Verify test object is circular - elliptical objects cause artifacts
Unrealistic Measurements
Symptom: FWHM values seem too large or too small.
Checklist:
Verify pixel size (
--pparameter) matches your detectorCheck magnification estimation or provide manually
Confirm test object diameter (
--dparameter) is correctReview image quality - blurring affects measurements
Performance Issues
Analysis Takes Too Long
Symptom: Processing is very slow.
Optimization tips:
Reduce number of angles:
nangles: 180 # Default is 360, try 180
Decrease axis shift search:
axis_shifts: 20 # Reduce from 50
Disable oversampling for PSF:
scopexr-psf --f "image.tif" --no_oversample
Check CPU usage - close other applications
Out of Memory Errors
Symptom: Process crashes with memory error.
Solutions:
Downscale large images before processing
Reduce oversampling factor
Close other applications to free RAM
Process images one at a time in batch scripts
GUI Issues
GUI Won’t Start
Symptom: scopexr-gui command fails.
Solutions:
Verify PyQt6 is installed:
pip list | grep PyQt6
Test with CLI first to verify installation
Check for display/X11 issues on Linux
Run from command line to see error messages
Configuration Doesn’t Load
Symptom: GUI doesn’t load YAML parameters.
Solutions:
Ensure
fs_args.yamlandpsf_args.yamlare in working directoryCheck YAML syntax with online validator
Look for error messages in GUI console output
Create new config from examples folder
Output Files Issues
No Output Files Generated
Symptom: Analysis completes but no files created.
Checklist:
Check output directory exists and is writable
Review console output for file I/O errors
Verify disk space is available
Check file permissions on output folder
Plots Look Wrong
Symptom: Generated PNG files are blank or corrupted.
Solutions:
Update matplotlib:
pip install --upgrade matplotlibCheck for font-related warnings in output
Try different matplotlib backend in code
Verify image saving permissions
Error Messages
“IndexError: index out of bounds”
Likely causes:
Profile extraction failed (circle too small/large)
Image dimensions don’t match expected values
Array indexing error in edge detection
Solutions:
Adjust
hl(half-length) parameter in configVerify circle detection found correct object
Check image isn’t truncated or corrupted
“ValueError: operands could not be broadcast”
Likely causes:
Dimension mismatch in sinogram reconstruction
Incorrect image format or bit depth
Parameter values incompatible with image size
Solutions:
Verify all dimensions in config match image
Review console output for dimension warnings
Getting Help
If you continue experiencing issues:
Review examples - Compare your setup with working examples
Simplify - Try with provided sample images first
Report bugs - See Contributing Guidelines for how to file issues
When reporting issues, include:
SCOPE-XR version (
pip show scopexr)Python version (
python --version)Operating system
Full error message and traceback
Minimal example to reproduce the issue
Configuration file used (YAML)
For questions and support, open an issue on GitHub.