Skip to content

Commit

Permalink
Rot representation can appears to be working
Browse files Browse the repository at this point in the history
  • Loading branch information
Hjorthmedh committed Oct 16, 2023
1 parent 8c8c6eb commit cd93552
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions snudda/place/bend_morphologies.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,19 +154,7 @@ def apply_rotation(self, morphology: MorphologyData, rotation_representation):
return_last_direction=True,
include_parent_point=include_parent_point)

#if include_parent_point:
try:
new_coords[section.point_idx, :3] = coords
except:
import traceback
print(traceback.format_exc())
import pdb
pdb.set_trace()
#else:
# new_coords

#import pdb
#pdb.set_trace()
new_coords[section.point_idx, :3] = coords

for child_id, child_type in section.child_section_id.T:
parent_direction[child_id, child_type] = (last_dir, coords[-1, :3])
Expand Down Expand Up @@ -247,7 +235,7 @@ def coordinate_representation(self, rotation_representation,
return coords


if __name__ == "__main__":
def test_rotation_representation():

file_path = "../data/neurons/striatum/dspn/str-dspn-e150602_c1_D1-mWT-0728MSN01-v20190508/WT-0728MSN01-cor-rep-ax.swc"

Expand All @@ -261,5 +249,17 @@ def coordinate_representation(self, rotation_representation,
rot_rep = bm.get_full_rotation_representation(morphology=md)
coords = bm.apply_rotation(morphology=md, rotation_representation=rot_rep)

if not (np.abs(md.geometry[:, :3] - coords) < 1e-10).all():
print(f"Geometry mismatch, problem with representation.")
import pdb
pdb.set_trace()
else:
print(f"Geometry matches")


if __name__ == "__main__":

test_rotation_representation()

import pdb
pdb.set_trace()

0 comments on commit cd93552

Please sign in to comment.