Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion aa_modules/aamod_mask_fromsegment.m
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,13 @@
thr = aas_getsetting(aap,'threshold');
if numel(thr) == 1, thr(1:3) = thr; end
for a = 1:size(segimg,1)
maxY = max(Y{a}(:));
Y{a} = Y{a} > thr(a);


if numel(Y{a} > 0) == 0 % check for bad thesholding
aas_log(aap, true, sprintf('ERROR: No voxels above the threshold mask (%f) [max: %f]', thr(a), maxY))
end

V{a}.fname = spm_file(segimg(a,:),'prefix','S_r');
outstream = strvcat(outstream, V{a}.fname); % Save to stream...
spm_write_vol(V{a}, Y{a});
Expand Down
7 changes: 6 additions & 1 deletion aa_modules/aamod_mask_fromstruct.m
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,11 @@
for a = 1:size(SEGimg,1)
[pth, fn, ext] = fileparts(SEGimg(a,:));

maxY = max(Y{a}(:));
if numel(Y{a} > 0) == 0 % check for bad thesholding
aas_log(aap, true, sprintf('ERROR: No voxels above the threshold mask (%f) [max: %f]', thr(a), maxY))
end

if ~isempty(strfind(fn(1), 'w'))
eY = WeY == a;
else
Expand All @@ -167,4 +172,4 @@
aap = aas_desc_outputs(aap,subj,'segmasksStrict',Soutstream);
aap = aas_desc_outputs(aap,subj,'segmasksExclusive',Eoutstream);

end
end