-
Notifications
You must be signed in to change notification settings - Fork 0
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
base: volume-agents
Are you sure you want to change the base?
Conversation
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; |
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.
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.
…ium/simularium-viewer into feature/volume-rendering
const volume = await loader.createVolume(new LoadSpec()); | ||
const context = await this.getVolumeLoaderContext(); | ||
const loader = await context.createLoader(url); | ||
const loadCallback = model.onChannelLoaded.bind(model); |
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 do you need to bind the callback here? :0
// TEMPORARY HACK to make things typecheck. TODO remove! | ||
import { VolumeRenderImpl } from "@aics/volume-viewer/es/types/VolumeRenderImpl"; | ||
interface TempRayMarchedVolume extends VolumeRenderImpl { | ||
boxHelper: Box3Helper; | ||
} | ||
|
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.
🎉
const min = histo.findBinOfPercentile(0.5); | ||
const max = histo.findBinOfPercentile(0.983); |
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 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); |
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.
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 |
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.
Is the TODO still needed?
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.
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.
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