HypVINN.utils.preproc

HypVINN.utils.preproc.hypvinn_preproc(mode, reg_mode, t1_path, t2_path, subject_dir, threads=-1)[source]

Preprocess the input images for HypVINN.

Parameters:
modeModalityMode

The mode for HypVINN. It should be “t1t2”.

reg_modeRegistrationMode

The registration mode. If it is not “none”, the function will register T1 to T2 images.

t1_pathPath

The path to the T1 image.

t2_pathPath

The path to the T2 image.

subject_dirPath

The directory of the subject.

threadsint, default=-1

The number of threads to be used. If it is less than or equal to 0, the number of threads will be automatically determined.

Returns:
Path

The path to the preprocessed T2 image.

Raises:
RuntimeError

If the mode is not “t1t2”, or if the registration mode is not “none” and the registration fails.

HypVINN.utils.preproc.t1_to_t2_registration(t1_path, t2_path, output_path, lta_path, registration_type='coreg', threads=-1)[source]

Register T1 to T2 images using either mri_coreg or mri_robust_register.

Parameters:
t1_pathPath

The path to the T1 image.

t2_pathPath

The path to the T2 image.

output_pathPath

The path to the output/registered image.

lta_pathPath

The path to the lta transform.

registration_typeRegistrationMode, default=”coreg”

The type of registration to be used. It can be either “coreg” or “robust”.

threadsint, default=-1

The number of threads to be used. If it is less than or equal to 0, the number of threads will be automatically determined.

Returns:
Path

The path to the registered T2 image.

Raises:
RuntimeError

If mri_coreg, mri_vol2vol, or mri_robust_register fails to run or if they cannot be found.