Skip to content
Snippets Groups Projects
Commit b2bb4c40 authored by MarieBofferding's avatar MarieBofferding
Browse files

//WIP added expanding function for the brain mask

need to have this function to threshold the images, so everything outside of the brain except the electrode heads will be removed
parent 181fd59b
No related branches found
No related tags found
2 merge requests!3Regular merge of develop,!2Seeg algorithm
% 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);
\ No newline at end of file
% PCA
CT_post = NiftiMod('Seeg_chinese_1_before_final.nii');
%CT_post = NiftiMod('Seeg_chinese_1_before_final.nii');
%CT_post = NiftiMod('seeg_seg_bul_inside_binary.nii');
%% CONSTANTS
......@@ -15,6 +15,19 @@ MAXVOXELNUMBER_CONTACTS = 150;
MINVOXELNUMBER_HEAD = 200;
MAXVOXELNUMBER_HEAD = 2000;
%% TODO: rename brainmask files in all folders to not get them confused!!!
%
% CT_post = NiftiMod('seeg_electrode_additional_tryout_high_threshold_2.nii.gz');
% Brain_mask = NiftiMod('brain_mask.nii.gz');
% Brain_mask_img = Brain_mask.img;
%
% bm = bwconncomp(Brain_mask_img,26);
%
% bmProps = regionprops(bm, Brain_mask.img, 'Area', 'PixelIdxList', 'PixelList', 'PixelValues', 'BoundingBox', 'Centroid');
% [areas, idxs] = sort([bmProps.Area], 'descend'); % sort by size
%
% bm_centroid = bmProps(idxs(:,1)).Centroid
%% TODO: find some solution for electrodes, where the contacts regions are "melted" together and no seperate
%% regions and head are defined
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment