fetalbrain.tedsnet_multi.hemisphere_detector module

fetalbrain.tedsnet_multi.hemisphere_detector.detect_side(aligned_scan: Tensor, model: Module, from_atlas: bool = True) tuple[Literal[0, 1], float][source]

_summary_

Takes as input a scan aligned (no scaling) to the atlas or bean coordinate system.

Parameters:
  • aligned_scan – [1,1, H, W, D]

  • model – _description_

Returns:
  • pred – 0 for left, 1 for right

  • probs – probability of the prediction

fetalbrain.tedsnet_multi.hemisphere_detector.load_sidedetector_model(model_path: Path | None = None) Module[source]

Load the trained side detection model

Parameters:

model_path – path to the trained model weights. Defaults to None.

Returns:

model – ResNet model with trained weights loaded