Skip to content

Commit

Permalink
Clean the help
Browse files Browse the repository at this point in the history
  • Loading branch information
tanguyduval committed Feb 15, 2018
1 parent 6acba3f commit 26981c6
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 71 deletions.
Binary file removed code/data/mask.png
Binary file not shown.
84 changes: 13 additions & 71 deletions doc/batch_axonlist.m
Expand Up @@ -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 :
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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;
%
%




File renamed without changes.
File renamed without changes.

0 comments on commit 26981c6

Please sign in to comment.