Skip to content

Commit

Permalink
NEW FEATURE: MPM
Browse files Browse the repository at this point in the history
  • Loading branch information
tiborauer committed Jul 2, 2017
1 parent 6bda156 commit 334d46a
Show file tree
Hide file tree
Showing 5 changed files with 80 additions and 1 deletion.
18 changes: 18 additions & 0 deletions aa_engine/aa_init.m
Expand Up @@ -142,6 +142,16 @@
end;
end;

% Path to VBQ
if ~isempty(aap.directory_conventions.VBQdir)
addpath(aap.directory_conventions.VBQdir);
else
% Check whether already in path, give warning if not
if isempty(which('vbq_mpr_b0_b1'))
aas_log(aap,false,sprintf('VBQ toolbox not found, if you need this you should add it to the matlab path manually, or set aap.directory_conventions.VBQdir'));
end;
end;

% Path to DCMTK
if isfield(aap.directory_conventions,'DCMTKdir') && ~isempty(aap.directory_conventions.DCMTKdir)
setenv('PATH',[aacache.path.bcp_shellpath ':' fullfile(aap.directory_conventions.DCMTKdir,'bin')]);
Expand Down Expand Up @@ -210,6 +220,14 @@
end
end

% VBQ
if ~isempty(aap.directory_conventions.VBQdir)
p_ind = cell_index(p,aap.directory_conventions.VBQdir);
for ip = p_ind
reqpath{end+1} = p{ip};
end
end

% clean
reqpath=reqpath(strcmp('',reqpath)==0);
exc = cell_index(reqpath,'.git');
Expand Down
37 changes: 37 additions & 0 deletions aa_modules/aamod_MPM.m
@@ -0,0 +1,37 @@
function [aap,resp]=aamod_MPM(aap,task,subj)

resp='';

switch task
case 'report'

case 'doit'

mpmfns = cellstr(aas_getfiles_bystream(aap,'special_session',[subj,cell_index({aap.acq_details.special_sessions.name},'MPM')],'MPM'));

job.b1_type = '3D_EPI_v2b';

job.data_spec.subj.raw_fld.b0 = [...
mpmfns(cell_index(mpmfns,'serie01')),...
{''},...
mpmfns(cell_index(mpmfns,'serie02')),...
];
job.data_spec.subj.raw_fld.b1 = mpmfns(cell_index(mpmfns,'serie03'))';
job.data_spec.subj.raw_mpm.MT = mpmfns(cell_index(mpmfns,'serie04'))';
job.data_spec.subj.raw_mpm.PD = mpmfns(cell_index(mpmfns,'serie05'))';
job.data_spec.subj.raw_mpm.T1 = mpmfns(cell_index(mpmfns,'serie06'))';

aas_makedir(aap,fullfile(aas_getsubjpath(aap,subj),'MPM'));
job.data_spec.subj.output.outdir = cellstr(fullfile(aas_getsubjpath(aap,subj),'MPM'));

out = vbq_mpr_b0_b1(job);

aap=aas_desc_outputs(aap,'subject',subj,'mt',out.MT{1});
aap=aas_desc_outputs(aap,'subject',subj,'pd',strrep(out.A{1},'_A.nii','_PDw.nii'));
aap=aas_desc_outputs(aap,'subject',subj,'r1',out.R1{1});
aap=aas_desc_outputs(aap,'subject',subj,'r2star',out.R2s{1});
aap=aas_desc_outputs(aap,'subject',subj,'t1',out.T1w{1});

case 'checkrequirements'

end
22 changes: 22 additions & 0 deletions aa_modules/aamod_MPM.xml
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<aap>
<tasklist>
<currenttask domain='subject' desc='Calculate MP maps using VBQ toolbox' modality='X'>

<b1_type>3D_EPI_v2b</b1_type>

<inputstreams>
<stream>MPM</stream>
</inputstreams>

<outputstreams>
<stream isrenameable='1'>mt</stream>
<stream isrenameable='1'>pd</stream>
<stream isrenameable='1'>r1</stream>
<stream isrenameable='1'>r2star</stream>
<stream isrenameable='1'>t1</stream>
</outputstreams>

</currenttask>
</tasklist>
</aap>
1 change: 1 addition & 0 deletions aa_recipes_and_parametersets/aap_parameters_defaults.xml
Expand Up @@ -52,6 +52,7 @@
<ANTSdir desc='Path to Advanced Normalisation Tools (ANTS)' ui='dir'></ANTSdir>
<fieldtripdir desc='Path to fieltrip toolbox' ui='dir'></fieldtripdir>
<BrainWaveletdir desc='Path to BrainWavelet toolbox' ui='dir'></BrainWaveletdir>
<VBQdir desc='Path to VBQ toolbox' ui='dir'></VBQdir>
<DCMTKdir desc='Path to DICOM Toolkit' ui='dir'></DCMTKdir>
<FaceMaskingdir desc='Path to FaceMasking (WUSTL NRG)' ui='dir'></FaceMaskingdir>
<allowremotecache desc='Allow local caching of files from remote server' ui='optionlist'>1</allowremotecache>
Expand Down
Expand Up @@ -23,7 +23,7 @@
<protocol_t2 ui='text'>t2_spc</protocol_t2>
<dicomfilter ui='text'>*.dcm</dicomfilter>
<megsubjectoutputformat desc='sprintf formatting string to get subject directory from number' ui='text'>meg%02d_%04d*</megsubjectoutputformat>
<spmdir desc="Path(s) to SPM (>SPM12 r6470 required)" ui="dir">/imaging/local/software/spm_cbu_svn/releases/spm12_fil_r6685</spmdir>
<spmdir desc="Path(s) to SPM (>SPM12 r6470 required)" ui="dir">/imaging/local/software/spm_cbu_svn/releases/spm12_fil_r6906</spmdir>
<spmtoolsdir desc='Path(s) to SPM tools' ui='dir'>/imaging/local/software/spm_toolbox/vbm8</spmtoolsdir>
<linuxshell desc='Linux shell used to run linux commands' ui='text'>bash</linuxshell>
<fsldir desc='Path to fsl' ui='dir'>/imaging/local/software/fsl/latest/x86_64/fsl</fsldir>
Expand All @@ -43,6 +43,7 @@
<ANTSdir desc='Path to Advanced Normalisation Tools (ANTS)' ui='dir'>/imaging/local/software/ANTs/v1.9</ANTSdir>
<fieldtripdir desc='Path to fieltrip toolbox' ui='dir'></fieldtripdir>
<BrainWaveletdir desc='Path to BrainWavelet toolbox' ui='dir'>/imaging/local/software/BrainWavelet</BrainWaveletdir>
<VBQdir desc='Path to VBQ toolbox' ui='dir'>/imaging/local/software/spm_toolbox/VBQ</VBQdir>
<DCMTKdir desc='Path to DICOM Toolkit' ui='dir'>/imaging/local/software/dcmtk/v3.6.0/dcmtk</DCMTKdir>
<FaceMaskingdir desc='Path to FaceMasking (WUSTL NRG)' ui='dir'>/imaging/local/software/FaceMasking/FaceMasking-06.30.2015</FaceMaskingdir>
<allowremotecache desc='Allow local caching of files from remote server' ui='optionlist'>1</allowremotecache>
Expand Down

0 comments on commit 334d46a

Please sign in to comment.