omni.io#
Read/write functions for various omni outputs.
Functions
|
Converts input affine file to output affine file of another type. |
Converts framewise affine file to rigid body. |
|
|
Parse the interaction model input. |
|
Conveinence function for loading two images (target/source). |
|
Loads affine file from disk. |
|
Loads the afni affine matrix file. |
|
Loads in a framewise affine from afni |
|
Read omni format affine matrix from disk. |
|
Write affine file. |
|
Writes an afni affine matrix file to disk. |
|
Writes fsl format affine matrix to disk. |
|
Writes omni format affine matrix to disk. |
|
Writes rigid body params to disk. |
|
Writes regression parameters to disk. |
- omni.io.convert_affine_file(output: str, filename: str, output_atype: str, invert: bool = False, target: Optional[str] = None, source: Optional[str] = None) None [source]#
Converts input affine file to output affine file of another type.
- Parameters:
- output: str
Path/name of output affine file.
- filename: str
Affine file to convert.
- output_atype: str
Type of affine to output (omni/afni/fsl).
- invert: bool
Controls whether the affine should be inverted.
- target: str
Path to target image affine is transformed to (required for fsl conversion).
- source: str
Path to source image affine is applying transform to (required for fsl conversion).
- omni.io.convert_framewise_affine_to_rigid_body(output: str, filename: str) None [source]#
Converts framewise affine file to rigid body.
- Parameters:
- output: str
Path/name of output rigid body parames file.
- filename: str
Affine file to convert.
- omni.io.load_target_source(target: str, source: str) Tuple[Nifti1Image, Nifti1Image] [source]#
Conveinence function for loading two images (target/source).
- omni.io.read_affine_file(filename: str) Tuple[ndarray, str] [source]#
Loads affine file from disk.
- Parameters:
- filename: str
Affine filename to load.
- Returns:
- np.ndarray
4x4 affine matrix.
- str
Type of affine file loaded (omni/afni/fsl).
- omni.io.read_afni_framewise_affine(filename: str) ndarray [source]#
Loads in a framewise affine from afni
- Parameters:
- filename: str
Multi frame affine file to load.
- Returns:
- np.ndarray
n x 16 array of affines
- omni.io.write_affine_file(filename: str, affine_mat: ndarray, atype: str) None [source]#
Write affine file.
- Parameters:
- filename: str
Filename of affine file to write.
- affine_mat: np.ndarray
4x4 affine matrix.
- atype: str
Type of affine file to write (omni/afni/fsl).
- omni.io.write_afni_affine(filename: str, affine_mat: ndarray) None [source]#
Writes an afni affine matrix file to disk.
- omni.io.write_fsl_affine(filename: str, affine_mat: ndarray) None [source]#
Writes fsl format affine matrix to disk.
- omni.io.write_omni_affine(filename: str, affine_mat: ndarray) None [source]#
Writes omni format affine matrix to disk.