CerebNet.apply_warp

CerebNet.apply_warp.main(img_path, lbl_path, warp_path, result_path, patch_size)[source]

Load, warp, crop, and save both an image and its corresponding label based on a given warp field.

Parameters:
img_pathstr

Path to the T1-weighted MRI image to be warped.

lbl_pathstr

Path to the label image corresponding to the T1 image, to be warped similarly.

warp_pathstr

Path to the warp field file used to warp the images.

result_pathstr

Directory path where the warped and cropped images will be saved.

patch_sizetuple of int

The dimensions (height, width, depth) cropped images after warping.

CerebNet.apply_warp.save_nii_image(img_data, save_path, header, affine)[source]

Save an image data array as a NIfTI file.

Parameters:
img_datandarray

The image data to be saved.

save_pathstr

The path (including file name) where the image will be saved.

headernibabel.Nifti1Header

The header information for the NIfTI file.

affinendarray

The affine matrix for the NIfTI file.