HypVINN.data_loader.data_utils¶
- HypVINN.data_loader.data_utils.hypo_map_label2subseg(mapped_subseg)[source]¶
Perform look-up table mapping from label space to subseg space.
This function is used to perform a look-up table mapping from label space to subseg space.
- Parameters:
- mapped_subseg
np.ndarrayofintegers The input array in label space to be mapped to subseg space.
- mapped_subseg
- Returns:
np.ndarrayofintegersThe mapped array in subseg space.
- HypVINN.data_loader.data_utils.hypo_map_prediction_sagittal2full(prediction_sag)[source]¶
Remap the prediction on the sagittal network to full label space.
This function is used to remap the prediction on the sagittal network to the full label space used by the coronal and axial networks.
- Parameters:
- prediction_sag
np.ndarrayofintegers The sagittal prediction in label space to be remapped to full label space.
- prediction_sag
- Returns:
np.ndarrayofintegersThe remapped prediction in full label space.
- HypVINN.data_loader.data_utils.hypo_map_subseg_2_fsseg(subseg, reverse=False)[source]¶
Remap HypVINN internal labels to FastSurfer Labels and vice versa.
This function is used to remap HypVINN internal labels to FastSurfer Labels and vice versa. If the
reverseparameter is set to False, the function will map HypVINN labels to FastSurfer labels. If it is set to True, the function will map FastSurfer labels to HypVINN labels.- Parameters:
- subseg
np.ndarrayofintegers The input array with HypVINN or FastSurfer labels to be remapped.
- reverse
bool, default=False A flag to determine the direction of the remapping. If False, remap HypVINN labels to FastSurfer labels. If True, remap FastSurfer labels to HypVINN labels.
- subseg
- Returns:
np.ndarrayofintegersThe remapped array with FastSurfer or HypVINN labels.
- HypVINN.data_loader.data_utils.rescale_image(img_data)[source]¶
Rescale the image data to the range [0, 255].
This function rescales the input image data to the range [0, 255].
- Parameters:
- img_data
np.ndarray The image data to rescale.
- img_data
- Returns:
np.ndarrayThe rescaled image data.
- HypVINN.data_loader.data_utils.transform_axial2coronal(vol, axial2coronal=True)[source]¶
Transforms a volume into the coronal axis and back.
This function is used to transform a volume into the coronal axis and back. The transformation is done by moving the axes of the volume. If the
axial2coronalparameter is set to True, the function will transform from axial to coronal. If it is set to False, the function will transform from coronal to axial.- Parameters:
- vol
np.ndarray The image volume to transform.
- axial2coronal
bool,optional A flag to determine the direction of the transformation. If True, transform from axial to coronal. If False, transform from coronal to axial. (Default: True).
- vol
- Returns:
np.ndarrayThe transformed volume.
- HypVINN.data_loader.data_utils.transform_axial2sagittal(vol, axial2sagittal=True)[source]¶
Transforms a volume into the sagittal axis and back.
This function is used to transform a volume into the sagittal axis and back. The transformation is done by moving the axes of the volume. If the
axial2sagittalparameter is set to True, the function will transform from axial to sagittal. If it is set to False, the function will transform from sagittal to axial.- Parameters:
- vol
np.ndarray The image volume to transform.
- axial2sagittal
bool, default=True A flag to determine the direction of the transformation. If True, transform from axial to sagittal. If False, transform from sagittal to axial. (Default: True).
- vol
- Returns:
np.ndarrayThe transformed volume.