Description Usage Arguments Details Value See Also Examples
Find a plane that distinguish the two cerebral hemispheres.
1 2 3 4 5 6 7 8 | ## S4 method for signature 'MRIaggr'
calcHemisphere(object, param, num = NULL, p = 1, subset = NULL,
penalty = "symmetry", mask = NULL, numeric2logical = FALSE,
n.points = 100, gridSearch = TRUE,
i_test = seq(-20, 20, by = 5), angle.test = seq(-30, 30, by = 5),
unit_angle = "degree", NelderMead = TRUE, maxit = 100, reltol = 0.001,
plot = TRUE, filename = paste(object@identifier, "_calcHemisphere", sep = ""),
update.object = FALSE, overwrite = FALSE, ...)
|
object |
an object of class |
param |
the contrast parameter that should be used to distinguish the two hemispheres. character. REQUIRED. |
num |
the slices to use. numeric vector or |
p |
the type of distance for the penalization. positive numeric. |
subset |
the subset of observations to use. positive integer vector or |
penalty |
the type of objective function. Can be |
mask |
the binary contrast parameter(s) indicating the lesion. character vector or |
numeric2logical |
should |
gridSearch |
Should grid search be used to find the mid-sagittal plane ? logical. |
i_test |
the abscissa or the number of abscissa to test. numeric vector or positive integer. |
angle.test |
the angle or the number of angle to test. numeric vector or postive integer. |
unit_angle |
the unit in which the angle is given. Can be |
n.points |
the number of points that represent the mid-sagittal plan to computed. |
NelderMead |
Should the center of the grid search be searched using Nelder-Mead algorithm or set to the center of the image ? logical. |
maxit |
The maximum number of iterations. postive integer. See the details section of |
reltol |
Relative convergence tolerance. positive numeric. See the details section of |
plot |
should the results be plotted ? logical. |
filename |
the name of the file used to export the plot. character. |
update.object |
should the resulting midplane be stored in |
overwrite |
if a midplane is already stored in |
... |
additional arguments to be passed to |
ARGUMENTS:
Information about the num
argument can be found in the details section of initNum
.
Setting p
to 1
leads to use the absolute difference ; setting p
to 2
leads to use the euclidean distance.
Arguments ...
must correspond to some of the following arguments : height
, numeric2logical
, path
, res
, unit
, verbose
, width
, window
.
FUNCTION:
This function seeks the plane that minimize the difference between contralateral values of the two hemispheres or maximize the similarity between the two hemispheres.
There are 2 degree of freedom : one for the position of the center and one for the angle.
The separation between the hemisphere is assumed to be identical for all slices.
From our experience, using an objective function based on symmetry gives better results compared to asymmetry.
An list containing :
[[penalty]]
: an array containing the objective function for the various configurations.
[[nb]]
: an array containing the number of observations used to compute the penalty function for the various configurations.
[[moy]]
: an array containing the mean value of the objective function for the various configurations.
[[optimum]]
: the parameters of the optimal midplane. numeric vector
[[midplane]]
: the position of the midplane points. matrix.
[[data]]
: the position of the observations with respect to the mid-sagittal plane. matrix.
[[cv]]
: Was the optimum reached inside the parameter space and not at a border ? logical.
selectParameter
to select the midplane.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | ## load a MRIaggr object
data("MRIaggr.Pat1_red", package = "MRIaggr")
## Not run:
res <- calcHemisphere(MRIaggr.Pat1_red, param = "T2_GRE_t0",
verbose = TRUE, update.object = TRUE, overwrite = TRUE)
## display the mid-sagittal plan
multiplot(MRIaggr.Pat1_red, param = "T2_GRE_t0", num = 3, legend = FALSE,
midplane = TRUE, main = "original coordinates - slice ")
## display with the new coordinates
multiplot(selectContrast(MRIaggr.Pat1_red, param = c("i_hemisphere","j_hemisphere","k")),
contrast=selectContrast(MRIaggr.Pat1_red, param = "T2_GRE_t0"), num = 3,
index1=cbind(0, seq(-50,50), 3), main = "new coordinates - slice ", legend = FALSE)
## compute the mid-sagittal plan and mark lesion and healthy hemispheres
res <- calcHemisphere(MRIaggr.Pat1_red, param = "T2_GRE_t0",
mask = c("MASK_DWI_t0","MASK_T2_FLAIR_t2"), numeric2logical = TRUE,
verbose = TRUE, update.object = TRUE, overwrite = TRUE)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.