Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PMT sEEG electrodes #61

Merged
merged 5 commits into from
Dec 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions leaddbsinterface/lead_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -627,6 +627,16 @@ def import_implantation_settings(self, hemis_idx, elec_dict=None):
"DIXI D08-12AM": "DixiSEEG12",
"DIXI D08-15AM": "DixiSEEG15",
"DIXI D08-18AM": "DixiSEEG18",
"PMT 2102-08-091": "PMTsEEG2102_08",
"PMT 2102-10-091": "PMTsEEG2102_10",
"PMT 2102-12-091": "PMTsEEG2102_12",
"PMT 2102-14-091": "PMTsEEG2102_14",
"PMT 2102-16-091": "PMTsEEG2102_16",
"PMT 2102-08-094": "PMTsEEG2102_08", # same, just with permanent stylet
"PMT 2102-10-094": "PMTsEEG2102_10",
"PMT 2102-12-094": "PMTsEEG2102_12",
"PMT 2102-14-094": "PMTsEEG2102_14",
"PMT 2102-16-094": "PMTsEEG2102_16",
}

for lead in electrode_names.keys():
Expand Down
22 changes: 22 additions & 0 deletions ossdbs/electrodes/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# SPDX-License-Identifier: GPL-3.0-or-later

"""Electrode models for DBS."""

from .abbott_stjude import (
AbbottStJudeActiveTipModel,
AbbottStJudeActiveTipParameters,
Expand Down Expand Up @@ -48,6 +49,11 @@
PINSMedicalL301,
PINSMedicalL302,
PINSMedicalL303,
PMTsEEG2102_08,
PMTsEEG2102_10,
PMTsEEG2102_12,
PMTsEEG2102_14,
PMTsEEG2102_16,
default_electrode_parameters,
)
from .dixi_microtechniques import (
Expand Down Expand Up @@ -85,6 +91,11 @@
"DixiSEEG12": DixiSEEG12,
"DixiSEEG15": DixiSEEG15,
"DixiSEEG18": DixiSEEG18,
"PMTsEEG2102_08": PMTsEEG2102_08,
"PMTsEEG2102_10": PMTsEEG2102_10,
"PMTsEEG2102_12": PMTsEEG2102_12,
"PMTsEEG2102_14": PMTsEEG2102_14,
"PMTsEEG2102_16": PMTsEEG2102_16,
"Medtronic3387": Medtronic3387,
"Medtronic3389": Medtronic3389,
"Medtronic3391": Medtronic3391,
Expand Down Expand Up @@ -115,6 +126,11 @@
"DixiSEEG12Custom": DixiSEEGModel,
"DixiSEEG15Custom": DixiSEEGModel,
"DixiSEEG18Custom": DixiSEEGModel,
"PMTsEEG2102_08Custom": DixiSEEGModel,
"PMTsEEG2102_10Custom": DixiSEEGModel,
"PMTsEEG2102_12Custom": DixiSEEGModel,
"PMTsEEG2102_14Custom": DixiSEEGModel,
"PMTsEEG2102_16Custom": DixiSEEGModel,
"Medtronic3387Custom": MedtronicModel,
"Medtronic3389Custom": MedtronicModel,
"Medtronic3391Custom": MedtronicModel,
Expand All @@ -139,6 +155,7 @@
"BostonScientificCartesiaXModel": BostonScientificCartesiaParameters,
"BostonScientificCartesiaHXModel": BostonScientificCartesiaParameters,
"DixiSEEGModel": DixiSEEGParameters,
"PMTsEEGModel": DixiSEEGParameters,
"MedtronicModel": MedtronicParameters,
"MedtronicSenSightModel": MedtronicParameters,
"MicroElectrodeModel": MicroElectrodeParameters,
Expand Down Expand Up @@ -177,6 +194,11 @@
"DixiSEEG18",
"DixiSEEGModel",
"DixiSEEGParameters",
"PMTsEEG2102_08",
"PMTsEEG2102_10",
"PMTsEEG2102_12",
"PMTsEEG2102_14",
"PMTsEEG2102_16",
"Medtronic3387",
"Medtronic3389",
"Medtronic3391",
Expand Down
80 changes: 80 additions & 0 deletions ossdbs/electrodes/defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,46 @@
total_length=400.0,
n_contacts=18,
),
"PMTsEEG2102_08": DixiSEEGParameters(
tip_length=0.8,
contact_length=2.0,
contact_spacing=2.0,
lead_diameter=0.8,
total_length=400.0,
n_contacts=8,
),
"PMTsEEG2102_10": DixiSEEGParameters(
tip_length=0.8,
contact_length=2.0,
contact_spacing=2.0,
lead_diameter=0.8,
total_length=400.0,
n_contacts=10,
),
"PMTsEEG2102_12": DixiSEEGParameters(
tip_length=0.8,
contact_length=2.0,
contact_spacing=2.0,
lead_diameter=0.8,
total_length=400.0,
n_contacts=12,
),
"PMTsEEG2102_14": DixiSEEGParameters(
tip_length=0.8,
contact_length=2.0,
contact_spacing=2.0,
lead_diameter=0.8,
total_length=400.0,
n_contacts=14,
),
"PMTsEEG2102_16": DixiSEEGParameters(
tip_length=0.8,
contact_length=2.0,
contact_spacing=2.0,
lead_diameter=0.8,
total_length=400.0,
n_contacts=16,
),
}


