diff --git a/.github/workflows/run_DCE.yml b/.github/workflows/run_DCE.yml index 9c80414..a9d305b 100644 --- a/.github/workflows/run_DCE.yml +++ b/.github/workflows/run_DCE.yml @@ -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 diff --git a/parametric_scripts/custom_scripts/T1mapping_fit.m b/parametric_scripts/custom_scripts/T1mapping_fit.m index 0c85c92..9ecd2ae 100644 --- a/parametric_scripts/custom_scripts/T1mapping_fit.m +++ b/parametric_scripts/custom_scripts/T1mapping_fit.m @@ -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) @@ -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 diff --git a/run_dce_auto.m b/run_dce_cli.m similarity index 98% rename from run_dce_auto.m rename to run_dce_cli.m index a60f105..a9e6c64 100644 --- a/run_dce_auto.m +++ b/run_dce_cli.m @@ -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')); diff --git a/test_data/BIDS_test/rawdata/sub-01/ses-01/dce/sub-01_ses-01_DCE.json b/test_data/BIDS_test/rawdata/sub-01/ses-01/dce/sub-01_ses-01_DCE.json new file mode 100755 index 0000000..52e2f86 --- /dev/null +++ b/test_data/BIDS_test/rawdata/sub-01/ses-01/dce/sub-01_ses-01_DCE.json @@ -0,0 +1,4 @@ +{ + "RepetitionTime": 0.008012, + "FlipAngle": 15 +}