Skip to content

Feature/tri proj view#392

Draft
toloudis wants to merge 22 commits into
mainfrom
feature/tri-proj-view
Draft

Feature/tri proj view#392
toloudis wants to merge 22 commits into
mainfrom
feature/tri-proj-view

Conversation

@toloudis
Copy link
Copy Markdown
Contributor

@toloudis toloudis commented Apr 10, 2026

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

  • New feature (non-breaking change which adds functionality)

Screenshots (optional):

Show-n-tell images/animations here

Keyfiles (delete if not relevant):

  1. main file/entry point
  2. other important file

Thanks for contributing!

Comment thread src/View3d.ts Outdated

// If we were in triple mode, re-enter it with the new image
if (wasTriple) {
this.image.setViewMode("TRIPLE", this.volumeRenderMode);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should be using an enum

Comment thread src/View3d.ts Outdated
Comment on lines +410 to +411
const wasTriple = this.canvas3d.getViewMode() === Axis.TRIPLE;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Dan: Weird that this needs to special-case Triple axis mode

Comment thread src/VolumeRenderImpl.ts
getIndices(): { x: number; y: number; z: number };
getVolumeSize(): Vector3;
getPhysicalSize(): Vector3;
setSliceIndex(axis: "x" | "y" | "z", index: number): void;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

const enum instead of specific strings?

Comment thread src/constants/shaders/slice.frag Outdated
} 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);
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

rename Z_SLICE now that it can represent a slice along any axis

Comment thread src/ThreeJsPanel.ts Outdated
}

orthoScreenPixelsToPhysicalUnits(pixels: number, physicalUnitsPerWorldUnit: number): number {
if (this.viewMode === Axis.TRIPLE) {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

can this be generalized better and not special-cased like this? maybe abstracted away somehow

Comment thread src/ThreeJsPanel.ts Outdated
Comment thread src/ThreeJsPanel.ts Outdated
this.orthoControlsZ.enabled = false;
this.viewMode = Axis.TRIPLE;
// triple mode has its own controller and events
this.enterTripleSliceMode();
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

could be renamed to enableTripleSliceControls?

Comment thread src/ThreeJsPanel.ts Outdated
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);
Copy link
Copy Markdown
Contributor Author

@toloudis toloudis Apr 17, 2026

Choose a reason for hiding this comment

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

can we get these to happen inside of doRender for TripleSliceVolume? instead of viewport and scissor, should we jsut give the atlas2dslices consistent transforms?

Comment thread src/ThreeJsPanel.ts Outdated
return { u, v };
}

private hitTestCrosshairLine(clientX: number, clientY: number, paneKey: "xy" | "yz" | "xz"): "u" | "v" | null {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

how can we hit test without giving threejspanel too much info about these regions?

Comment thread src/ThreeJsPanel.ts Outdated
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)));
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

should all this code only deal in uv 0-1 range values instead of whole volume pixels? (think of multiresolution changes)

toloudis and others added 2 commits April 20, 2026 09:44
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.

2 participants