Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 32 additions & 30 deletions connectome_evaluator.m
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@
% We brighten the symbols to use them as background.
Generate_Fig3_paper_Caiafa_Pestilli('gray')

% We load the FE structure from the file path stored locally on the SCA
% configuration file.
%
load(config.input_fe)
% If we were about to read from disk the path to the input FE strcutre we
% should now be abel to load it.
disp('Loading FE strcutre from sca config file...')
load(config.input_fe);

% We use the core function feGet.m to extract the RMSE and the B0 (MRI
% measureemnts without the diffusion-weighted gradient applied).
Expand All @@ -69,15 +69,16 @@
% We find the positive weights and disregard the NaNs. THen compute the
% number of postive weights (number of fascicles with non-zero weight, alse
% referred to as conenctome density).

output_sbj.nnz = feGet(fe,'connectome density');

% Finally we add the new data point to the plot we have generted. This si
% doen by plotting connectome density on the ordinate and RMSE on the
% abscissa.
fh = Add_new_data_point(output_sbj,'cold',2)
fh = Add_new_data_point(output_sbj,'cold',2);

% Write figure to disk.
fig_file_name = feSavefig(h,)
%fig_file_name = feSavefig(h,)

% Try to modify the jason file
%
Expand All @@ -88,7 +89,32 @@

end

%
% Below is a series of local helper functions.
%
function [] = Add_new_data_point(sbj,color_type,order)
%
% This function adds a new data point precomputed into the scater plot that
% compares connectome prediction error and resolution.
%
c = getNiceColors(color_type);

%% scatter plot
a = 0.5;

switch sbj.alg
case 'PROB'
plot(sbj.rmse, sbj.nnz,'o','markerfacecolor',c(order,:),'markeredgecolor','k','linewidth',a,'markersize',14,'DisplayName',[sbj.name,' ',sbj.alg])
case 'DET'
plot(sbj.rmse, sbj.nnz,'s','markerfacecolor',c(order,:),'markeredgecolor','k','linewidth',a,'markersize',14,'DisplayName',[sbj.name,' ',sbj.alg])
case 'TENSOR'
plot(sbj.rmse, sbj.nnz,'d','markerfacecolor',c(order,:),'markeredgecolor','k','linewidth',a,'markersize',14,'DisplayName',[sbj.name,' ',sbj.alg])
end

drawnow

end

function [] = Generate_Fig3_paper_Caiafa_Pestilli(color_mode)
%
% Load data from the demo data repositroy and geenrate a plot similar to
Expand Down Expand Up @@ -327,29 +353,5 @@
end


function [] = Add_new_data_point(sbj,color_type,order)
%
% This function adds a new data point precomputed into the scater plot that
% compares connectome prediction error and resolution.
%
c = getNiceColors(color_type);

%% scatter plot
a = 0.5;

switch sbj.alg
case 'PROB'
plot(sbj.rmse, sbj.nnz,'o','markerfacecolor',c(order,:),'markeredgecolor','k','linewidth',a,'markersize',14,'DisplayName',[sbj.name,' ',sbj.alg])
case 'DET'
plot(sbj.rmse, sbj.nnz,'s','markerfacecolor',c(order,:),'markeredgecolor','k','linewidth',a,'markersize',14,'DisplayName',[sbj.name,' ',sbj.alg])
case 'TENSOR'
plot(sbj.rmse, sbj.nnz,'d','markerfacecolor',c(order,:),'markeredgecolor','k','linewidth',a,'markersize',14,'DisplayName',[sbj.name,' ',sbj.alg])
end

drawnow

end




18 changes: 11 additions & 7 deletions main.m
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@

function config = main()
%
%
%
%
disp('loading application paths')

%TODO - move this to more permanent location - probably even /N/soft?
Expand All @@ -8,15 +12,15 @@

addpath('lib')

%disp("loading demo data")
%addpath(genpath('/N/dc2/scratch/hayashis/sca/demo_data_encode'))
disp('loading demo data')
addpath(genpath('/N/dc2/scratch/hayashis/sca/demo_data_encode'));

config = loadjson('config.json')
config = loadjson('config.json');
disp(config)

disp('running connectome_data_comparison')
connectome_data_comparison(config)
disp('running connectome_evaluator')
connectome_evaluator(config);

%all sca service needs to write products.json - empty for now
products = []
products = [];
savejson('', products, 'FileName', 'products.json')