Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
updating documentation
- Loading branch information
Tanusree Chaudhuri
authored and
Tanusree Chaudhuri
committed
Jul 27, 2020
1 parent
8251bfc
commit 67e5276
Showing
6 changed files
with
132 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
function [ClusterTable] = Cluster_Overlap_main(ImageFiles) | ||
|
||
%%%% ----- Cluster Overlap Task ----- %%%% | ||
%---------------------------------------------------------------------------------------------------------------% | ||
|
||
% 'CodeDir' contains the fullpath to the folder into which the Toolbox is copied. | ||
% 'DataDir' is the fullpath to the directory whose data needs to be analysed | ||
% by this pipeline. | ||
% | ||
% %----Description----% | ||
% Run this script to obtain proportion of brain regions detected in the cluster images. | ||
|
||
% FORMAT [ClusterTable] = Cluster_Overlap_main(ImageFiles) | ||
% | ||
% %----Input----% | ||
% ImageFiles: Filename of cluster image. | ||
|
||
% %----Output----% | ||
% ClusterTable: Table array showing per | ||
% | ||
% -----------------------------------------% | ||
% Tanusree Chaudhuri | ||
% Max Planck Institute of Psychiatry, Munich | ||
% tanusree_chaudhuri@psych.mpg.de | ||
% -----------------------------------------% | ||
|
||
%---------------------------------------------------------------------------------------------------------------% | ||
|
||
global DataDir; | ||
global TemplatesDir; | ||
|
||
cd(DataDir); | ||
|
||
% ----- Binarizing cluster image ------ % | ||
ImagesToBeMasked = ImageFiles; | ||
InputFilename = cellstr(ImagesToBeMasked); | ||
[pth,nam,ext] = spm_fileparts(ImageFiles); | ||
OutputFilename = strcat(pth,'/Mask_',nam,ext); | ||
MaskingClusterImages(InputFilename,OutputFilename); | ||
|
||
% ------ Cluster Labelling.------ % | ||
ClusterMask = spm_vol(OutputFilename); | ||
ClusterMask = spm_read_vols(ClusterMask); | ||
CC = bwconncomp(ClusterMask); | ||
NumberOfClusters = CC.NumObjects; | ||
|
||
|
||
for img_cluster = 1:NumberOfClusters | ||
|
||
[ClusterLabels,ClusterParents,ClusterLabelsPercent] = ClusterProportionInPercentages(TemplatesDir,CC,img_cluster); | ||
if(isempty(ClusterLabels)) | ||
Cluster_blob_num = cellstr(repmat(['Cluster',' ',num2str(img_cluster)],[1, 1])); | ||
ClusterLabels{end + 1} = []; | ||
ClusterLabelsPercent = 100; | ||
ClusterParents{end + 1} = []; | ||
end | ||
Cluster_blob_num = cellstr(repmat(['Cluster',' ',num2str(img_cluster)],[length(ClusterLabels) 1])); | ||
ClusterParents = ClusterParents'; | ||
ClusterImageInfo = table(Cluster_blob_num,ClusterLabels,ClusterParents,ClusterLabelsPercent); | ||
disp(strcat('Blob','_',num2str(img_cluster),'_','done')); | ||
|
||
|
||
if(img_cluster == 1) | ||
ClusterTable = ClusterImageInfo; | ||
else | ||
ClusterTable = [ClusterTable;ClusterImageInfo]; | ||
end | ||
|
||
end | ||
|
||
|
||
|
||
end | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters