Skip to content

Commit

Permalink
rmHotellingT2.m: added option to average across slices
Browse files Browse the repository at this point in the history
  • Loading branch information
julienbesle committed Oct 27, 2016
1 parent c05d35c commit 4205d10
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@

function [P,N,T2] = rmHotellingT2(varargin)

justDoCentralSlice=true;
justDoCentralSlice=false;
average5CentralSlices = false;

amplitudePhase=false;

Expand Down Expand Up @@ -51,6 +52,11 @@
oldKkk=kkk;
kkk=1;
X = X(:,:,ceil(oldKkk/2),:,:);
elseif average5CentralSlices
mrWarnDlg('(rmHotellingT2) Averaging 5 central slices and restricting analysis to this');
oldKkk=kkk;
kkk=1;
X = nanmean(X(:,:,ceil(oldKkk/2)+(-2:2),:,:),3);
end

X=reshape(X,[k*kk*kkk n p]);
Expand Down Expand Up @@ -96,7 +102,7 @@
P=reshape(P,[k kk kkk]);
N=reshape(N,[k kk kkk]);

if justDoCentralSlice
if justDoCentralSlice || average5CentralSlices
T2=repmat(T2,[1 1 oldKkk]);
T2(:,:,[1:ceil(oldKkk/2)-1 ceil(oldKkk/2)+1:11])=NaN;
P=repmat(P,[1 1 oldKkk]);
Expand Down

0 comments on commit 4205d10

Please sign in to comment.