Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Also show measured distances in vx (in addition to nm) #5240

Merged
merged 7 commits into from
Mar 15, 2021

Conversation

philippotto
Copy link
Member

@philippotto philippotto commented Mar 5, 2021

Todo

  • also add to other measurement tools (via right click, for all trees etc etc)
  • clean up so that there's no need to measure the tree twice (for nm and for vx)

URL of deployed dev instance (used for testing):

  • https://___.webknossos.xyz

Steps to test:

  • use the following different measurement "tools":
    • tree-specific menu in trees-tab to measure tree length
    • "measure length of all skeletons" in trees tab
    • shift-rightclick a node and select "path length of this tree"
    • shift-rightclick a node and select "path length to this node"
    • shift-rightclick a node and see the bottom line of the context menu which shows the distance
    • shift-rightclick some position and see the bottom line of the context menu which shows the distance
  • in all of the above cases, the distance should be shown in nm and in vx

Issues:


@philippotto philippotto self-assigned this Mar 5, 2021
/**
* Measures the length of the given tree and returns the length in nanometer and in voxels.
*/
measureTreeLength(treeId: number): [number, number] {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes to the api's interface are a bit unfortunate. The probability that someone uses this feature is probably very low and the effort to fix it is quite small. This is why I don't want to bump the api version (which is quite a bit of overhead for us and also for our users which have to check how to upgrade). This is a good example why our current API versioning is sub-ideal :/

Do you agree with this approach, @MichaelBuessemeyer and @daniel-wer? Alternatively, I could keep the old methods and add measureTreeLengthInNmAndVx, measureAllTrees InNmAndVx and measurePathLengthBetweenNodesInNmAndVx. However, that's also quite ugly..

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about a third variant:

  1. Rename measureTreeLength to measureTreeLengthWithVX or so.
  2. And just call this method in measureTreeLength and just return the first value. This should match the interface of the old API right?

You can do the same steps for measurePathLengthBetweenNodes.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nevertheless, I think your solution is fine. You can go ahead and merge this PR if you are against my proposed variant.

Users that would have to adapt their code should be able to handle this small interface change 👍

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about a third variant:

Rename measureTreeLength to measureTreeLengthWithVX or so.
And just call this method in measureTreeLength and just return the first value. This should match the interface of the old API right?

Yes, that would also work (and is kind of what I meant with my suggestion to have an additional method à la measureTreeLengthInNmAndVx). The one thing which bothers me here is the suboptimal naming of the methods (the old method is limited to nm, but would need to keep its name, and the new method is more powerful but would need to have a more specific name). However, I'm not completely against it. Let's wait for a third opinion :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seeing that this method has only existed for a couple of months and its addition wasn't announced, I would also think usage is probably extremely small if not zero. You could include this change in the "breaking" section of the changelog :)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could include this change in the "breaking" section of the changelog :)

Good idea! I also agree with your risk assessment so this PR should be good to go now 🕺

@philippotto philippotto changed the title [WIP] also show measured distance in vx Also show measured distances in vx (in addition to nm) Mar 9, 2021
Copy link
Contributor

@MichaelBuessemeyer MichaelBuessemeyer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM except for one small thingy. 🚀 🧊

"tracing.tree_length_notification": (treeName: string, length: string) =>
`The tree ${treeName} has a total path length of ${length}.`,
"tracing.tree_length_notification": (treeName: string, length: string, lengthInVx: string) =>
`The tree ${treeName} has a total path length of ${length} (${lengthInVx})`,
Copy link
Contributor

@MichaelBuessemeyer MichaelBuessemeyer Mar 9, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you intentionally remove the "." at the end or was this just by accident? I think a dot at the end makes sense as this is a complete sentence :)

@philippotto philippotto enabled auto-merge (squash) March 10, 2021 08:34
@philippotto philippotto merged commit ee5dbc7 into master Mar 15, 2021
@philippotto philippotto deleted the distance-in-vx branch March 15, 2021 12:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants