diff --git a/leaddbsinterface/lead_settings.py b/leaddbsinterface/lead_settings.py index 6320c90..b750295 100644 --- a/leaddbsinterface/lead_settings.py +++ b/leaddbsinterface/lead_settings.py @@ -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(): diff --git a/ossdbs/electrodes/__init__.py b/ossdbs/electrodes/__init__.py index 91d22dc..f9217e7 100644 --- a/ossdbs/electrodes/__init__.py +++ b/ossdbs/electrodes/__init__.py @@ -3,6 +3,7 @@ # SPDX-License-Identifier: GPL-3.0-or-later """Electrode models for DBS.""" + from .abbott_stjude import ( AbbottStJudeActiveTipModel, AbbottStJudeActiveTipParameters, @@ -48,6 +49,11 @@ PINSMedicalL301, PINSMedicalL302, PINSMedicalL303, + PMTsEEG2102_08, + PMTsEEG2102_10, + PMTsEEG2102_12, + PMTsEEG2102_14, + PMTsEEG2102_16, default_electrode_parameters, ) from .dixi_microtechniques import ( @@ -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, @@ -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, @@ -139,6 +155,7 @@ "BostonScientificCartesiaXModel": BostonScientificCartesiaParameters, "BostonScientificCartesiaHXModel": BostonScientificCartesiaParameters, "DixiSEEGModel": DixiSEEGParameters, + "PMTsEEGModel": DixiSEEGParameters, "MedtronicModel": MedtronicParameters, "MedtronicSenSightModel": MedtronicParameters, "MicroElectrodeModel": MicroElectrodeParameters, @@ -177,6 +194,11 @@ "DixiSEEG18", "DixiSEEGModel", "DixiSEEGParameters", + "PMTsEEG2102_08", + "PMTsEEG2102_10", + "PMTsEEG2102_12", + "PMTsEEG2102_14", + "PMTsEEG2102_16", "Medtronic3387", "Medtronic3389", "Medtronic3391", diff --git a/ossdbs/electrodes/defaults.py b/ossdbs/electrodes/defaults.py index 86b3c2e..54ceaf2 100644 --- a/ossdbs/electrodes/defaults.py +++ b/ossdbs/electrodes/defaults.py @@ -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, + ), } @@ -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) diff --git a/tests/electrode_tests/test_PMTsEEG2102.py b/tests/electrode_tests/test_PMTsEEG2102.py new file mode 100644 index 0000000..28ef6af --- /dev/null +++ b/tests/electrode_tests/test_PMTsEEG2102.py @@ -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" diff --git a/tests/electrode_tests/test_electrodes.py b/tests/electrode_tests/test_electrodes.py index 392919c..b8ef440 100644 --- a/tests/electrode_tests/test_electrodes.py +++ b/tests/electrode_tests/test_electrodes.py @@ -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 = { @@ -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