fetalbrain.tedsnet_multi.teds_multi_segm module¶
How to apply our segmentation method
- fetalbrain.tedsnet_multi.teds_multi_segm.generate_multiclass_prediction(prediction: Tensor) ndarray[source]¶
Convert the TEDS-multiclass output into a multiclass segmentation mask
Note: I don’t think this works for batches atm :param prediction: prediction from TEDS model of size [B, 10, H, W, D]
- Returns:
combined_pred – multiclass segmentation mask of size [H, W, D]
- fetalbrain.tedsnet_multi.teds_multi_segm.get_prior_shape_sa(sd: Literal[0, 1]) Tensor[source]¶
Get the prior paired with each week and side
- Parameters:
sd – which side to get the prior shape for, either 0 or 1
- Returns:
prior_shape – tensor containing the prior shape
Example
>>> prior_shape = get_prior_shape_sa(0)
- fetalbrain.tedsnet_multi.teds_multi_segm.load_tedsmulti_model(model_path: Path | None = None) TEDS_Net[source]¶
Load the trained multistructure segmentation model
- Parameters:
model_path – path to the trained model weights
- Returns:
model – segmentation model with trained weights loaded
Example
>>> model = load_tedsmulti_model()