Expand Down Expand Up @@ -467,3 +507,43 @@ def DixiSEEG18(
"""DixiSEEG18 electrode."""
parameters = default_electrode_parameters["DixiSEEG18"]
return DixiSEEGModel(parameters, rotation, direction, position)


def PMTsEEG2102_08(
rotation: float = 0, direction: tuple = (0, 0, 1), position: tuple = (0, 0, 0)
):
"""PMTsEEG2102_08 electrode."""
parameters = default_electrode_parameters["PMTsEEG2102_08"]
return DixiSEEGModel(parameters, rotation, direction, position)


def PMTsEEG2102_10(
rotation: float = 0, direction: tuple = (0, 0, 1), position: tuple = (0, 0, 0)
):
"""PMTsEEG2102_10 electrode."""
parameters = default_electrode_parameters["PMTsEEG2102_10"]
return DixiSEEGModel(parameters, rotation, direction, position)


def PMTsEEG2102_12(
rotation: float = 0, direction: tuple = (0, 0, 1), position: tuple = (0, 0, 0)
):
"""PMTsEEG2102_12 electrode."""
parameters = default_electrode_parameters["PMTsEEG2102_12"]
return DixiSEEGModel(parameters, rotation, direction, position)


def PMTsEEG2102_14(
rotation: float = 0, direction: tuple = (0, 0, 1), position: tuple = (0, 0, 0)
):
"""PMTsEEG2102_14 electrode."""
parameters = default_electrode_parameters["PMTsEEG2102_14"]
return DixiSEEGModel(parameters, rotation, direction, position)


def PMTsEEG2102_16(
rotation: float = 0, direction: tuple = (0, 0, 1), position: tuple = (0, 0, 0)
):
"""PMTsEEG2102_16 electrode."""
parameters = default_electrode_parameters["PMTsEEG2102_16"]
return DixiSEEGModel(parameters, rotation, direction, position)
82 changes: 82 additions & 0 deletions tests/electrode_tests/test_PMTsEEG2102.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
import pytest

from ossdbs.electrodes import (
ELECTRODE_MODELS,
PMTsEEG2102_08,
PMTsEEG2102_10,
PMTsEEG2102_12,
PMTsEEG2102_14,
PMTsEEG2102_16,
)

from .test_electrodes import TestElectrode


class TestPMTsEEG2102_08(TestElectrode):
@pytest.fixture
def electrode(self):
return PMTsEEG2102_08()

@pytest.fixture
def electrode_name(self):
return "PMTsEEG2102_08"

def test_rename_boundaries(self, electrode, electrode_name):
"""Test whether set_contact_names() works."""
self.check_rename_boundaries(electrode, electrode_name)

def test_contacts(self, electrode, electrode_name):
"""Test the number and names of contacts."""
self.check_contacts(electrode, electrode_name)

def test_electrode_volume(self, electrode, electrode_name):
"""Test volume of the entire electrode."""
self.check_electrode_volume(electrode, electrode_name)

def test_contacts_volume(self, electrode, electrode_name):
"""Test volume of all the contacts."""
self.check_contacts_volume(electrode, electrode_name)

def test_custom_exists(self, electrode_name):
customname = electrode_name + "Custom"
assert customname in ELECTRODE_MODELS.keys()


class TestPMTsEEG2102_10(TestPMTsEEG2102_08):
@pytest.fixture
def electrode(self):
return PMTsEEG2102_10()

@pytest.fixture
def electrode_name(self):
return "PMTsEEG2102_10"


class TestPMTsEEG2102_12(TestPMTsEEG2102_08):
@pytest.fixture
def electrode(self):
return PMTsEEG2102_12()

@pytest.fixture
def electrode_name(self):
return "PMTsEEG2102_12"


class TestPMTsEEG2102_14(TestPMTsEEG2102_08):
@pytest.fixture
def electrode(self):
return PMTsEEG2102_14()

@pytest.fixture
def electrode_name(self):
return "PMTsEEG2102_14"


class TestPMTsEEG2102_16(TestPMTsEEG2102_08):
@pytest.fixture
def electrode(self):
return PMTsEEG2102_16()

@pytest.fixture
def electrode_name(self):
return "PMTsEEG2102_16"
10 changes: 9 additions & 1 deletion tests/electrode_tests/test_electrodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,14 @@ class TestElectrode:
"DixiSEEG18",
]

PMTsEEG2102: ClassVar[List[str]] = [
"PMTsEEG2102_08",
"PMTsEEG2102_10",
"PMTsEEG2102_12",
"PMTsEEG2102_14",
"PMTsEEG2102_16",
]

def check_rename_boundaries(self, electrode, electrode_name):
"""Check whether set_contact_names() works."""
changes = {
Expand Down Expand Up @@ -249,7 +257,7 @@ def _calculate_contacts_volume(self, electrode, electrode_name):
return (contact_length * tip_radius**2 * np.pi) - filet_val

else:
if electrode_name in self.Dixi:
if electrode_name in self.Dixi or electrode_name in self.PMTsEEG2102:
C1_height = contact_length - lead_radius
else:
C1_height = tip_length - lead_radius
Expand Down