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

Volume agent rendering #419

Open
wants to merge 26 commits into
base: volume-agents
Choose a base branch
from
Open

Conversation

frasercl
Copy link
Contributor

@frasercl frasercl commented Oct 11, 2024

Review size: medium (20-25min)

Resolves #406: makes volume agents render properly!

Adds some new semantics for volume agent data: if the agent has subpoints, subpoint 0 represents the time point of the volume to load and display, and the rest are indexes of channels to enable. By default, if no subpoints are included, timepoint 0 is loaded and only channel 0 is enabled.

Note that this change is accompanied by changes on the companion branch in volume-viewer, simularium-volumes. As with the previous PR in this series (#417), this branch doesn't work without the changes on that branch. (allen-cell-animated/vole-core#255 will merge those changes into the viewer proper, after which we'll be able to use a plain old npm dependency and get tests to pass here.)

Note also that I've hardcoded values for more than a few volume render settings. We may still have more semantics to figure out around whether to pick sensible defaults for these settings, or whether to add some new settings to the subpoints schema described above.

Screenshot

image

export default class VolumeModel {
// TODO what to do with this `cancelled` property? Type check fails without it.
// When should it be set, if ever; what should it be used for, if anything?
public cancelled = false;
private image?: VolumeDrawable;
private drawable?: VolumeDrawable;
Copy link
Contributor

Choose a reason for hiding this comment

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

If I recall, I think the "cancelled" property mentioned above is for when the trajectory has been changed but there is still geometry download requests in-flight. We can use cancelled to just drop the arriving stuff.

@frasercl frasercl marked this pull request as ready for review October 29, 2024 18:22
@frasercl frasercl requested a review from a team as a code owner October 29, 2024 18:22
@frasercl frasercl requested review from meganrm and tyler-foster and removed request for a team October 29, 2024 18:22
@frasercl frasercl requested a review from interim17 January 7, 2025 18:41
@frasercl frasercl requested a review from ShrimpCryptid January 7, 2025 18:44
const volume = await loader.createVolume(new LoadSpec());
const context = await this.getVolumeLoaderContext();
const loader = await context.createLoader(url);
const loadCallback = model.onChannelLoaded.bind(model);
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do you need to bind the callback here? :0

Comment on lines -7 to -12
// TEMPORARY HACK to make things typecheck. TODO remove!
import { VolumeRenderImpl } from "@aics/volume-viewer/es/types/VolumeRenderImpl";
interface TempRayMarchedVolume extends VolumeRenderImpl {
boxHelper: Box3Helper;
}

Copy link
Contributor

Choose a reason for hiding this comment

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

🎉

Comment on lines +93 to +94
const min = histo.findBinOfPercentile(0.5);
const max = histo.findBinOfPercentile(0.983);
Copy link
Contributor

Choose a reason for hiding this comment

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

I saw the note you had in the PR description, maybe tag all the hardcoded values with a TODO so they're easier to track down? Totally optional

if (isOrtho) {
this.drawable.setOrthoScale(orthoScale);
}
this.drawable.setResolution(width, height);
Copy link
Contributor

Choose a reason for hiding this comment

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

What does setting the resolution here do?

@@ -161,7 +166,7 @@ class VisGeometry {
public lightsGroup: Group;
public agentPathGroup: Group;
public instancedMeshGroup: Group;
public tempVolumeGroup: Group; // TODO remove
public volumeGroup: Group; // TODO remove
Copy link
Contributor

Choose a reason for hiding this comment

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

Is the TODO still needed?

Copy link
Contributor

@interim17 interim17 left a comment

Choose a reason for hiding this comment

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

Commenting to note the chat we had about import issues yesterday, mostly so you can re-request me when you want eyes on this again.

@meganrm meganrm removed their request for review January 13, 2025 20:50
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