Skip to content
Draft
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
5 changes: 5 additions & 0 deletions dmri/dp_node_dmri.m
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@
% and utilities for handling diffusion data, including automatic XPS file handling.

methods

function obj = dp_node_dmri()
obj.input_spec.add('dmri_fn', 'file', 1, 1, 'Diffusion MRI nifti file');
obj.input_spec.add('xps_fn', 'file', 0, 1, 'Experimental parameter set file (auto-generated if not provided)');
end

function input = po2i(obj, po)
input = po;
Expand Down
2 changes: 2 additions & 0 deletions dmri/dp_node_dmri_denoise.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
function obj = dp_node_dmri_denoise()
obj.input_test = {'dmri_fn', 'xps_fn'};
obj.output_test = {'dmri_fn', 'xps_fn'};

obj.input_spec.add('dmri_fn', 'file', 1, 1, 'Diffusion MRI nifti file');
end

function output = i2o(obj, input) %#ok<INUSD>
Expand Down
3 changes: 3 additions & 0 deletions dmri/dp_node_dmri_disco_synb0.m
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
obj.license_fn = license_fn;
obj.input_test = {'dmri_fn', 't1_fn'};
obj.output_test = {'synb0_fn', 'topup_nii_fn'};

obj.input_spec.add('dmri_fn', 'file', 1, 1, 'Diffusion MRI nifti file');
obj.input_spec.add('t1_fn', 'file', 1, 1, 'T1-weighted nifti file');
end

% construct names of output files
Expand Down
3 changes: 3 additions & 0 deletions dmri/dp_node_dmri_divide.m
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
obj.suffix = suffix;

if (suffix(1) ~= '_'), warning('probably want _suffix'); end

obj.input_spec.add('dmri_fn', 'file', 1, 1, 'Diffusion MRI nifti file');
obj.input_spec.add('divisor_fn', 'file', 1, 1, 'Divisor volume nifti file');
end

function output = i2o(obj, input)
Expand Down
5 changes: 5 additions & 0 deletions dmri/dp_node_dmri_dti.m
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@
obj.input_test = {'dmri_fn'};
obj.output_test = {'md_fn', 'fa_fn', 's0_fn', 'fa_col_fn'};

obj.input_spec.add('dmri_fn', 'file', 1, 1, 'Diffusion MRI nifti file');
obj.input_spec.add('xps_fn', 'file', 1, 1, 'Experimental parameter set file');
obj.input_spec.add('mask_fn', 'file', 0, 1, 'Brain mask file (optional)');
obj.input_spec.add('opt', 'struct', 0, 0, 'Options structure (optional)');

if (nargin > 0)
obj.filter_sigma = filter_sigma;
end
Expand Down
5 changes: 5 additions & 0 deletions dmri/dp_node_dmri_flirt.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@
function obj = dp_node_dmri_flirt()
obj.input_test = {'nii_fn'};
obj.output_test = {'nii_fn'};

obj.input_spec.add('fa_fn', 'file', 1, 1, 'Fractional anisotropy map nifti file');
obj.input_spec.add('target_fn', 'file', 0, 1, 'Target registration template file (optional)');
obj.input_spec.add('dmri_fn', 'file', 0, 0, 'Diffusion MRI file (optional, passed through)');
obj.input_spec.add('mask_fn', 'file', 0, 0, 'Brain mask file (optional, passed through)');
end

function input = po2i(obj, po)
Expand Down
7 changes: 7 additions & 0 deletions dmri/dp_node_dmri_flirt_apply.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@
% - mask_fn (optional)

methods

function obj = dp_node_dmri_flirt_apply()
obj.input_spec.add('dmri_fn', 'file', 1, 1, 'Diffusion MRI nifti file');
obj.input_spec.add('matrix_fn', 'file', 1, 1, 'FLIRT transformation matrix file');
obj.input_spec.add('xps_fn', 'file', 0, 1, 'Experimental parameter set file (optional)');
obj.input_spec.add('mask_fn', 'file', 0, 1, 'Brain mask file (optional)');
end

function input = po2i(obj, po)
input = po;
Expand Down
6 changes: 6 additions & 0 deletions dmri/dp_node_dmri_md.m
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@
end

methods

function obj = dp_node_md()
obj.input_spec.add('nii_fn', 'file', 1, 1, 'Nifti file for MD calculation');
obj.input_spec.add('bp', 'path', 1, 1, 'Base path');
obj.input_spec.add('mask_fn', 'file', 0, 1, 'Brain mask file (optional)');
end

function output = i2o(obj, input)

Expand Down
5 changes: 5 additions & 0 deletions dmri/dp_node_dmri_mec.m
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@
% Corrects for subject motion and scanner-related distortions during diffusion acquisition.

methods

