Skip to content

Commit 5975ef2

Browse files
committed
Add electrode X/Y positions to the XML file
1 parent 4dcf5dd commit 5975ef2

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

Source/UI/NeuropixelsV1Interface.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1034,12 +1034,18 @@ void NeuropixelsV1Interface::saveParameters(XmlElement* xml)
10341034
probeViewerNode->setAttribute("apFilter", filterComboBox->getText());
10351035

10361036
XmlElement* channelsNode = xmlNode->createNewChildElement("SELECTED_CHANNELS");
1037+
XmlElement* xposNode = xmlNode->createNewChildElement("ELECTRODE_XPOS");
1038+
XmlElement* yposNode = xmlNode->createNewChildElement("ELECTRODE_YPOS");
10371039

10381040
for (int i = 0; i < settings->selectedElectrode.size(); i++)
10391041
{
10401042
int globalIndex = settings->selectedElectrode[i];
1043+
1044+
String chId = "CH" + String(i);
1045+
channelsNode->setAttribute(chId, std::to_string(globalIndex));
10411046

1042-
channelsNode->setAttribute("CH" + String(i), std::to_string(globalIndex));
1047+
xposNode->setAttribute(chId, String(settings->electrodeMetadata[globalIndex].xpos));
1048+
yposNode->setAttribute(chId, String(settings->electrodeMetadata[globalIndex].ypos));
10431049
}
10441050
}
10451051

Source/UI/NeuropixelsV2eProbeInterface.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -679,12 +679,18 @@ void NeuropixelsV2eProbeInterface::saveParameters(XmlElement* xml)
679679
probeViewerNode->setAttribute("referenceChannel", referenceComboBox->getText());
680680

681681
XmlElement* channelsNode = xmlNode->createNewChildElement("SELECTED_CHANNELS");
682+
XmlElement* xposNode = xmlNode->createNewChildElement("ELECTRODE_XPOS");
683+
XmlElement* yposNode = xmlNode->createNewChildElement("ELECTRODE_YPOS");
682684

683685
for (int i = 0; i < settings->selectedElectrode.size(); i++)
684686
{
685687
int globalIndex = settings->selectedElectrode[i];
686688

687-
channelsNode->setAttribute(String("CH" + std::to_string(i)), std::to_string(globalIndex));
689+
String chId = "CH" + String(i);
690+
channelsNode->setAttribute(chId, std::to_string(globalIndex));
691+
692+
xposNode->setAttribute(chId, String(settings->electrodeMetadata[globalIndex].xpos));
693+
yposNode->setAttribute(chId, String(settings->electrodeMetadata[globalIndex].ypos));
688694
}
689695
}
690696

0 commit comments

Comments
 (0)