Rigid-registration across multiple types of images, non-linear normalization
from native brain to common templates, and map template atlas or 'ROI' back
to native brain. See examples at as_yael_process
Value
whether the image has been set (or replaced)
Absolute path if the image
'RAVE' subject instance
Nothing
A list of moving and fixing images, with rigid transformations from different formats.
See method get_template_mapping
A list of input, output images, with forward and inverse
transform files (usually two 'Affine'
with one displacement field)
transformed image in 'ANTs' format
transformed image in 'ANTs' format
Nothing
A matrix of 3 columns, each row is a transformed points (
invalid rows will be filled with NA
)
A matrix of 3 columns, each row is a transformed points (
invalid rows will be filled with NA
)
Methods
Method set_input_image()
Set the raw input for different image types
Arguments
path
path to the image files in
'NIfTI'
formattype
type of the image
overwrite
whether to overwrite existing images if the same type has been imported before; default is false
on_error
when the file exists and
overwrite
is false, how should this error be reported; choices are'warning'
(default),'error'
(throw error and abort), or'ignore'
.
Method get_input_image()
Get image path
Usage
YAELProcess$get_input_image(
type = c("T1w", "T2w", "CT", "FLAIR", "preopCT", "T1wContrast", "fGATIR")
)
Method get_subject()
Get 'RAVE' subject instance
Arguments
project_name
project name; default is
'YAEL'
strict
passed to
as_rave_subject
Method register_to_T1w()
Register other images to 'T1' weighted 'MRI'
Usage
YAELProcess$register_to_T1w(
image_type = c("CT", "T2w", "FLAIR", "preopCT", "T1wContrast", "fGATIR"),
reverse = FALSE,
verbose = TRUE
)
Arguments
image_type
type of the image to register, must be set via
process$set_input_image
first.reverse
whether to reverse the registration; default is false, meaning the fixed (reference) image is the
'T1'
. When setting to true, then the'T1'
'MRI' will become the moving imageverbose
whether to print out the process; default is true
Method get_native_mapping()
Get the mapping configurations used by register_to_T1w
Usage
YAELProcess$get_native_mapping(
image_type = c("CT", "T2w", "FLAIR", "preopCT", "T1wContrast", "fGATIR"),
relative = FALSE
)
Method transform_image_from_template()
Apply transform from images (usually an atlas or 'ROI') on template to native space
Usage
YAELProcess$transform_image_from_template(
template_roi_path,
template_name = c("mni_icbm152_nlin_asym_09a", "mni_icbm152_nlin_asym_09b",
"mni_icbm152_nlin_asym_09c"),
native_type = c("T1w", "T2w", "CT", "FLAIR", "preopCT", "T1wContrast", "fGATIR"),
interpolator = c("auto", "nearestNeighbor", "linear", "gaussian", "bSpline",
"cosineWindowedSinc", "welchWindowedSinc", "hammingWindowedSinc",
"lanczosWindowedSinc", "genericLabel"),
verbose = TRUE
)
Arguments
template_roi_path
path to the template image file which will be transformed into individuals' image
template_name
templates to use
native_type
which type of native image to use for calculating the coordinates (default
'T1w'
)interpolator
how to interpolate the
'voxels'
; default is"auto"
:'linear'
for probabilistic map and'nearestNeighbor'
otherwise.verbose
whether the print out the progress
Method transform_image_to_template()
Apply transform to images (usually an atlas or 'ROI') from native space to template
Usage
YAELProcess$transform_image_to_template(
native_roi_path,
template_name = c("mni_icbm152_nlin_asym_09a", "mni_icbm152_nlin_asym_09b",
"mni_icbm152_nlin_asym_09c"),
native_type = c("T1w", "T2w", "CT", "FLAIR", "preopCT", "T1wContrast", "fGATIR"),
interpolator = c("auto", "nearestNeighbor", "linear", "gaussian", "bSpline",
"cosineWindowedSinc", "welchWindowedSinc", "hammingWindowedSinc",
"lanczosWindowedSinc", "genericLabel"),
verbose = TRUE
)
Arguments
native_roi_path
path to the native image file that will be transformed into template
template_name
templates to use
native_type
which type of native image to use for calculating the coordinates (default
'T1w'
)interpolator
how to interpolate the
'voxels'
; default is"auto"
:'linear'
for probabilistic map and'nearestNeighbor'
otherwise.verbose
whether the print out the progress
Method generate_atlas_from_template()
Generate atlas maps from template and morph to native brain
Usage
YAELProcess$generate_atlas_from_template(
template_name = c("mni_icbm152_nlin_asym_09a", "mni_icbm152_nlin_asym_09b",
"mni_icbm152_nlin_asym_09c"),
atlas_folder = NULL,
surfaces = NA,
verbose = TRUE
)
Arguments
template_name
which template to use
atlas_folder
path to the atlas folder (that contains the atlas files)
surfaces
whether to generate surfaces (triangle mesh); default is
NA
(generate if not existed). Other choices areTRUE
for always generating and overwriting surface files, orFALSE
to disable this function. The generated surfaces will stay in native'T1'
space.verbose
whether the print out the progress
Method construct_ants_folder_from_template()
Create a reconstruction folder (as an alternative option) that
is generated from template brain to facilitate the '3D' viewer.
Please make sure method map_to_template
is called before using
this method (or the program will fail)
Usage
YAELProcess$construct_ants_folder_from_template(
template_name = c("mni_icbm152_nlin_asym_09a", "mni_icbm152_nlin_asym_09b",
"mni_icbm152_nlin_asym_09c"),
add_surfaces = TRUE
)
Arguments
template_name
template to use for mapping
add_surfaces
whether to create surfaces that is morphed from template to local; default is
TRUE
. Please enable this option only if the cortical surfaces are not critical (for example, you are studying the deep brain structures). Always use'FreeSurfer'
if cortical information is used.
Method get_brain()
Get '3D' brain model
Usage
YAELProcess$get_brain(
electrodes = TRUE,
project_name = "YAEL",
coord_sys = c("scannerRAS", "tkrRAS", "MNI152", "MNI305"),
...
)
Arguments
electrodes
whether to add electrodes to the viewers; can be logical, data frame, or a character (path to electrode table). When the value is
TRUE
, the electrode file underproject_name
will be loaded; whenelectrodes
is adata.frame
, or path to a'csv'
file, then please specifycoord_sys
on what is the coordinate system used for columns"x"
,"y"
, and"z"
.project_name
project name under which the electrode table should be queried, if
electrodes=TRUE
coord_sys
coordinate system if
electrodes
is a data frame with columns"x"
,"y"
, and"z"
, available choices are'scannerRAS'
(defined by 'T1' weighted native 'MRI' image),'tkrRAS'
('FreeSurfer'
defined native 'TK-registered'),'MNI152'
(template 'MNI' coordinate system averaged over 152 subjects; this is the common "'MNI' coordinate space" we often refer to), and'MNI305'
(template 'MNI' coordinate system averaged over 305 subjects; this coordinate system used by templates such as'fsaverage'
)...
passed to
threeBrain