|
| 1 | +# Probe Library Generator |
| 2 | + |
| 3 | +This tool uses probeinterface to generate CSV and OBJ files for neural probes that are compatible with Pinpoint. |
| 4 | + |
| 5 | +## Files Generated |
| 6 | + |
| 7 | +For each probe, the tool generates: |
| 8 | + |
| 9 | +1. **CSV file** - Electrode positions and dimensions (`probe_name.csv`) |
| 10 | +2. **OBJ file** - 3D geometry of the probe (`probe_name.obj`) |
| 11 | +3. **Metadata JSON** - Probe specifications (`probe_name_metadata.json`) |
| 12 | + |
| 13 | +## CSV Format |
| 14 | + |
| 15 | +The CSV file contains electrode information with these columns: |
| 16 | +- `electrode_number`: 1-based electrode number |
| 17 | +- `x`, `y`, `z`: Electrode position relative to probe tip (micrometers) |
| 18 | +- `width`, `height`, `depth`: Electrode dimensions (micrometers) |
| 19 | + |
| 20 | +## Installation |
| 21 | + |
| 22 | +Make sure you have the virtual environment set up: |
| 23 | + |
| 24 | +```bash |
| 25 | +# Activate the virtual environment |
| 26 | +source .venv/bin/activate |
| 27 | + |
| 28 | +# Install required packages (already done) |
| 29 | +pip install probeinterface numpy |
| 30 | +``` |
| 31 | + |
| 32 | +## Usage |
| 33 | + |
| 34 | +### Process All Available Probes |
| 35 | + |
| 36 | +```bash |
| 37 | +python src/probe_library/probe_generator.py |
| 38 | +``` |
| 39 | + |
| 40 | +This will: |
| 41 | +- Try to load all known probes from the probeinterface library |
| 42 | +- Generate demo probes (linear, multi-column, dummy) |
| 43 | +- Save all files to `probe_outputs/` directory |
| 44 | + |
| 45 | +### Process Single Probe |
| 46 | + |
| 47 | +```bash |
| 48 | +python process_single_probe.py manufacturer probe_name |
| 49 | +``` |
| 50 | + |
| 51 | +Examples: |
| 52 | +```bash |
| 53 | +python process_single_probe.py neuronexus A1x32-Poly3-10mm-50-177 |
| 54 | +python process_single_probe.py cambridgeneurotech ASSY-37-E-1 |
| 55 | +``` |
| 56 | + |
| 57 | +### Discover Available Probes |
| 58 | + |
| 59 | +```bash |
| 60 | +python src/probe_library/discover_probes.py |
| 61 | +``` |
| 62 | + |
| 63 | +This will test which probes are actually available in the probeinterface library. |
| 64 | + |
| 65 | +## Currently Available Probes |
| 66 | + |
| 67 | +Based on testing, these probes are available: |
| 68 | + |
| 69 | +- **neuronexus/A1x32-Poly3-10mm-50-177** - 32 contacts, 1 shank |
| 70 | +- **cambridgeneurotech/ASSY-37-E-1** - 32 contacts, 2 shanks |
| 71 | +- **cambridgeneurotech/ASSY-77-E-1** - 64 contacts, 4 shanks |
| 72 | +- **cambridgeneurotech/ASSY-156-P-1** - 64 contacts, 4 shanks |
| 73 | +- **cambridgeneurotech/ASSY-116-P-1** - 32 contacts, 2 shanks |
| 74 | + |
| 75 | +## Output Files |
| 76 | + |
| 77 | +All generated files are saved to the `probe_outputs/` directory: |
| 78 | + |
| 79 | +``` |
| 80 | +probe_outputs/ |
| 81 | +├── neuronexus_A1x32-Poly3-10mm-50-177.csv |
| 82 | +├── neuronexus_A1x32-Poly3-10mm-50-177.obj |
| 83 | +├── neuronexus_A1x32-Poly3-10mm-50-177_metadata.json |
| 84 | +├── cambridgeneurotech_ASSY-37-E-1.csv |
| 85 | +├── cambridgeneurotech_ASSY-37-E-1.obj |
| 86 | +├── cambridgeneurotech_ASSY-37-E-1_metadata.json |
| 87 | +└── ... |
| 88 | +``` |
| 89 | + |
| 90 | +## Example Output |
| 91 | + |
| 92 | +### CSV File |
| 93 | +```csv |
| 94 | +electrode_number,x,y,z,width,height,depth |
| 95 | +1,0,450,0.0,20,20,20 |
| 96 | +2,0,500,0.0,20,20,20 |
| 97 | +3,0,400,0.0,20,20,20 |
| 98 | +... |
| 99 | +``` |
| 100 | + |
| 101 | +### Metadata JSON |
| 102 | +```json |
| 103 | +{ |
| 104 | + "name": "Neuronexus A1X32-Poly3-10Mm-50-177", |
| 105 | + "type": 1, |
| 106 | + "producer": "neuronexus", |
| 107 | + "sites": 32, |
| 108 | + "shanks": 1, |
| 109 | + "references": "Generated using probeinterface library", |
| 110 | + "spec": "https://probeinterface.readthedocs.io/" |
| 111 | +} |
| 112 | +``` |
| 113 | + |
| 114 | +## Notes |
| 115 | + |
| 116 | +- Coordinates are in micrometers |
| 117 | +- The probe tip is at the origin (0,0,0) |
| 118 | +- OBJ files include both the probe shank and electrode contact geometry |
| 119 | +- The tool automatically handles 2D to 3D conversion for probes |
| 120 | +- SSL certificate verification is disabled to handle library download issues |
| 121 | + |
| 122 | +## Troubleshooting |
| 123 | + |
| 124 | +If you get SSL certificate errors, the scripts automatically handle this by disabling certificate verification for the probeinterface library downloads. |
| 125 | + |
| 126 | +If a specific probe isn't available, check the available probe list using the discovery script. |
0 commit comments