fixing mapping of syn loc from BMTK to Arbor#4
Merged
Conversation
- moved and rotated Arbor's morph to match BMTK coordinates
| ModelType::Point { .. } => String::from("point"), | ||
| ModelType::Virtual { .. } => String::from("virtual"), | ||
| }; | ||
| let (pos_x, pos_y, pos_z) = node.position; |
Owner
There was a problem hiding this comment.
You're unpacking a tuple here, just to repack the components a few lines down.
| } | ||
|
|
||
| // Extract position coordinates (x, y, z) | ||
| let pos_x = if let Some(xs) = group.custom.get("x") { |
Owner
There was a problem hiding this comment.
Could be written bit more concisely by using a closure:
let get_coord = |c: &str| -> f64 {
if let Some(cs) = group.custom.get(c) {
cs[group_index]
} else if let Some(Attribute::Float(c)) = node_type.attributes().get(c) {
*c
} else {
0.0 // default position
}
};and then using that for the three axes.
| 0.0 // default position | ||
| }; | ||
|
|
||
| // Extract rotation angles |
| for x, y, z, synapse, params, tag in self.gid_to_syn[gid]: | ||
| loc, _ = pwl.closest(x, y, z) | ||
| arborxyz = pwl.at(loc) | ||
| print(f"Placing synapse {synapse} at {loc}: {x},{y},{z} vs. {arborxyz}") |
Owner
There was a problem hiding this comment.
Do we want to keep this for now or is it purely debug info?
Collaborator
Author
There was a problem hiding this comment.
It's purely debug info. I'll remove it, and we can add it locally when needed.
Owner
|
Hey @beaherrera, thanks, I left a few mostly stylistic comments but otherwise good to merge. |
Collaborator
Author
|
Thank you, @thorstenhater! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Modifications: