Troubleshooting Guide
This guide provides solutions to common problems and errors you may encounter while using CTHarvester.
Installation Issues
Python Import Errors
Problem: ImportError: No module named 'PyQt5'
or similar module not found errors
Solution:
Ensure you have installed all dependencies:
pip install -r requirements.txt
If using a virtual environment, verify it is activated:
# Windows venv\Scripts\activate # Linux/macOS source venv/bin/activate
Try reinstalling the specific missing package:
pip install PyQt5 --upgrade
Problem: ModuleNotFoundError: No module named 'OpenGL'
Solution (Linux):
# Ubuntu/Debian
sudo apt-get update
sudo apt-get install python3-opengl libglu1-mesa
# Fedora
sudo dnf install python3-pyopengl mesa-libGLU
Solution (Windows/macOS):
pip install PyOpenGL PyOpenGL-accelerate
Rust Module Issues
Problem: Rust module not loading, falling back to Python
Symptoms:
Console message: “Rust thumbnail module not available, using Python fallback”
Thumbnail generation is very slow (8-10 seconds per image)
Solution 1: Install Rust toolchain
# Install Rust (if not installed)
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
# Restart terminal, then verify installation
rustc --version
Solution 2: Build the Rust module
# Install maturin (Rust-Python bridge)
pip install maturin
# Build and install the module
cd rust_thumbnail
maturin develop --release
cd ..
Solution 3: Verify module is in correct location
The compiled Rust module should be in one of these locations:
Windows:
rust_thumbnail/target/wheels/*.whl
or directly in Python site-packagesLinux/macOS:
rust_thumbnail/target/wheels/*.whl
or Python site-packages
Problem: Rust module build fails with compiler errors
Common Causes:
Outdated Rust version - Update Rust:
rustup update stable
Missing C/C++ compiler (Windows):
Install Microsoft Visual C++ Build Tools
Or install Visual Studio with C++ development tools
Missing build essentials (Linux):
# Ubuntu/Debian sudo apt-get install build-essential # Fedora sudo dnf install gcc gcc-c++ make
Permission Issues
Problem: “Permission denied” when opening directory or saving files
Windows Solution:
Right-click CTHarvester.exe → “Run as administrator” (not recommended for normal use)
Or change folder permissions:
Right-click folder → Properties → Security
Ensure your user has “Full control”
Linux/macOS Solution:
# Check permissions
ls -la /path/to/directory
# Fix permissions if needed
chmod -R u+rw /path/to/directory
Problem: Settings not saving
Location of settings files:
Windows:
%APPDATA%\CTHarvester\settings.yaml
Linux/macOS:
~/.config/CTHarvester/settings.yaml
Solution:
Check write permissions on the config directory
Manually create the directory if it doesn’t exist:
# Windows (PowerShell) mkdir "$env:APPDATA\CTHarvester" # Linux/macOS mkdir -p ~/.config/CTHarvester
Delete corrupted settings file to regenerate defaults:
# Windows (PowerShell) rm "$env:APPDATA\CTHarvester\settings.yaml" # Linux/macOS rm ~/.config/CTHarvester/settings.yaml
Directory and File Loading Issues
No Valid Image Files Found
Problem: “No valid image files found in directory” error when opening a folder
Possible Causes:
Incorrect naming pattern
CTHarvester expects sequential image files with naming patterns like:
slice_0001.tif
image_001.png
CT0001.tif
The pattern must include:
A prefix (optional)
Sequential numbers (required)
File extension (.tif, .tiff, .png, .jpg, .bmp)
Unsupported file formats
Only these formats are supported:
TIF/TIFF (recommended for medical imaging)
PNG
JPG/JPEG
BMP
Solution:
Check that files follow naming convention:
Files must have numeric sequence:
001
,002
,003
, etc.Numbers must be zero-padded to same length
Rename files if needed:
# Linux/macOS example # Rename files to proper format count=1 for file in *.tif; do mv "$file" "slice_$(printf '%04d' $count).tif" ((count++)) done
Verify file extensions are lowercase or uppercase consistently
Problem: Only some images are loaded, not all
Causes:
Non-sequential numbering (gaps in sequence)
Mixed file extensions in same directory
Corrupted images breaking the sequence
Solution:
Ensure sequential numbering with no gaps
Place different file types in separate directories
Check for corrupted files:
# Test each image (Linux/macOS) for file in *.tif; do python -c "from PIL import Image; Image.open('$file')" || echo "Corrupted: $file" done
Corrupted Image Files
Problem: “Failed to load image” or “Corrupted image file” error
Symptoms:
Application crashes when loading certain slices
Error dialog about corrupted files
Some thumbnails show as blank/black
Solution:
Identify corrupted files:
Check the log files for error messages:
Windows:
%APPDATA%\CTHarvester\logs\
Linux/macOS:
~/.config/CTHarvester/logs/
Look for lines containing “CorruptedImageError” or “Failed to load”
Verify file integrity:
# Check file size - corrupted files often have 0 bytes ls -lh /path/to/images/
Try repairing with ImageMagick:
# Install ImageMagick # Ubuntu: sudo apt-get install imagemagick # macOS: brew install imagemagick # Attempt repair convert corrupted.tif -strip repaired.tif
Replace corrupted files:
If possible, re-export from CT scanner
Or remove corrupted files from sequence (may break sequence)
Skip corrupted files:
In future versions, CTHarvester will have an option to skip corrupted files automatically.
Invalid Image Format
Problem: “Invalid image format” or “Unsupported bit depth” errors
Cause: Image has unsupported characteristics:
32-bit floating point TIFFs
24-bit or 48-bit RGB when grayscale expected
Compressed formats not supported by PIL
Solution:
Convert to supported format:
# Convert to 8-bit or 16-bit grayscale TIFF convert input.tif -depth 16 -colorspace Gray output.tif
Check image properties:
from PIL import Image img = Image.open('image.tif') print(f"Mode: {img.mode}") # Should be 'L' or 'I;16' print(f"Size: {img.size}") print(f"Format: {img.format}")
Supported image modes:
L
- 8-bit grayscale (0-255)I;16
- 16-bit grayscale (0-65535)RGB
- 24-bit color (will be converted to grayscale)
Performance Issues
Slow Thumbnail Generation
Problem: Thumbnail generation takes 8-10 seconds per image (extremely slow)
Expected Performance:
With Rust module: 0.1-0.5 seconds per image
Without Rust (Python): 1-2 seconds per image (acceptable)
Abnormally slow: 8-10+ seconds per image (problem!)
Solution 1: Enable Rust module (10-50x speedup)
See “Rust Module Issues” section above for installation instructions.
Solution 2: Check disk I/O
# Linux - check disk speed
sudo hdparm -tT /dev/sda
# Windows - check in Task Manager → Performance → Disk
Possible causes:
USB 2.0 external drive (slow) - Use USB 3.0+ or internal SSD
Network drive with high latency - Copy files locally first
Disk fragmentation (Windows HDD) - Run defragmentation
Too many threads - Reduce worker threads in settings
Solution 3: Optimize settings
Open Settings (gear icon ⚙️)
Adjust these settings:
Worker threads: Set to 2-4 (not more than CPU cores)
Max thumbnail size: Reduce to 300-400 pixels
Sample size: Reduce to 10-15
Enable compression: Disable for faster generation
Solution 4: System performance
Close other applications to free RAM
Check background processes (Windows Search, antivirus)
Reboot if system has been in sleep mode (Windows-specific issue)
Problem: Thumbnail generation was fast before, now suddenly slow
Possible causes:
Windows sleep/resume issues:
After system sleep/resume, performance may degrade due to:
Memory fragmentation
SSD not resuming to full performance
Driver state issues
Solution: Reboot the computer
Rust module no longer loading:
Check console for “Rust thumbnail module not available” message
Solution: Reinstall Rust module (see above)
Disk cache issues:
# Linux - clear page cache (requires sudo) sudo sync && sudo sysctl -w vm.drop_caches=3
Out of Memory Errors
Problem: “Out of memory” or “MemoryError” when processing large datasets
Solution 1: Reduce memory usage
Open Settings → Processing
Adjust settings:
Memory limit: Reduce to 2-3 GB
Worker threads: Reduce to 1-2
Max thumbnail size: Reduce to 300 pixels
Solution 2: Process in smaller batches
Split large datasets into smaller folders
Process each folder separately
Combine results afterward
Solution 3: Close other applications
Close web browsers (Chrome uses lots of RAM)
Close unnecessary applications
Check Task Manager/Activity Monitor for memory usage
Solution 4: Upgrade RAM
4GB RAM: Can process small datasets (<500 images)
8GB RAM: Recommended for medium datasets (<2000 images)
16GB+ RAM: For large datasets (5000+ images)
Problem: Memory usage keeps increasing over time
Cause: Memory leak in image processing
Solution:
Restart CTHarvester every few hours when processing very large datasets
Process in smaller batches
Update to latest version (memory leaks are being fixed)
UI freezing during processing
Problem: Application becomes unresponsive during thumbnail generation
Expected behavior: UI should remain responsive with progress updates
Solution 1: Check if truly frozen
Wait 30-60 seconds
Check if progress bar is moving (slowly)
Check console output for activity
Solution 2: Increase responsiveness
Settings → Processing
Reduce worker threads to 1 (forces sequential processing)
Enable “High priority UI updates” (if available)
Solution 3: Force quit if truly frozen
Windows: Task Manager → End Task
macOS: Force Quit (Cmd+Option+Esc)
Linux:
killall python
orkill -9 <pid>
Problem: Application frozen after clicking “Cancel”
Cause: Workers need time to finish current operation
Solution: Wait 10-30 seconds for workers to stop gracefully
3D Visualization Issues
3D View Not Updating
Problem: 3D mesh not appearing or not updating when threshold changes
Solution 1: Check threshold value
Try different threshold values (0-255)
For dark images: Use lower thresholds (50-100)
For bright images: Use higher thresholds (150-200)
Enable “Inversion” checkbox if viewing negative scans
Solution 2: Verify data loaded
Ensure enough slices are loaded (minimum ~10-20 for visible mesh)
Check crop bounds include actual data
Verify images are not completely black or white
Solution 3: Reset 3D view
Double-click in 3D view area to reset camera
Try different viewing angles by dragging
Zoom in/out with scroll wheel
Problem: 3D view shows incorrect/garbled mesh
Cause: Invalid threshold or corrupted data
Solution:
Reset threshold to default (128)
Check original images for data integrity
Try different crop bounds
Verify bit depth is correct (8-bit vs 16-bit)
OpenGL Errors
Problem: “OpenGL error” or “Failed to initialize OpenGL context”
Linux Solution:
# Install OpenGL libraries
sudo apt-get install mesa-utils libglu1-mesa-dev freeglut3-dev mesa-common-dev
# Test OpenGL
glxinfo | grep "OpenGL version"
Windows Solution:
Update graphics drivers:
NVIDIA: Download from nvidia.com
AMD: Download from amd.com
Intel: Use Windows Update
Try forcing software rendering (slower but works):
Set environment variable before launching CTHarvester:
set LIBGL_ALWAYS_SOFTWARE=1 CTHarvester.exe
macOS Solution:
Update macOS to latest version
OpenGL should work out of the box on macOS 10.14+
Problem: Low FPS in 3D view (< 10 FPS)
Solution:
Settings → Rendering
Disable “Anti-aliasing”
Reduce mesh complexity by using higher threshold
Update graphics drivers
Check if integrated GPU is being used instead of dedicated GPU
File Export Issues
Save Cropped Image Stack Fails
Problem: “Failed to save image stack” or no images saved
Solution 1: Check disk space
# Check available space
# Windows: dir
# Linux/macOS: df -h
Ensure enough space for output:
Formula:
image_count × width × height × bytes_per_pixel
Example: 1000 images × 2048 × 2048 × 2 bytes = ~8 GB
Solution 2: Verify write permissions
Try saving to a different directory
On Windows, avoid “Program Files” directory
Use Documents or Desktop folder
Solution 3: Check filename conflicts
Remove existing files with same names
Or choose different output directory
Problem: Exported images are black/white/corrupted
Cause: Incorrect bit depth conversion or threshold issue
Solution:
Check original images are not corrupted
Verify crop bounds are correct
Try exporting small sample first (5-10 images)
Check bit depth matches source (8-bit vs 16-bit)
Export 3D Model Fails
Problem: “Failed to export 3D model” or OBJ file is empty
Solution 1: Check threshold
Threshold too high/low may result in empty mesh
Try different threshold values
Ensure 3D preview shows visible mesh before export
Solution 2: Verify mesh generation
Look for error messages in console/logs
Check that marching cubes algorithm completed successfully
Try with smaller dataset first
Solution 3: File format issues
Ensure file extension is
.obj
Try different export location
Check disk space and permissions
Problem: 3D model is too large to open in other software
Cause: High-resolution mesh with millions of polygons
Solution:
Use higher threshold to reduce mesh complexity
Export smaller crop region
Use mesh decimation software (MeshLab, Blender) to reduce polygon count
Export in chunks and combine later
Settings and Configuration Issues
Settings Not Persisting
Problem: Settings reset to defaults every time you restart CTHarvester
Solution 1: Check config file location
# Windows
dir %APPDATA%\CTHarvester
# Linux/macOS
ls ~/.config/CTHarvester
Solution 2: Fix permissions
# Linux/macOS
chmod -R u+rw ~/.config/CTHarvester
# Windows: Use file properties to grant full control
Solution 3: Delete corrupted config
# This will regenerate default settings
# Windows
del %APPDATA%\CTHarvester\settings.yaml
# Linux/macOS
rm ~/.config/CTHarvester/settings.yaml
Cannot Import Settings
Problem: “Failed to import settings” when loading YAML file
Solution:
Check YAML syntax:
Use YAML validator online
Ensure proper indentation (spaces, not tabs)
Check for special characters
Verify file is not corrupted:
# Check if file is valid YAML python -c "import yaml; yaml.safe_load(open('settings.yaml'))"
Try exporting settings first, then modifying the exported file
Language/Translation Issues
Problem: UI text shows untranslated strings or incorrect language
Solution:
Settings → General → Language
Select desired language
Restart CTHarvester
Problem: Mixed languages (some English, some Korean)
Cause: Incomplete translation coverage
Solution:
Report missing translations as GitHub issue
Provide English text and location in UI
Temporary workaround: Use English language setting
Advanced Troubleshooting
Collecting Debug Information
When reporting issues, include this information:
System Information:
# Python version python --version # OS version # Windows: winver # macOS: sw_vers # Linux: lsb_release -a
CTHarvester version:
python CTHarvester.py --version
Log files:
Windows:
%APPDATA%\PaleoBytes\CTHarvester\logs\
Linux/macOS:
~/.local/share/PaleoBytes/CTHarvester/logs/
Package versions:
pip list | grep -E "PyQt5|numpy|pillow|scipy|pymcubes"
Enabling Debug Logging
To get more detailed logs:
Via Settings:
Settings → Advanced → Logging
Set “Log level” to “DEBUG”
Enable “Console output”
Via Environment Variable:
# Before launching CTHarvester export CTHARVESTER_LOG_LEVEL=DEBUG python CTHarvester.py
View logs:
Help menu → “View Logs” (opens log directory)
Or manually navigate to log directory (see above)
Running in Safe Mode
To disable all optimizations and run with minimal features:
# Disable Rust module
python CTHarvester.py --no-rust
# Use single thread
python CTHarvester.py --threads 1
# Disable 3D view
python CTHarvester.py --no-3d
# Combine options
python CTHarvester.py --no-rust --threads 1 --no-3d
Common Error Messages
“Directory does not exist”
Cause: Selected directory was moved or deleted
Solution: Browse to a different directory
“Permission denied”
Cause: Insufficient file system permissions
Solution: See “Permission Issues” section above
“Thumbnail generation failed”
Cause: Error during thumbnail processing (disk full, corrupted image, etc.)
Solution:
Check disk space
Verify images are not corrupted
Try with smaller sample size
Check logs for specific error
“Worker thread crashed”
Cause: Unexpected error in background thread
Solution:
Check logs for Python traceback
Restart CTHarvester
Try processing single-threaded (Settings → Processing → Worker threads: 1)
Report as bug with log file
Getting Additional Help
If this guide doesn’t solve your problem:
Check GitHub Issues:
https://github.com/jikhanjung/CTHarvester/issues
Search for similar problems - they may already be solved
Create New Issue:
Include:
Operating system and version
Python version (
python --version
)CTHarvester version
Error message or description
Steps to reproduce
Log files (see “Collecting Debug Information” above)
GitHub Discussions:
For questions and general discussion:
Email Support:
Contact: jikhanjung@gmail.com
(Please try GitHub issues first for faster community support)
Known Issues and Limitations
Current Limitations
Maximum Image Resolution:
Tested up to 4096×4096 pixels
Larger images may work but require more RAM
File Naming:
Must have sequential numbers
No support for non-sequential datasets yet
3D Export Formats:
OBJ, PLY, STL supported
No VRML, Collada, or other formats yet
Platform-Specific:
macOS builds not code-signed (requires manual approval)
Linux AppImage requires FUSE
GUI Only:
No command-line interface yet
Cannot run in headless mode
Memory Usage:
Full dataset not loaded into memory (by design)
But thumbnails require disk space
Planned Improvements
See CHANGELOG and GitHub milestones for planned features:
Command-line interface for batch processing
Support for DICOM format
Auto-detection and skipping of corrupted files
Improved error recovery
Better memory management for huge datasets
GPU acceleration for thumbnail generation
Plugin system for custom workflows
Contributing
Found a bug or have suggestions? Contributions welcome!
Report bugs: https://github.com/jikhanjung/CTHarvester/issues
Submit fixes: https://github.com/jikhanjung/CTHarvester/pulls
Improve docs: Edit this file and submit PR
See CONTRIBUTING.md for detailed contribution guidelines.