Commit 6743d388 authored by Sam Harrison's avatar Sam Harrison
Browse files

Make PROFUMO/MELODIC locations more explicit

In essence, this commit moves some of the hard coded paths out of the helper
functions and into `RunTests.m`, where things are a bit easier to track.
parent 790a2fd1
function [ Pg ] = loadMELODIC( outputDir, params )
function [ Pg ] = loadMELODIC( melodicDir, params )
Pg = read_avw(fullfile(outputDir, 'MELODIC.gica', 'melodic_IC.nii.gz'));
Pg = read_avw(fullfile(melodicDir, 'melodic_IC.nii.gz'));
Pg = reshape(Pg, params.V, params.iN);
end
function [ Pg, P, A, pcA ] = loadPROFUMO( outputDir, params )
function [ Pg, P, A, pcA ] = loadPROFUMO( pfmDir, params )
pfmDir = fullfile(outputDir, 'PROFUMO.pfm', 'FinalModel');
pfmDir = fullfile(pfmDir, 'FinalModel');
% Load group maps
mPg = h5read(fullfile(pfmDir, 'GroupSpatialModel', 'SignalMeans.post', ...
......
......@@ -8,10 +8,15 @@ nifti_dir=$2
dim=$3
TR=$4
mkdir "${output_dir}"
# Run all FSL commands locally
unset SGE_ROOT
# Run MELODIC
melodic -i ${nifti_dir}/MELODIC_SpecFile.txt \
-o ${output_dir}/MELODIC.gica \
melodic -i "${nifti_dir}/MELODIC_SpecFile.txt" \
-o "${output_dir}" \
--tr=${TR} -a concat -d ${dim} \
--migpN=300 --nobet --nomask \
--maxrestart=5 --verbose \
> ${output_dir}/MELODIC_Output.txt
> "${output_dir}/TerminalOutput.txt"
......@@ -8,11 +8,14 @@ nifti_dir=$2
dim=$3
TR=$4
mkdir "${output_dir}"
# Run PROFUMO (need to make sure we're on jalapeno18!)
nice -n 20 ~samh/bin/PROFUMO \
${nifti_dir}/PROFUMO_SpecFile.json \
#nice -n 20 PROFUMO \
PROFUMO \
"${nifti_dir}/PROFUMO_SpecFile.json" \
${dim} \
${output_dir}/PROFUMO.pfm \
"${output_dir}" \
--useHRF ${TR} --hrfFile ~samh/PROFUMO/HRFs/Default.phrf \
--covModel Run --lowRankData 150 -d 0.5 --nThreads 10 \
> ${output_dir}/PROFUMO_Output.txt
> "${output_dir}/TerminalOutput.txt"
......@@ -362,11 +362,12 @@ for n = 1:params.nRepeats
%% Run MELODIC %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
try
melodicDir = fullfile(repeatDir, 'MELODIC.gica');
system(sprintf( ...
'sh Methods/MELODIC.sh %s %s %d %1.2f', ...
repeatDir, niftiDir, params.iN, params.TR));
melodicDir, niftiDir, params.iN, params.TR));
icadr_Pg = loadMELODIC(repeatDir, params);
icadr_Pg = loadMELODIC(melodicDir, params);
[icadr_P, icadr_A] = runDR(D, icadr_Pg, params);
icadr_pcA = calculateNetmats(icadr_A, params);
......@@ -379,11 +380,12 @@ for n = 1:params.nRepeats
%% Run PROFUMO %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
try
pfmDir = fullfile(repeatDir, 'PROFUMO.pfm');
system(sprintf( ...
'sh Methods/PROFUMO.sh %s %s %d %1.2f', ...
repeatDir, niftiDir, params.iN, params.TR));
pfmDir, niftiDir, params.iN, params.TR));
[pfm_Pg, pfm_P, pfm_A, pfm_pcA] = loadPROFUMO(repeatDir, params);
[pfm_Pg, pfm_P, pfm_A, pfm_pcA] = loadPROFUMO(pfmDir, params);
scores.PROFUMO(n) = calculateDecompositionAccuracy( ...
P, pfm_P, A, pfm_A, pcA, pfm_pcA, params);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment