Setup camera for slice view.

I’m trying to use the code from the paintwidget example, but when I try different dicoms, slices are upside-down sometimes.

How we should setup camera’s viewUp or directionOfProjection, etc from the imageData?

Thanks a lot.

you can modify the imagedata direction. However I suggest you preserve the original direction and modify the camera instead. There are functions such as setViewUp, setPosition, setFocalPoint

Thanks but how I can calculate the values for the camera?

you need to look at your imagedata origin, dimensions, scaling and orientation.