Skip to content

Commit

Permalink
Add reporting of percentage of masked voxels
Browse files Browse the repository at this point in the history
  • Loading branch information
mharms committed Mar 16, 2020
1 parent 9f08366 commit ca736b1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ICAFIX/scripts/functionhighpassandvariancenormalize.m
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ function functionhighpassandvariancenormalize(TR,hp,fmri,WBC,varargin)
ctsX=size(ctsfull,1); ctsY=size(ctsfull,2); ctsZ=size(ctsfull,3); ctsT=size(ctsfull,4);
ctsfull=reshape(ctsfull,ctsX*ctsY*ctsZ,ctsT);
ctsmask=range(ctsfull, 2) > 0;
fprintf('Non-empty voxels: %d (= %.2f%% of %d)\n', sum(ctsmask), 100*sum(ctsmask)/size(ctsfull,1), size(ctsfull,1));
cts=ctsfull(ctsmask,:);
clear ctsfull;

Expand Down Expand Up @@ -152,6 +153,7 @@ function functionhighpassandvariancenormalize(TR,hp,fmri,WBC,varargin)
ctsX=size(ctsfull,1); ctsY=size(ctsfull,2); ctsZ=size(ctsfull,3); ctsT=size(ctsfull,4);
ctsfull=reshape(ctsfull,ctsX*ctsY*ctsZ,ctsT);
ctsmask=range(ctsfull, 2) > 0;
fprintf('Non-empty voxels: %d (= %.2f%% of %d)\n', sum(ctsmask), 100*sum(ctsmask)/size(ctsfull,1), size(ctsfull,1));
cts=ctsfull(ctsmask,:);
clear ctsfull;
end
Expand All @@ -171,6 +173,7 @@ function functionhighpassandvariancenormalize(TR,hp,fmri,WBC,varargin)
ctsX=size(ctsfull,1); ctsY=size(ctsfull,2); ctsZ=size(ctsfull,3); ctsT=size(ctsfull,4);
ctsfull=reshape(ctsfull,ctsX*ctsY*ctsZ,ctsT);
ctsmask=range(ctsfull, 2) > 0;
fprintf('Non-empty voxels: %d (= %.2f%% of %d)\n', sum(ctsmask), 100*sum(ctsmask)/size(ctsfull,1), size(ctsfull,1));
cts=ctsfull(ctsmask,:);
clear ctsfull;

Expand Down
2 changes: 2 additions & 0 deletions ICAFIX/scripts/icaDim.m
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,10 @@

% Apply mask, if it is helpful
if useMask
fprintf('icaDim: Non-empty voxels: %d (= %.2f%% of %d). Masking for memory efficiency.\n', sum(mask), 100*sum(mask)/NvoxOrig, NvoxOrig);
data = Origdata(mask,:);
else
fprintf('icaDim: No empty voxels -- not masking\n');
data = Origdata; % "copying" the input as-is doesn't use any memory
clear mask;
end
Expand Down

0 comments on commit ca736b1

Please sign in to comment.