Skip to content

Commit

Permalink
prevents weighting index outside the atlas
Browse files Browse the repository at this point in the history
  • Loading branch information
PolarBean committed Apr 26, 2023
1 parent 0ed432b commit 3d0f302
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions DeepSlice/coord_post_processing/angle_methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ def propagate_angles(df, method, species):
DV_angle, ML_angle = get_mean_angle(
DV_angle_list, ML_angle_list, method, depths, species
)
print(f"DV angle: {DV_angle}\nML angle: {ML_angle}")
# adjust the angles for each section in the dataset
df = set_angles(df, DV_angle, ML_angle)
return df
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ def rotation_around_axis(axis, angle):
def make_gaussian_weights(size):
x = np.linspace(-np.pi, np.pi, size)
weights = np.exp(-(x ** 2) / 2) / np.sqrt(2 * np.pi)
weights[weights>size-1] = size-1
weights[weights<0] = 0
return weights


Expand Down
3 changes: 2 additions & 1 deletion DeepSlice/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,11 @@ def __init__(self, species):

def predict(
self,
image_directory: str,
image_directory: str = None,
ensemble: bool = None,
section_numbers: bool = True,
legacy_section_numbers=False,
image_list = None
):
"""predicts the atlas position for a folder full of histological brain sections
Expand Down
1 change: 1 addition & 0 deletions unfinished_files.json

Large diffs are not rendered by default.

0 comments on commit 3d0f302

Please sign in to comment.