diff --git a/code/data/mask.png b/code/data/mask.png deleted file mode 100644 index c777132..0000000 Binary files a/code/data/mask.png and /dev/null differ diff --git a/doc/batch_axonlist.m b/doc/batch_axonlist.m index 2d73945..db7536d 100644 --- a/doc/batch_axonlist.m +++ b/doc/batch_axonlist.m @@ -10,13 +10,17 @@ % Tutorial to manipulate axonlist structure -%% PART 1 - LOAD SEGMENTATION RESULTS +%% PART 1 - SEGMENT + +AxonSeg test_image_OM_2.tif SegParameters.mat -nogui + +%% PART 2 - LOAD SEGMENTATION RESULTS % load Segmentation Results (be patient.. can take some time) -load('axonlist_full.mat'); +load('axonlist_full_image.mat'); -%% PART 2 - EXPLORE AXONLIST STRUCTURE FOR MORPHOMETRY ANALYSIS OF THE DATA +%% PART 3 - EXPLORE AXONLIST STRUCTURE FOR MORPHOMETRY ANALYSIS OF THE DATA % number of axons segmented : @@ -37,38 +41,19 @@ % Calculate stats of distribution diam_mean=mean(Axon_diameters); -disp(['mean axon diameter in this image is : ' num2str(diam_mean) ' µm']) +disp(['mean axon diameter in this image is : ' num2str(diam_mean) ' ?m']) diam_std=std(Axon_diameters); -disp(['axon diameter standard deviation in this image is : ' num2str(diam_std) ' µm']) +disp(['axon diameter standard deviation in this image is : ' num2str(diam_std) ' ?m']) -% Remove axons larger than 15 µm +% Remove axons larger than 15 ?m axonlist_2=axonlist(Axon_diameters<9); nbaxons = length(axonlist_2); -disp(['number of axons segmented (<9µm) : ' num2str(nbaxons) ' axons']); - -%% PART 2 - EXTRACT STATS OF A PARTICULAR ROI - -% Create a binary mask to extract stats - -mask=imread('mask_2.png'); - - -% Register mask on image (click each mask region in registration GUI) -[mask_reg_labeled, P_color]=as_reg_mask(mask,img); - -% get indexes of axons in each region of the mask -indexes=as_stats_mask_labeled(axonlist, mask_reg_labeled); - -% plot barplots for main stats -as_stats_barplot(axonlist,indexes,P_color); +disp(['number of axons segmented (<9?m) : ' num2str(nbaxons) ' axons']); - -%% PART 3 - EXPLORE AXON AND MYELIN DISPLAY OPTIONS AVAILABLE - - +%% PART 2 - EXPLORE AXON AND MYELIN DISPLAY OPTIONS AVAILABLE % Produce an axon display colorcoded for axon diameter on initial gray % image @@ -112,7 +97,7 @@ % Save last display to current folder -imwrite(display_1,'Axon_display.tif'); +imwrite(display_5,'Axon_display.tif'); % Get the binary image of axon objects @@ -134,46 +119,3 @@ img_BW_fibers=im2bw(bw_axonseg_axons+bw_axonseg_myelins,0); imshow(img_BW_fibers); - - -% Use fiber binary image as mask to select fibers in gray image - - -fibers_extract=uint8(img_BW_fibers).*img; -imshow(fibers_extract); -% imwrite(fibers_extract,'fibers_masked.tif'); - - -%% WARP STATS FROM HISTOLOGY TO MRI - -% Downsample histology data - -as_stats_downsample_2nii(axonlist,size(img),PixelSize,150); - - - - - - - - -%% - -% %% PART 1 - -% -% % calculate myelin volume fraction (MVF) in an image -% -% total_area=size(img,1)*size(img,2); -% -% bw_axonseg=as_display_label(axonlist,size(img),'axonEquivDiameter','myelin'); -% img_BW_myelins=im2bw(bw_axonseg,0); -% -% myelin_area=sum(sum(img_BW_myelins)); -% -% MVF=myelin_area/total_area; -% -% - - - - diff --git a/code/data/SegParameters.mat b/doc/data/SegParameters.mat similarity index 100% rename from code/data/SegParameters.mat rename to doc/data/SegParameters.mat diff --git a/code/data/test_image_OM_2.tif b/doc/data/test_image_OM_2.tif similarity index 100% rename from code/data/test_image_OM_2.tif rename to doc/data/test_image_OM_2.tif