Skip to content

Commit

Permalink
pref file path fix attempt, rename run_dce_auto->run_dce_cli, fix run…
Browse files Browse the repository at this point in the history
…ner VFA input filename, add dce.json for test data
  • Loading branch information
lsaca05 committed Apr 29, 2024
1 parent 8771f4e commit 3fc05db
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/run_DCE.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ jobs:
- name: Run T1 mapping
uses: matlab-actions/run-command@v2
with:
command: addpath .; addpath dce/; addpath external_programs/; addpath external_programs/niftitools/; addpath parametric_scripts/; addpath parametric_scripts/custom_scripts/; T1mapping_fit('test_data/BIDS_test/rawdata/sub-01/ses-01/anat/', 'test_data/BIDS_test/derivatives/sub-01/ses-01/anat/', 'sub-01_ses-01_space-DCEref_desc-bfczunified_VFA.nii.gz')
command: addpath .; addpath dce/; addpath external_programs/; addpath external_programs/niftitools/; addpath parametric_scripts/; addpath parametric_scripts/custom_scripts/; T1mapping_fit('test_data/BIDS_test/rawdata/sub-01/ses-01/anat/', 'test_data/BIDS_test/derivatives/sub-01/ses-01/anat/', 'sub-01_ses-01_space-DCEref_desc-bfczunified_VFA.nii')

- name: Run DCE
uses: matlab-actions/run-command@v2
with:
command: run_dce_auto('test_data/BIDS_test/derivatives/sub-01/ses-01/')
command: run_dce_cli('test_data/BIDS_test/derivatives/sub-01/ses-01/')

- name: Upload Ktrans result
uses: actions/upload-artifact@v3
Expand Down
9 changes: 7 additions & 2 deletions parametric_scripts/custom_scripts/T1mapping_fit.m
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
function T1mapping_fit(source_path, tp_path, file)
% INPUTS
%------------------------------------
file_list = {strcat(tp_path, '/', file)};
if (tp_path(end) ~= '/')
file_list = {strcat(tp_path, '/', file)};
else
file_list = {strcat(tp_path, file)};
end

if ~(exist(file_list{1}, "file"))
disp('VFA file missing!')
disp(file_list)
Expand All @@ -28,7 +33,7 @@ function T1mapping_fit(source_path, tp_path, file)
if isempty(json_list)
% default FAs
parameter_list = [2 5 10 12 15];
preferencePath = strcat('script_preferences.txt');
preferencePath = strcat('../../script_preferences.txt');
script_prefs = parse_preference_file(preferencePath, 0, ...
{'tr'});
tr = script_prefs.tr; % units ms, only used for T1 FA fitting
Expand Down
4 changes: 2 additions & 2 deletions run_dce_auto.m → run_dce_cli.m
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
function run_dce_auto(subject_tp_path, subject_source_path)
function run_dce_cli(subject_tp_path, subject_source_path)
% Use full path to the subject timepoint as this function's argument.
% Beware, try-catches are used to keep a batch script running.

% Find and add subpaths
mfilepath=fileparts(which('run_dce_auto'));
mfilepath=fileparts(which('run_dce_cli'));
addpath(fullfile(mfilepath,'dce'));
addpath(fullfile(mfilepath,'external_programs'));
addpath(fullfile(mfilepath,'external_programs/niftitools'));
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"RepetitionTime": 0.008012,
"FlipAngle": 15
}

0 comments on commit 3fc05db

Please sign in to comment.