PlusToolkit / PlusLib

Software library for data acquisition, pre-processing, and calibration for navigated image-guided interventions.
http://www.plustoolkit.org
Other
130 stars 102 forks source link

Extend US parameters to other devices #404

Closed adamrankin closed 5 years ago

adamrankin commented 6 years ago

With OpenCV, V4L2, VFW, and MMF devices supporting webcams, it would be nice if we could change camera parameters live like we can for US devices.

Duplicating the subclass to vtkPlusCameraDevice is fine by me, but I was wondering if we wanted to generalize vtkPlusUsDevice?

lassoan commented 6 years ago

I agree that this would make sense to have a base class for cameras (especially if we add calibration, distortion correction, etc.). I would not mix this with ultrasound imaging but have a separate base class.

adamrankin commented 6 years ago

Sounds good.

jamesobutler commented 6 years ago

It would also be nice to have a group for Tracker devices to change parameters like origin position live. We update the origin position of our absolute encoders for our motion stage after a calibration sequence using our custom wrapper around Plus.

adamrankin commented 6 years ago

Maybe vtkPlusDevice needs a PlusStatus SetParameter(const std::string& name, const std::string& value) or PlusStatus SetParameter(PLUS_DEVICE_PARAMETER parameter, const std::string& value) function that can be overridden by child classes.

adamrankin commented 5 years ago

@lassoan My preferred solution to this would be to have SetParameter in vtkPlusDevice and have the sub classes override it.

That way, we keep the unified architecture of vtkPlusDevice and each device can handle it however they choose.

Thoughts?

(I'm just thinking back as to why we merged image device and tracker device in the first place).

markasselin commented 5 years ago

I'm just about to start implementing the ability to set tracker parameters for Atracsys remotely. I like @adamrankin's idea of putting the SetParameter in vtkPlusDevice and overriding this in the derived classes - I will look into how difficult this would be to implement.

adamrankin commented 5 years ago

I am coding up the base class implementation now, will upload a PR in ~30m-1h

markasselin commented 5 years ago

Ahh, wonderful! Take your time

adamrankin commented 5 years ago

Infrastructure is available, people can add subclasses with specific behaviour as desired.