Kitware / VolView

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

Toggle camera reset #638

Open lchauvin opened 2 months ago

lchauvin commented 2 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 2 months ago

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

lchauvin commented 2 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 2 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 2 months ago

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

PaulHax commented 2 months ago

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

floryst commented 2 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 1 month ago

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

floryst commented 1 month 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 5 days ago

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

lchauvin commented 5 days ago

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

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

The property has been removed I believe.