Newer
Older
% expand the brain mask to threshold the image so we don't get artifacts
% from everything that it causing them outside of
% the brain, besides the electrode head candidates
% CT_post = NiftiMod('seeg_electrode_additional_tryout_high_threshold_2.nii.gz');
% Brain_mask = NiftiMod('brain_mask.nii.gz');
brainMaskImg = Brain_mask.img;
structEl = strel('sphere', 3);
expndBrainMask = imdilate(brainMaskImg, structEl);
isosurface(expndBrainMask);
% compute the centroid of the CT to later map the electrode with the
% expanded brain Mask and get rid of the artefact far away from brain
stats_CT_post = regionprops(maskedImg);
centroid_CT_post = stats_CT_post.Centroid;
% compute the centroid of the expanded brain mask
stats_expndBrainMask = regionprops(expndBrainMask);
centroid_expndBrainMask = stats_expndBrainMask.Centroid;