Skip to content

Commit

Permalink
minor updates
Browse files Browse the repository at this point in the history
  • Loading branch information
srikash committed Mar 21, 2021
1 parent 394185e commit 1f5ad28
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
4 changes: 3 additions & 1 deletion func/presurf_MPRAGEise.m
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function presurf_MPRAGEise(full_path_to_inv2,full_path_to_uni)
function full_path_to_output = presurf_MPRAGEise(full_path_to_inv2,full_path_to_uni)
disp(' ');
disp('+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++');
disp([datestr(datetime('now')), ' Start MPRAGEising']);
Expand Down Expand Up @@ -102,6 +102,8 @@ function presurf_MPRAGEise(full_path_to_inv2,full_path_to_uni)
uni_nii.fname=fullfile(full_path_to_out,[uni_file_prefix,'_MPRAGEised.nii']);
spm_write_vol(uni_nii,uni_img_clean);

full_path_to_output = uni_nii.fname;

% Clean Up
rmdir(fullfile(inv2_file_path,'presurf_biascorrect'),'s');
%% Fin
Expand Down
13 changes: 8 additions & 5 deletions presurfer_example.m
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
%% MP2RAGE pre-processing Start-to-finish
UNI=fullfile(pwd,'sub-42_mp2rage_0p7mm_iso_p3_UNI_Images.nii.gz');
INV2=fullfile(pwd,'sub-42_mp2rage_0p7mm_iso_p3_INV2.nii.gz');
UNI=fullfile(pwd,'sub-01_acq-MP2RAGE_mod-UNI_defaced.nii');
INV2=fullfile(pwd,'sub-01_acq-MP2RAGE_mod-INV2_defaced.nii');
% ########################################################################
% STEP - 0 : (optional) MPRAGEise UNI
% ########################################################################
presurf_MPRAGEise(INV2,UNI); % Outputs presurf_MPRAGEise directory
UNI_out = presurf_MPRAGEise(INV2,UNI); % Outputs presurf_MPRAGEise directory

% ########################################################################
% STEP - 1 : Pre-process INV2 to get STRIPMASK
Expand All @@ -15,8 +15,11 @@
% STEP - 3 : Pre-process UNI to get BRAINMASK
% ########################################################################
% Change UNI path to that of the MPRAGEised UNI if Step-0 was done
UNI = '/path/to/UNI.nii';
presurf_UNI(UNI); % Outputs presurf_UNI directory
if exist('UNI_out','var')
presurf_UNI(UNI_out); % Outputs presurf_UNI directory
else
presurf_UNI(UNI);
end

% ########################################################################
% STEP - 4 : Prepare for Freesurfer
Expand Down
Binary file removed presurfer_example.mlx
Binary file not shown.

0 comments on commit 1f5ad28

Please sign in to comment.