function obj = dp_node_dmri_mec()
obj.input_spec.add('dmri_fn', 'file', 1, 1, 'Diffusion MRI nifti file');
obj.input_spec.add('elastix_p', 'struct', 0, 0, 'ELASTIX parameters structure (optional)');
end

function input = po2i(obj, po)
input = po;
Expand Down
6 changes: 6 additions & 0 deletions dmri/dp_node_dmri_mec_eb.m
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@
% by extrapolating from low b-value data for improved motion correction performance.

methods

function obj = dp_node_dmri_mec_eb()
obj.input_spec.add('dmri_fn', 'file', 1, 1, 'Diffusion MRI nifti file');
obj.input_spec.add('elastix_p', 'struct', 0, 0, 'ELASTIX parameters structure (optional)');
obj.input_spec.add('mdm_opt', 'struct', 0, 0, 'MDM options structure (optional)');
end

function input = po2i(obj, po)
input = po2i@dp_node_dmri(obj, po);
Expand Down
5 changes: 5 additions & 0 deletions dmri/dp_node_dmri_merge.m
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@
function obj = dp_node_dmri_merge(fields, output_fn)
obj.merge_fields = fields;
obj.output_fn = output_fn;

% Add input_spec for the dynamic merge fields
for i = 1:length(fields)
obj.input_spec.add(fields{i}, 'file', 1, 1, sprintf('Input diffusion MRI file %d', i));
end
end

function output = i2o(obj, input)
Expand Down
4 changes: 4 additions & 0 deletions dmri/dp_node_dmri_normalise_seq.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@

function obj = dp_node_dmri_normalise_seq()
obj.output_test = {'dmri_fn', 'xps_fn'};

obj.input_spec.add('dmri_fn', 'file', 1, 1, 'Diffusion MRI nifti file');
obj.input_spec.add('xps_fn', 'file', 1, 1, 'Experimental parameter set file');
obj.input_spec.add('mask_fn', 'file', 1, 1, 'Brain mask file');
end

function output = i2o(obj, input)
Expand Down
4 changes: 4 additions & 0 deletions dmri/dp_node_dmri_powder_average.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@

function obj = dp_node_dmri_powder_average()
obj.output_test = {'dmri_fn'};

obj.input_spec.add('dmri_fn', 'file', 1, 1, 'Diffusion MRI nifti file');
obj.input_spec.add('xps_fn', 'file', 1, 1, 'Experimental parameter set file');
obj.input_spec.add('mask_fn', 'file', 0, 1, 'Brain mask file (optional)');
end


Expand Down
4 changes: 4 additions & 0 deletions dmri/dp_node_dmri_qti.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@

function obj = dp_node_dmri_qti()
obj.output_test = {'mki_fn', 'mka_fn', 'md_fn'};

obj.input_spec.add('dmri_fn', 'file', 1, 1, 'Diffusion MRI nifti file');
obj.input_spec.add('xps_fn', 'file', 1, 1, 'Experimental parameter set file');
obj.input_spec.add('mask_fn', 'file', 0, 1, 'Brain mask file (optional)');
end


Expand Down
4 changes: 4 additions & 0 deletions dmri/dp_node_dmri_qti_pa.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@

function obj = dp_node_dmri_qti_pa()
obj.output_test = {'mki_fn', 'mka_fn', 'md_fn'};

obj.input_spec.add('dmri_fn', 'file', 1, 1, 'Diffusion MRI nifti file');
obj.input_spec.add('xps_fn', 'file', 1, 1, 'Experimental parameter set file');
obj.input_spec.add('mask_fn', 'file', 0, 1, 'Brain mask file (optional)');
end

function output = i2o(obj, input)
Expand Down
3 changes: 3 additions & 0 deletions dmri/dp_node_dmri_smooth.m
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
function obj = dp_node_dmri_smooth(filter_sigma)
if (nargin > 0), obj.filter_sigma = filter_sigma; end
obj.output_test = {'dmri_fn'};

obj.input_spec.add('dmri_fn', 'file', 1, 1, 'Diffusion MRI nifti file');
obj.input_spec.add('mask_fn', 'file', 0, 1, 'Brain mask file (optional)');
end

function output = i2o(obj, input)
Expand Down
2 changes: 2 additions & 0 deletions dmri/dp_node_dmri_subsample.m
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
obj.suffix = suffix;

if (suffix(1) ~= '_'), warning('probably want _suffix'); end

obj.input_spec.add('dmri_fn', 'file', 1, 1, 'Diffusion MRI nifti file');
end

function output = i2o(obj, input)
Expand Down
4 changes: 4 additions & 0 deletions dmri/dp_node_dmri_subsample_b0.m
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
% nii_fn

methods

function obj = dp_node_dmri_subsample_b0()
obj.input_spec.add('dmri_fn', 'file', 1, 1, 'Diffusion MRI nifti file');
end

