Kitware / VolView

Kitware VolView: an all-in-one radiological viewer!
https://volview.kitware.com
Apache License 2.0
186 stars 61 forks source link

Toggle camera reset #638

Open lchauvin opened 3 months ago

lchauvin commented 3 months ago

Hello,

I saw that there is a variable to turn off the camera reset, but there is no UI.

I'm planning to add a toggle button to the settings to turn on / off the automatic camera reset.

Any objection or comments ?

floryst commented 3 months ago

Are you referring to resizeToFit? If so, sure. Having a setting to toggle its functionality is fine by me.

lchauvin commented 3 months ago

in vtkSliceView:

interface Props {
  viewId: string;
  imageId: Maybe<string>;
  viewDirection: LPSAxisDir;
  viewUp: LPSAxisDir;
  disableAutoResetCamera?: boolean;
}

There is a disableAutoResetCamera but there is not UI to toggle it.

lchauvin commented 3 months ago

What is the difference between disabledAutoResetCamera in VtkSliceView, autoFit in useAutoFitState and noAutoReset (that I don't really understand where it's defined / updated) in VtkSliceView:

watchImmediate([disableAutoResetCamera, viewID, imageID], ([noAutoReset]) => {
  if (noAutoReset) return;
  resetCamera();
});
lchauvin commented 3 months ago

Should I create a new useAutoResetCameraState file, or should I use the resizeToFit variable from useAutoFitState ?

PaulHax commented 3 months ago

Looks like the useAutoFitState is VtkSliceView internal detail. disabledAutoResetCamera camera looks like a winner.

floryst commented 3 months ago

Indeed, you just want "disableAutoResetCamera" since noAutoReset is just the watched value of the former variable.

On August 21, 2024 7:32:11 PM UTC, Paul Elliott @.***> wrote:

Looks like the useAutoFitState is VtkSliceView internal detail. disabledAutoResetCamera camera looks like a winner.

-- Reply to this email directly or view it on GitHub: https://github.com/Kitware/VolView/issues/638#issuecomment-2302866521 You are receiving this because you commented.

Message ID: @.***>

lchauvin commented 2 months ago

Is it a property that should be in CameraConfig (for each combination of view / data), or intrinsic to the camera properties ?

floryst commented 2 months ago

That's just a property exposed through the component. Right now we can just use a global toggle for that behavior, unless there are actual use-cases for having that toggle exist per-view/data combination.

Jackie733 commented 1 month ago

So now in vtkSliceView file, the 'disableAutoResetCamera' property is useless or deprecated?

lchauvin commented 1 month ago

No, but it's coming from a pinia store now:

const { disableCameraAutoReset } = storeToRefs(useViewCameraStore());

The property has been removed I believe.