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

Toggle camera reset #638

Open
lchauvin opened this issue Aug 12, 2024 · 10 comments
Open

Toggle camera reset #638

lchauvin opened this issue Aug 12, 2024 · 10 comments

Comments

@lchauvin
Copy link
Contributor

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
Copy link
Collaborator

floryst commented Aug 12, 2024

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

@lchauvin
Copy link
Contributor Author

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
Copy link
Contributor Author

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
Copy link
Contributor Author

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

@PaulHax
Copy link
Collaborator

PaulHax commented Aug 21, 2024

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

@floryst
Copy link
Collaborator

floryst commented Aug 26, 2024 via email

@lchauvin
Copy link
Contributor Author

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

@floryst
Copy link
Collaborator

floryst commented Sep 10, 2024

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
Copy link
Contributor

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

@lchauvin
Copy link
Contributor Author

lchauvin commented Oct 23, 2024

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

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

The property has been removed I believe.

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

No branches or pull requests

4 participants