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:
- mode
ModalityMode The mode for HypVINN. It should be “t1t2”.
- reg_mode
RegistrationMode The registration mode. If it is not “none”, the function will register T1 to T2 images.
- t1_path
Path The path to the T1 image.
- t2_path
Path The path to the T2 image.
- subject_dir
Path The directory of the subject.
- threads
int, 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.
- mode
- Returns:
PathThe path to the preprocessed T2 image.
- Raises:
RuntimeErrorIf 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_path
Path The path to the T1 image.
- t2_path
Path The path to the T2 image.
- output_path
Path The path to the output/registered image.
- lta_path
Path The path to the lta transform.
- registration_type
RegistrationMode, default=”coreg” The type of registration to be used. It can be either “coreg” or “robust”.
- threads
int, 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.
- t1_path
- Returns:
PathThe path to the registered T2 image.
- Raises:
RuntimeErrorIf mri_coreg, mri_vol2vol, or mri_robust_register fails to run or if they cannot be found.