Skip to content

Commit

Permalink
Minor tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
StephenThornquist committed May 28, 2024
1 parent 4352312 commit 107c234
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# SiffRoi

This package needs a little more attention... I wrote it
when I was a much less experienced programmer, and it certainly
has some obvious issues in implementation.

TODO:
- Rework `UsesReferenceFramesMixin` to make it opt-out: if
there's no reference frames, it can use the `PHOTON_COUNTS`
Expand Down
10 changes: 8 additions & 2 deletions siffroi/protocerebral_bridge/rois/mustache.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Optional
from typing import Optional, List

import numpy as np

Expand Down Expand Up @@ -42,7 +42,6 @@ class GlobularMustache(ROI):

SAVE_ATTRS = [
'view_direction',
'phases',
'mirrored'
]

Expand Down Expand Up @@ -108,6 +107,13 @@ def segment(self) -> None:
def glomeruli(self):
return self.subROIs

@property
def phases(self)->List[float]:
return [
x.pseudophase
for x in self.subROIs
]

def sort_glomeruli_by_phase(self):
"""
Sorts glomeruli by pseudophase
Expand Down
6 changes: 3 additions & 3 deletions siffroi/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ def nth_largest_shape_in_list(
raise ValueError("No suitable shapes provided")
if (n > len(shapes)) or (n < 1):
raise ValueError(
f"n must be between 1 and the number of shapes provided." +
"Requested {n}-largest of {len(shapes)} shapes"
"n must be between 1 and the number of shapes provided." +
f"Requested {n}-largest of {len(shapes)} shapes"
)

if all([shape.dtype == bool for shape in shapes]):
Expand Down Expand Up @@ -304,7 +304,7 @@ def walk_along_polygon(

# walk until you hit one of the end rays. If you started on one of the end rays, great
# that means you skip this part and you just grab the end ray
while not (curr_idx in end_vector_idxs):
while curr_idx not in end_vector_idxs:
# if direction is positive, then curr_idx+1 is the point to add to the list
# if direction is negative, then curr_idx is the point to add
encountered_points += [polygon_points[(curr_idx +(direction>0))%npoints]]
Expand Down

0 comments on commit 107c234

Please sign in to comment.