Using getImageCropped function in PyAutoscoper. Getting truncated/empty data

I’m trying to use getImageCropped from PyAutoscoper to extract the cropped DRR image of a volume at a given pose. My setup works fine otherwise – getPose, getNCC, optimizeFrame, and trackingDialog all work correctly. This is the output i am getting:

The width and height (1760x1760) look correct, but the byte array is only 1015 bytes long and entirely zeros. For a 1760x1760 image I’d expect significantly more data.

  1. What is getImageCropped supposed to return exactly? The docstring says list[float] but it actually returns [width, height, raw_bytes]. What format/dtype is the image data (float32, uint8, RGB, grayscale)?
  2. Is there another recommended way to programmatically extract DRR or radiograph images from Autoscoper?

Thanks for the help!

Hi Prabhroop,

My experience with using socket controls for SlicerAutoscoper has been limited to Matlab. I don’t believe there is an equivalent function, so I can’t answer your questions presently. However, this is something I can look into and get back to you on.

Thank you,

John

Hi John,

Just following up on this, any updates on the socket controls on the Python side?

Thanks,

Prabhroop

Hi Prabhroop,

I did test the Python socket controls, and got the same results that you did. Troubleshooting this is beyond my expertise, so I have elevated this issue. There was a similar function in the documentation for the Matlab socket controls; however, this function was never fully implemented. It is possible that the Python socket function and other socket controls were not fully implemented.

Thank you,

John