scikit-surgerytorch

Stereo Reconstruction

High Resolution Stereo

Module to implement Hierarchical Deep Stereo Matching on High Resolution Images network.

class sksurgerytorch.models.high_res_stereo.HSMNet(max_disp: int = 255, entropy_threshold: float = -1, level: int = 1, scale_factor: float = 0.5, weights=None)[source]

Class to encapsulate network form ‘Hierarchical Deep Stereo Matching on High Resolution Images’.

Thanks to Gengshang Yang, for their network implementation.

Parameters:
  • max_disp – Maximum number of disparity levels
  • entropy_threshold – Pixels with entropy above this value will be ignored in the disparity map. Disabled if set to -1.
  • level – Set to 1, 2 or 3 to trade off quality of depth estimation against runtime. 1 = best depth estimation, longer runtime, 3 = worst depth estimation, fastest runtime.
  • scale_factor – Images can be resized before passing to the network, for perfomance impromvents. This sets the scale factor.
  • weights – Path to trained model weights (.tar file)
predict(left_image: numpy.ndarray, right_image: numpy.ndarray) → numpy.ndarray[source]

Predict disparity from a pair of stereo images.

Parameters:
  • left_image (np.ndarray) – Left stereo image, 3 channel RGB
  • right_image (np.ndarray) – Right stero image, 3 channel RGB
Returns:

Predicted disparity, grayscale

Return type:

np.ndarray

sksurgerytorch.models.high_res_stereo.run_hsmnet_model(max_disp, entropy_threshold, level, scale_factor, weights, left_image, right_image, output_file)[source]

This is for the command line entry point

class sksurgerytorch.models.high_res_stereo.toTensorLegacy[source]

.

Non Rigid Registration

Volume 2 Surface CNN

V2SNet Model Impementation

class sksurgerytorch.models.volume_to_surface.Volume2SurfaceCNN(mask: bool = True, weights: str = None, grid_size: int = 64)[source]

Class to encapsulate network form ‘Non-Rigid Volume to Surface Registration using a Data-Driven Biomechanical Model’.

Thanks to Micha Pfieffer, for their network implementation.

Parameters:
  • mask (bool) – If true, use masking
  • weights (str) – Path to trained model weights (.tar file)
predict(preoperative: numpy.ndarray, intraoperative: numpy.ndarray) → numpy.ndarray[source]

Predict the displacement field between model and surface.

Parameters:
  • preoperative (np.ndarray) – Preoperative surface/point cloud
  • intraoperative (np.ndarray) – Intraoperative surface/point cloud
Returns:

Displacement field

Return type:

np.ndarray