Skip to content

Commit

Permalink
Fixing eTPM in code and readme
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristophePhillips committed Apr 7, 2017
1 parent 9c98a8d commit cdc4908
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 24 deletions.
9 changes: 7 additions & 2 deletions etpm/Readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,10 @@ The original maps provided at the time were not meeting SPM's requirements:
nwTPM_sl2.nii

I fixed the TPM using the script: cp_update_TPM.m
This lead to the currect TPM:
unwTPM_sl2.nii
This lead to the currect "extended TPM" :
eTPM.nii


Christophe Phillips
University of Li�ge
Belgium
40 changes: 20 additions & 20 deletions etpm/cp_update_TPM.m
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,18 @@
fullfile(spm('dir'),'tpm','TPM.nii,4'),...
fullfile(spm('dir'),'tpm','TPM.nii,5'),...
fullfile(spm('dir'),'tpm','TPM.nii,6'),...
fullfile(spm('dir'),'tpm','nwTPM_sl2.nii,1'),...
fullfile(spm('dir'),'tpm','nwTPM_sl2.nii,2'),...
fullfile(spm('dir'),'tpm','nwTPM_sl2.nii,3'),...
fullfile(spm('dir'),'tpm','nwTPM_sl2.nii,4'),...
fullfile(spm('dir'),'tpm','nwTPM_sl2.nii,5'),...
fullfile(spm('dir'),'tpm','nwTPM_sl2.nii,6')...
fullfile(spm('dir'),'toolbox','hMRI','etpm','nwTPM_sl2.nii,1'),...
fullfile(spm('dir'),'toolbox','hMRI','etpm','nwTPM_sl2.nii,2'),...
fullfile(spm('dir'),'toolbox','hMRI','etpm','nwTPM_sl2.nii,3'),...
fullfile(spm('dir'),'toolbox','hMRI','etpm','nwTPM_sl2.nii,4'),...
fullfile(spm('dir'),'toolbox','hMRI','etpm','nwTPM_sl2.nii,5'),...
fullfile(spm('dir'),'toolbox','hMRI','etpm','nwTPM_sl2.nii,6')...
);
% Then display the intensities and click in a 'corner'.

%% Fixing the TPms
thr = 1e-6;
Ptpm = fullfile(spm('dir'),'tpm','nwTPM_sl2.nii');
Ptpm = fullfile(spm('dir'),'toolbox','hMRI','etpm','nwTPM_sl2.nii');
Vtpm = spm_vol(Ptpm);
tpm_orig = spm_read_vols(Vtpm);
tpm_updt = tpm_orig;
Expand Down Expand Up @@ -88,7 +88,7 @@

% Save updated TPMs
Vtpm_u = spm_vol( fullfile(spm('dir'),'tpm','TPM.nii'));
fn_TPM_upd = fullfile(spm('dir'),'tpm','unwTPM_sl2.nii');
fn_TPM_upd = fullfile(spm('dir'),'toolbox','hMRI','etpm','eTPM.nii');
for ii=1:6
Vtpm_u(ii).fname = fn_TPM_upd;
Vtpm_u(ii) = spm_create_vol(Vtpm_u(ii));
Expand All @@ -104,17 +104,17 @@
fullfile(spm('dir'),'tpm','TPM.nii,4'),...
fullfile(spm('dir'),'tpm','TPM.nii,5'),...
fullfile(spm('dir'),'tpm','TPM.nii,6'),...
fullfile(spm('dir'),'tpm','unwTPM_sl2.nii,1'),...
fullfile(spm('dir'),'tpm','unwTPM_sl2.nii,2'),...
fullfile(spm('dir'),'tpm','unwTPM_sl2.nii,3'),...
fullfile(spm('dir'),'tpm','unwTPM_sl2.nii,4'),...
fullfile(spm('dir'),'tpm','unwTPM_sl2.nii,5'),...
fullfile(spm('dir'),'tpm','unwTPM_sl2.nii,6'),...
fullfile(spm('dir'),'tpm','nwTPM_sl2.nii,1'),...
fullfile(spm('dir'),'tpm','nwTPM_sl2.nii,2'),...
fullfile(spm('dir'),'tpm','nwTPM_sl2.nii,3'),...
fullfile(spm('dir'),'tpm','nwTPM_sl2.nii,4'),...
fullfile(spm('dir'),'tpm','nwTPM_sl2.nii,5'),...
fullfile(spm('dir'),'tpm','nwTPM_sl2.nii,6')...
fullfile(spm('dir'),'toolbox','hMRI','etpm','eTPM.nii,1'),...
fullfile(spm('dir'),'toolbox','hMRI','etpm','eTPM.nii,2'),...
fullfile(spm('dir'),'toolbox','hMRI','etpm','eTPM.nii,3'),...
fullfile(spm('dir'),'toolbox','hMRI','etpm','eTPM.nii,4'),...
fullfile(spm('dir'),'toolbox','hMRI','etpm','eTPM.nii,5'),...
fullfile(spm('dir'),'toolbox','hMRI','etpm','eTPM.nii,6'),...
fullfile(spm('dir'),'toolbox','hMRI','etpm','nwTPM_sl2.nii,1'),...
fullfile(spm('dir'),'toolbox','hMRI','etpm','nwTPM_sl2.nii,2'),...
fullfile(spm('dir'),'toolbox','hMRI','etpm','nwTPM_sl2.nii,3'),...
fullfile(spm('dir'),'toolbox','hMRI','etpm','nwTPM_sl2.nii,4'),...
fullfile(spm('dir'),'toolbox','hMRI','etpm','nwTPM_sl2.nii,5'),...
fullfile(spm('dir'),'toolbox','hMRI','etpm','nwTPM_sl2.nii,6')...
);

2 changes: 1 addition & 1 deletion tbx_scfg_hmri_proc_US.m
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@
% plus use the hMRI specific TPMs.
w_native = [[1 1];[1 1];[1 1];[0 0];[0 0];[0 0]];
w_warped = [[1 1];[1 1];[1 1];[0 0];[0 0];[0 0]];
fn_tpm = fullfile(spm('dir'),'toolbox','hMRI','tpm','unwTPM_sl2.nii');
fn_tpm = fullfile(spm('dir'),'toolbox','hMRI','etpm','eTPM.nii');
for ii=1:size(w_native,1)
proc_us = cfg_set_val(proc_us, 'tissues', ii, 'native', w_native(ii,:));
proc_us = cfg_set_val(proc_us, 'tissues', ii, 'warped', w_warped(ii,:));
Expand Down
2 changes: 1 addition & 1 deletion tbx_scfg_hmri_proc_smooth.m
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
tpm.filter = 'image';
tpm.ufilter = '.*';
tpm.num = [1 1];
tpm.val = {{fullfile(spm('dir'),'toolbox','hMRI','tpm','unwTPM_sl2.nii,1')}};
tpm.val = {{fullfile(spm('dir'),'toolbox','hMRI','etpm','eTPM.nii,1')}};

% ---------------------------------------------------------------------
% Gaussian FWHM
Expand Down

0 comments on commit cdc4908

Please sign in to comment.