Feature/tri proj view#392
Conversation
|
|
||
| // If we were in triple mode, re-enter it with the new image | ||
| if (wasTriple) { | ||
| this.image.setViewMode("TRIPLE", this.volumeRenderMode); |
There was a problem hiding this comment.
Should be using an enum
| const wasTriple = this.canvas3d.getViewMode() === Axis.TRIPLE; | ||
|
|
There was a problem hiding this comment.
Dan: Weird that this needs to special-case Triple axis mode
| getIndices(): { x: number; y: number; z: number }; | ||
| getVolumeSize(): Vector3; | ||
| getPhysicalSize(): Vector3; | ||
| setSliceIndex(axis: "x" | "y" | "z", index: number): void; |
There was a problem hiding this comment.
const enum instead of specific strings?
| } else if (viewAxis == 2) { | ||
| // XZ view: UV.x -> X, UV.y -> Z, slice along Y | ||
| // Z_SLICE is a Y voxel index; normalize by volumeSize.y | ||
| float yNorm = (volumeSize.y <= 1.0) ? 0.0 : float(Z_SLICE) / (volumeSize.y - 1.0); |
There was a problem hiding this comment.
rename Z_SLICE now that it can represent a slice along any axis
| } | ||
|
|
||
| orthoScreenPixelsToPhysicalUnits(pixels: number, physicalUnitsPerWorldUnit: number): number { | ||
| if (this.viewMode === Axis.TRIPLE) { |
There was a problem hiding this comment.
can this be generalized better and not special-cased like this? maybe abstracted away somehow
| this.orthoControlsZ.enabled = false; | ||
| this.viewMode = Axis.TRIPLE; | ||
| // triple mode has its own controller and events | ||
| this.enterTripleSliceMode(); |
There was a problem hiding this comment.
could be renamed to enableTripleSliceControls?
| const [faceW, faceH] = faceDims[i]; | ||
|
|
||
| this.renderer.setViewport(rect.x, rect.y, rect.w, rect.h); | ||
| this.renderer.setScissor(rect.x, rect.y, rect.w, rect.h); |
There was a problem hiding this comment.
can we get these to happen inside of doRender for TripleSliceVolume? instead of viewport and scissor, should we jsut give the atlas2dslices consistent transforms?
| return { u, v }; | ||
| } | ||
|
|
||
| private hitTestCrosshairLine(clientX: number, clientY: number, paneKey: "xy" | "yz" | "xz"): "u" | "v" | null { |
There was a problem hiding this comment.
how can we hit test without giving threejspanel too much info about these regions?
| switch (pane) { | ||
| case "xy": | ||
| this.tripleSliceSource.setSliceIndex("x", Math.round(uv.u * (volSize.x - 1))); | ||
| this.tripleSliceSource.setSliceIndex("y", Math.round(uv.v * (volSize.y - 1))); |
There was a problem hiding this comment.
should all this code only deal in uv 0-1 range values instead of whole volume pixels? (think of multiresolution changes)
# Conflicts: # src/ThreeJsPanel.ts
Problem
Adding a triple-projection view to vole-core, with its own mouse interaction mode in-viewport.
allen-cell-animated/vole-app#376
Solution
triple projection is centered in viewport. side projections are to top and right.
Shows a single slice along each of x,y,z axis.
Interactive crosshairs are in white and can be dragged one at a time. Double-click to jump both crosshairs to the click point.
Type of change
Screenshots (optional):
Show-n-tell images/animations here
Keyfiles (delete if not relevant):
Thanks for contributing!