pyushkevich / itksnap

ITK-SNAP medical image segmentation tool
http://www.itksnap.org
GNU General Public License v3.0
294 stars 86 forks source link

Saving Camera State? #21

Open sudomakeinstall opened 3 years ago

sudomakeinstall commented 3 years ago

Hello!

I was wondering if there is any way to save the camera state in a workspace so that the meshes in the 3D viewer window appear in the same orientation on reloading. I've tried re-orienting the camera, saving a workspace, closing ITK-Snap, and reloading the workspace, but the camera always appears in the default axis-aligned orientation on reloading (and looking at the text of the *.itksnap workspace file, I don't see anything that looks like camera coordinates). I do see that there is a struct in the codebase which can be used to save camera state...

https://github.com/pyushkevich/itksnap/blob/0c31d9c1e0027d4f08b07d14a1e1494ceb56cf6f/GUI/Renderer/Generic3DRenderer.h#L28-L35

...but as far as I can tell this is only used when synchronizing between sessions.

Is there a way to do this already? If not, would this be a welcome enhancement? If there is interest I'd be happy to attempt a pull request. By the way, I'm using 3.8.0 on osx 10.15.3.

Best, and thanks for the countless hours already poured into this excellent application.

--Davis

seirios commented 3 months ago

Hi! I've prepared a PR to save/restore the camera state to/from a file. My use case is generating 3D renders with consistent camera views, which requires saving the camera state for later reuse, and also loading a custom camera state with the desired view. The PR does not solve the issue of having this information stored in the workspace file, though. Cheers!