function output = i2o(obj, input)

Expand Down
7 changes: 7 additions & 0 deletions dmri/dp_node_dmri_topup2_apply.m
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@

methods

function obj = dp_node_dmri_topup2_apply()
obj.input_spec.add('ap_dmri_fn', 'file', 1, 1, 'Anterior-posterior diffusion MRI nifti file');
obj.input_spec.add('pa_dmri_fn', 'file', 1, 1, 'Posterior-anterior diffusion MRI nifti file');
obj.input_spec.add('topup_data_path', 'path', 1, 1, 'Path to TOPUP data files');
obj.input_spec.add('topup_spec_fn', 'file', 1, 1, 'TOPUP specification file');
end

% construct names of output files
function output = i2o(obj, input)

Expand Down
5 changes: 5 additions & 0 deletions dmri/dp_node_dmri_topup2_b0.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@

function obj = dp_node_dmri_topup2_b0()
obj.output_test = {'fieldmap_fn'};

obj.input_spec.add('topup_nii_fn', 'file', 1, 1, 'TOPUP input nifti file');
obj.input_spec.add('topup_spec_fn', 'file', 1, 1, 'TOPUP specification file');
obj.input_spec.add('topup_cnf', 'string', 0, 0, 'TOPUP configuration name (optional)');
obj.input_spec.add('topup_opt', 'struct', 0, 0, 'TOPUP options structure (optional)');
end

% construct names of output files
Expand Down
7 changes: 7 additions & 0 deletions dmri/dp_node_dmri_topup2_io.m
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@
'ap_json_fn', 'pa_json_fn', ...
'ap_xps_fn', 'pa_xps_fn'};

obj.input_spec.add('ap_dmri_fn', 'file', 1, 1, 'Anterior-posterior diffusion MRI nifti file');
obj.input_spec.add('pa_dmri_fn', 'file', 1, 1, 'Posterior-anterior diffusion MRI nifti file');
obj.input_spec.add('ap_json_fn', 'file', 1, 1, 'Anterior-posterior JSON parameter file');
obj.input_spec.add('pa_json_fn', 'file', 1, 1, 'Posterior-anterior JSON parameter file');
obj.input_spec.add('ap_xps_fn', 'file', 1, 1, 'AP experimental parameter set file');
obj.input_spec.add('pa_xps_fn', 'file', 1, 1, 'PA experimental parameter set file');

% disable the execution
obj.get_dpm('execute').do_run_execute = 0;

Expand Down
8 changes: 8 additions & 0 deletions dmri/dp_node_dmri_topup2_prep.m
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@
% handling. Formats AP/PA acquisitions for the improved TOPUP processing pipeline.

methods

function obj = dp_node_dmri_topup2_prep()
obj.input_spec.add('ap_dmri_fn', 'file', 1, 1, 'Anterior-posterior diffusion MRI nifti file');
obj.input_spec.add('pa_dmri_fn', 'file', 1, 1, 'Posterior-anterior diffusion MRI nifti file');
obj.input_spec.add('ap_json_fn', 'file', 1, 1, 'Anterior-posterior JSON parameter file');
obj.input_spec.add('pa_json_fn', 'file', 1, 1, 'Posterior-anterior JSON parameter file');
obj.input_spec.add('nii', 'struct', 0, 0, 'Nifti structure (optional)');
end

function output = i2o(~, input)

Expand Down
5 changes: 5 additions & 0 deletions dmri/dp_node_dmri_topup_apply.m
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@
methods

function obj = dp_node_dmri_topup_apply(name, suffix)

obj.input_spec.add('nii_ap_fn', 'file', 0, 1, 'Anterior-posterior nifti file (optional)');
obj.input_spec.add('nii_pa_fn', 'file', 0, 1, 'Posterior-anterior nifti file (optional)');
obj.input_spec.add('topup_data_path', 'path', 1, 1, 'Path to TOPUP data files');
obj.input_spec.add('topup_spec_fn', 'file', 1, 1, 'TOPUP specification file');

if (nargin > 0)

Expand Down
5 changes: 5 additions & 0 deletions dmri/dp_node_dmri_topup_b0.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@

function obj = dp_node_dmri_topup_b0()
obj.output_test = {'fieldmap_fn'};

obj.input_spec.add('topup_nii_fn', 'file', 1, 1, 'TOPUP input nifti file');
obj.input_spec.add('topup_spec_fn', 'file', 1, 1, 'TOPUP specification file');
obj.input_spec.add('topup_cnf', 'string', 0, 0, 'TOPUP configuration name (optional)');
obj.input_spec.add('topup_opt', 'struct', 0, 0, 'TOPUP options structure (optional)');
end

