recon_surf.align_seg

recon_surf.align_seg.align_flipped(seg, mid_slice=None)[source]

Registrate Left - right (make upright).

Register cortial lables

Parameters:
segsitk.Image

Segmentation Image. Should be aparc+aseg (DKT or not).

mid_sliceOptional[float]

Where the mid slice will be in upright space. Defaults to (width-1)/2.

Returns:
Tsqrt

RAS2RAS transformation matrix for registration.

recon_surf.align_seg.align_seg_centroids(seg_mov, seg_dst, label_ids=[], affine=False)[source]

Align the segmentations based on label centroids (rigid is default).

Parameters:
seg_movsitk.Image

Path to src segmentation (e.g. aparc+aseg.mgz).

seg_dstsitk.Image

Path to trg segmentation.

label_idsOptional[npt.NDArray[int]]

List of label ids to align. Defaults to [].

affinebool

True if affine should be returned. False if rigid should be returned. Defaults to False.

Returns:
T

Aligned centroids RAS2RAS transform.

recon_surf.align_seg.get_seg_centroids(seg_mov, seg_dst, label_ids=[])[source]

Extract the centroids of the segmentation labels for mov and dst in RAS coords.

Parameters:
seg_movsitk.Image

Source segmentation image.

seg_dstsitk.Image

Target segmentation image.

label_idsOptional[npt.NDArray[int]]

List of label ids to extract (Default value = []).

Returns:
centroids_mov

List of centroids of source segmentation.

centroids_dst

List of centroids of target segmentation.

recon_surf.align_seg.get_vox2ras(img)[source]

Extract voxel to RAS (affine) from sitk image.

Parameters:
segsitk.Image

Sitk Image.

Returns:
vox2ras

VOX2RAS (affine) transformation matrix.

recon_surf.align_seg.options_parse()[source]

Command line option parser.

Returns:
options

Object holding options.