Skip to content

Commit

Permalink
handle mosaics with no "somas" field (replaced by cell_nnn fields in …
Browse files Browse the repository at this point in the history
…some mosaic patterns"
  • Loading branch information
pbmanis committed Feb 20, 2025
1 parent 6721269 commit de518e6
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions ephys/mapanalysistools/get_markers.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,19 +165,20 @@ def get_markers(fullfile: Path, verbose: bool = True) -> dict:

# now compute distance from soma to surface marker for each soma
# this may not be appropriate for all datasets.
for i_soma, cellname in enumerate(marker_dict["somas"]):
soma_xy = marker_dict["somas"][cellname]
print("soma_xy: ", soma_xy)
if 'somas' in list(marker_dict.keys()):
for i_soma, cellname in enumerate(marker_dict["somas"]):
soma_xy = marker_dict["somas"][cellname]
print("soma_xy: ", soma_xy)

surface_xy = marker_dict["surface"]
dist = np.sqrt(
(soma_xy[0] - surface_xy[0]) ** 2
+ (soma_xy[1] - surface_xy[1]) ** 2
)
if verbose:
CP.cprint(
"c", f" {cellname:s} soma-'surface marker' distance: {dist*1e6:7.1f} um"
surface_xy = marker_dict["surface"]
dist = np.sqrt(
(soma_xy[0] - surface_xy[0]) ** 2
+ (soma_xy[1] - surface_xy[1]) ** 2
)
if verbose:
CP.cprint(
"c", f" {cellname:s} soma-'surface marker' distance: {dist*1e6:7.1f} um"
)

# if soma_xy == [] or surface_xy == []:
# if verbose:
Expand Down

0 comments on commit de518e6

Please sign in to comment.