% construct names of output files
Expand Down
6 changes: 6 additions & 0 deletions dmri/dp_node_dmri_topup_prep.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@
obj.input_test = {...
'nii_ap_fn', 'nii_pa_fn', ...
'xps_ap_fn', 'xps_pa_fn'};

obj.input_spec.add('nii_ap_fn', 'file', 1, 1, 'Anterior-posterior nifti file');
obj.input_spec.add('nii_pa_fn', 'file', 1, 1, 'Posterior-anterior nifti file');
obj.input_spec.add('xps_ap_fn', 'file', 0, 1, 'AP experimental parameter set file (auto-generated if not provided)');
obj.input_spec.add('xps_pa_fn', 'file', 0, 1, 'PA experimental parameter set file (auto-generated if not provided)');
obj.input_spec.add('nii', 'struct', 0, 0, 'Nifti structure (optional)');

end

Expand Down
4 changes: 4 additions & 0 deletions dmri/dp_node_dmri_topup_prep_collect.m
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@


methods

function obj = dp_node_dmri_topup_prep_collect()
obj.input_spec.add('nii', 'struct', 0, 0, 'Nifti structure (optional)');
end

function output = i2o(~, input)
output.topup_nii_fn = fullfile(input.op, 'topupinput.nii.gz');
Expand Down
3 changes: 3 additions & 0 deletions dmri/dp_node_dmri_topup_prep_one.m
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@
obj.epi_time = time;

obj.input_test = {'nii_fn','xps_fn'};

obj.input_spec.add('nii_fn', 'file', 1, 1, 'Nifti file');
obj.input_spec.add('xps_fn', 'file', 1, 1, 'Experimental parameter set file');

end

Expand Down
2 changes: 2 additions & 0 deletions dmri/dp_node_dmri_xps.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

function obj = dp_node_dmri_xps()
obj.output_test = {'dmri_fn', 'xps_fn'};

obj.input_spec.add('dmri_fn', 'file', 1, 1, 'Diffusion MRI nifti file');
end

function output = i2o(obj, input)
Expand Down
3 changes: 3 additions & 0 deletions dmri/dp_node_dmri_xps_force.m
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@

function obj = dp_node_dmri_xps_force(xps)
obj.xps = xps;

% This node forces a specific XPS and doesn't use any input fields
% from the data, so no input_spec needed beyond the base path/op
end

function output = execute(obj, ~, output)
Expand Down
3 changes: 3 additions & 0 deletions dmri/dp_node_dmri_xps_from_bval_bvec.m
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@

function obj = dp_node_dmri_xps_from_bval_bvec(b_delta)
obj.b_delta = b_delta;

obj.input_spec.add('bval_fn', 'file', 1, 1, 'B-value file');
obj.input_spec.add('bvec_fn', 'file', 1, 1, 'B-vector file');
end

function output = execute(obj, input, output)
Expand Down
3 changes: 3 additions & 0 deletions dmri/dp_node_dmri_xps_from_gdir.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@

function obj = dp_node_dmri_xps_from_gdir()
obj.input_test = {'dmri_fn'};

obj.input_spec.add('dmri_fn', 'file', 1, 1, 'Diffusion MRI nifti file');
obj.input_spec.add('gdir_fn', 'file', 0, 1, 'Gradient direction file (auto-detected if not provided)');
end

function po = po2i(~, po)
Expand Down
2 changes: 2 additions & 0 deletions dmri/dp_node_dmri_xps_from_json.m
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

function obj = dp_node_dmri_xps_from_json()
obj.output_test = {'xps_fn', 'status_file_fn'};

obj.input_spec.add('dmri_fn', 'file', 1, 1, 'Diffusion MRI nifti file (with associated JSON file)');
end

function output = i2o(obj, input)
Expand Down
5 changes: 5 additions & 0 deletions dmri/dp_node_dmri_xps_make.m
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@

function obj = dp_node_dmri_xps_make()
obj.input_test = {'dmri_fn'};

obj.input_spec.add('dmri_fn', 'file', 1, 1, 'Diffusion MRI nifti file');
obj.input_spec.add('bval_fn', 'file', 0, 1, 'B-value file (auto-detected if not provided)');
obj.input_spec.add('bvec_fn', 'file', 0, 1, 'B-vector file (auto-detected if not provided)');
obj.input_spec.add('id', 'string', 0, 0, 'Subject/session identifier');
end

function po = po2i(~, po)
Expand Down
6 changes: 6 additions & 0 deletions dmri/dp_node_make_xps.m
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@
% XXX: Will be removed in future releases

methods

function obj = dp_node_make_xps()
obj = obj@dp_node_dmri_xps_make();

obj.input_spec.add('nii_fn', 'file', 1, 1, 'Nifti file (legacy input)');
end

function input = po2i(obj, po)
input = po;
Expand Down