How, from python-scritps, to trigger the click-function of "center of the 3D view on the scene"?

Hi Good morning, @lassoan
Here I show what I do using screen shots:

  1. load a grey image and its label-like image
    image
  2. With a modified “segment Editor”, I use “threshold” to have segments from the label-like image.
    image
  3. Click “Show 3D”
    for the Step-3, I would like to see 3D-view ready for my movie right away after my clicking, but right now I do not see anything inside the view1 (3D). So have to (A) click that “Center the 3D view on the scene”
    image
    and then I have to (B) scroll the mouse middle-button to zoom-in to see my segments

    So in my mind I would like to get (A) and (B) done by scripts. My question is how to get (A) and (B) using python codes.
    Thanks a lot.
    Best,
    Aiden