Real-time mesh deformation within PLUS Server

Hello :waving_hand:,
I’ve been using PLUS Server for generating real-time ultrasound in a Unity simulation. I know the models specified in the configuration file are loaded once at the start into PLUS.
I’m wondering if it would be possible to deform those models based on interactions with other objects in order to have the corresponding ultrasound images deform, for example in the case of compressing vessel.

Hi Naoimi - If you are using something like the script we worked on at Project Week you can try just applying the grid transform to the ultrasound volume generated by PLUS. It should deform like the models and then you just need to extract the resampled image to send to unity (i.e. by hardening the transform to the volume each timestep).

Hi Steve,
Thanks for your reply.
In that case, what would be the best way to access the ultrasound volume generated by PLUS? As far as I understand, both Slicer and Unity as clients and can’t modify the generated image directly. That would require modifying and using a custom build version of PLUS, no?

Hi Naomi - I think the easiest (although I haven’t tried it) would be to get PLUS to give you the US image in it’s original coordinates (the ones that align with the undeformed models) and then apply the same transform to a copy of the US volume and harden the transform, which means resample the image through the transform when it’s a nonlinear transform. Then you should be able to use that resample image as-is to match the deforming models.