TomographicImaging / CILViewer

A simple Viewer for 3D data built with VTK
Apache License 2.0
8 stars 6 forks source link

3D and 2D view not consistent #409

Open DanicaSTFC opened 1 month ago

DanicaSTFC commented 1 month ago

It could happen here, so maybe viewer issue https://github.com/TomographicImaging/CILViewer/blob/894fc7b44188bf3ffba0151196613b202d0c0990/Wrappers/Python/ccpi/viewer/CILViewer2D.py#L1328-L1331

Change camera view https://github.com/TomographicImaging/CILViewer/blob/894fc7b44188bf3ffba0151196613b202d0c0990/Wrappers/Python/ccpi/viewer/CILViewer.py#L546

https://github.com/TomographicImaging/CILViewer/blob/894fc7b44188bf3ffba0151196613b202d0c0990/Wrappers/Python/ccpi/viewer/CILViewer2D.py#L301-L325

Issue opened in iDVC, but needs to be resolved in the viewer. See https://github.com/TomographicImaging/iDVC/issues/240#issue-2310056037

paskino commented 1 month ago

This would change the camera elevation but, it doesn't work very well as the orientation marker doesn't get updated. See the VTK Text book


# do a full Elevation + 180 degrees
camera = vtk.vtkCamera()

camera.DeepCopy(self.getCamera())
camera.Elevation(180)

self.getRenderer().SetActiveCamera(camera)
om = self.orientation_marker.GetOrientationMarker()
om.Modified()
self.renWin.Render()
paskino commented 2 weeks ago

in the toolbar3d branch I change the position of the camera (as here) and create an animation with an orbit around the object.

Possibly what's missing is adjustCamera

https://github.com/TomographicImaging/CILViewer/blob/c40775f7afbe94729c0e970a08d687419e970014/Wrappers/Python/ccpi/viewer/CILViewer.py#L1124-L1141