Skip to content

Method to return the original probe #3498

Closed

Description

@h-mayorquin

As I am taking a look I realize that the get_probe method returns a dummy probe from the contact vector:

def get_probe(self):
probes = self.get_probes()
assert len(probes) == 1, "there are several probe use .get_probes() or get_probegroup()"
return probes[0]
def get_probes(self):
probegroup = self.get_probegroup()
return probegroup.probes
def get_probegroup(self):
arr = self.get_property("contact_vector")
if arr is None:
positions = self.get_property("location")
if positions is None:
raise ValueError("There is no Probe attached to this recording. Use set_probe(...) to attach one.")
else:
warn("There is no Probe attached to this recording. Creating a dummy one with contact positions")
probe = self.create_dummy_probe_from_locations(positions)
# probe.create_auto_shape()
probegroup = ProbeGroup()
probegroup.add_probe(probe)
else:
probegroup = ProbeGroup.from_numpy(arr)
for probe_index, probe in enumerate(probegroup.probes):
contour = self.get_annotation(f"probe_{probe_index}_planar_contour")
if contour is not None:
probe.set_planar_contour(contour)
return probegroup

I am looking at the set_probe and I don't think we save the probe as an object at all. Can I get it? Could we add something like that?

Activity

  1. samuelgarcia commented on Oct 23, 2024

    @samuelgarcia
    Member

    by design we do not have the probe object attached.
    The idea was to manipulate probe using the contact_vector.

  2. alejoe91 commented on Nov 5, 2024

    @alejoe91
    Member

    @h-mayorquin we store alle the probe metadata in probe info. Maybe the get_probe should add these metadata to the returned probe object.

    The returned object would not be the original one, but it would be a clone with proper name, manufacturer, model, contour, etc

  3. h-mayorquin commented on Nov 5, 2024

    @h-mayorquin
    ContributorAuthor

    I think that @alejoe91 sounds like a good compromise. It should be a clone of the original probe, right?

  4. zm711 commented on Jul 7, 2026

    @zm711
    Member

    So this is closed by #4465?

  5. h-mayorquin commented on Jul 8, 2026

    @h-mayorquin
    ContributorAuthor

    Yes, this is not necessary anymore, now that we have the probes and propagate the annotations on it I can get the manufacturer and the probe model to get the reconstruct the original probe if necessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    probeinterfaceRelated to probeinterfacequestionGeneral question regarding SI

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions