-
Notifications
You must be signed in to change notification settings - Fork 444
feat(CrosshairsTool): implement crosshairs for same-orientation viewports #2429
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
base: main
Are you sure you want to change the base?
feat(CrosshairsTool): implement crosshairs for same-orientation viewports #2429
Conversation
| filterActorUIDsToSetSlabThickness: [], | ||
| // blend mode for slabThickness modifications | ||
| slabThicknessBlendMode: Enums.BlendModes.MAXIMUM_INTENSITY_BLEND, | ||
| centerPoint: { | ||
| enabled: false, | ||
| color: 'rgba(255, 255, 0, 0.5)', | ||
| size: 2, | ||
| }, | ||
| mobile: { | ||
| enabled: false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is centerPoint removed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was an error during merging, I could re-add it again if we decide to move on with the PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think our current crosshair implementation is pretty rough, maybe one of the worst in cs3d. At the same time, I've noticed your pull request doesn't really fix the existing problems. Instead, it seems to tie the crosshair implementation more closely to the 2 and 3 viewport settings.
Generally, the crosshair shouldn't be concerned with how many viewports are displayed. It should instead calculate the distinct views and project lines from each viewport onto the others. For example, in your PR, what happens with two identical axial views and a sagittal view? Or what about four identical views?
I realize this will solve your specific use case, but I'd rather fix the crosshairs in a more practical way, not by adding more limitations to how it works. Hopefully, that makes sense.
|
@sedghi I agree, this PR only adds some additional complexity to handle the specific case of 2 or 3 viewports with the same orientation. Probably the cleanest solution (long-term) would be to have a more generic CrosshairsTool that handles >3 viewports with flexible orientations (also allowing for dynamic switching). However, I guess this would involve much more effort, and maybe even a rewrite of the current tool. As I am highly interested in an improved Crosshairs with same-orientation support, are there any plans of implementing this in the near future? Otherwise, are there any downsides of integrating this into the library until the refactoring & extension takes place? Or can we maybe modify this PR in a way that suits your plan in a better way? |
Context
So far, the CrosshairsTool was not available for viewports with the same orientation (e.g. three AXIAL / ACQUSITION).
However, it might be useful to have the crosshairs also available in these cases, as we might want to display the same position on different sequences (e.g. to find a specific component of a body part that is relatively small, like lymph nodes).
Changes & Results
For same orientation viewports, we can also render a crosshairs now. The crosshairs does not change the camera of the viewports (scroll through slices etc.), it just syncs the crosshairs between the three viewports on the current 2D (x, y) plane:
Screencast.from.2025-10-27.13-24-41.mp4
MPR works just the same as before:
Screencast.from.2025-10-27.13-23-39.mp4
Testing
packages/tools/examples/crossHairs/index.tsto render two / three viewports with the same orientation (example see below)yarn example crossHairsYou can use the following
viewportInputArray(l. 306):Checklist
PR
semantic-release format and guidelines.
Code
etc.)
Public Documentation Updates
additions or removals.
-> do we need to update the docs for this?
Tested Environment