Skip to content

Commit

Permalink
Minor bugfixes to region()
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael-Sun committed Aug 15, 2024
1 parent 2595c02 commit 53d1382
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions CanlabCore/@region/region.m
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,14 @@

val_descrip = 'Statistic effect value (.dat) for each voxel.';

mask = replace_empty(mask); % after this p and dat now have all in-mask voxels
% mask = replace_empty(mask); % after this p and dat now have all in-mask voxels

try
mask = replace_empty(mask);
catch
warning('Could not call replace_empty() on mask.')
end


if ~isempty(mask.dat)
% Use values from image. These can be more precise and
Expand Down Expand Up @@ -463,7 +470,13 @@
% In addition, voxels/images with empty values may be removed.
% So insert those first.
% Note: .dat can sometimes have 2+ cols, so use only first one
mask = replace_empty(mask);

% mask = replace_empty(mask);
try
mask = replace_empty(mask);
catch
warning('Could not call replace_empty() on mask.')
end

if size(mask.dat, 2) > 1
disp('Warning: Mask has multiple images, will use first only.');
Expand All @@ -476,7 +489,7 @@
% We have a full-length vector
maskData = mask.dat(mask.volInfo.wh_inmask(:, 1));
else
error('Illegal size for mask.dat, because it does not match its volInfo structure.')
warning('Illegal size for mask.dat, because it does not match its volInfo structure.')
end

% If statistic_image, we need to consider thresholding
Expand Down

0 comments on commit 53d1382

Please sign in to comment.