Skip to content
Snippets Groups Projects
Commit e8d1aa31 authored by Nicola Vigano's avatar Nicola Vigano Committed by Jean Balmon
Browse files

Thresholding: fixed uniform output for grains that don't get segmented

parent 909159ce
No related branches found
No related tags found
No related merge requests found
...@@ -105,7 +105,7 @@ classdef GtThreshold < handle ...@@ -105,7 +105,7 @@ classdef GtThreshold < handle
if (isempty(grain_seg.seg)) if (isempty(grain_seg.seg))
fprintf('\n\nWarning! Empty volume in grain %d.\n\n',grainID); fprintf('\n\nWarning! Empty volume in grain %d.\n\n',grainID);
gauge.rePrint(); gauge.rePrint();
grain_seg.seg = 1; grain_seg.seg = ones(1, 1, 1, 'uint8');
grain_seg.segbb = round([(size(grain_rec.vol) -1), (size(grain_rec.vol) +1)] /2); grain_seg.segbb = round([(size(grain_rec.vol) -1), (size(grain_rec.vol) +1)] /2);
end end
sample.phases{phaseID}.setBoundingBox(grainID, grain_seg.segbb); sample.phases{phaseID}.setBoundingBox(grainID, grain_seg.segbb);
...@@ -159,7 +159,7 @@ classdef GtThreshold < handle ...@@ -159,7 +159,7 @@ classdef GtThreshold < handle
if isempty(grain_seg.seg) if isempty(grain_seg.seg)
fprintf('\n\nWarning! Empty volume in grain %d.\n\n', grainID); fprintf('\n\nWarning! Empty volume in grain %d.\n\n', grainID);
grain_seg.seg = 1; grain_seg.seg = ones(1, 1, 1, 'uint8');
grain_seg.segbb = round([(size(grain_rec.vol) -1), (size(grain_rec.vol) +1)] /2); grain_seg.segbb = round([(size(grain_rec.vol) -1), (size(grain_rec.vol) +1)] /2);
end end
...@@ -181,7 +181,7 @@ classdef GtThreshold < handle ...@@ -181,7 +181,7 @@ classdef GtThreshold < handle
if isempty(grain_seg.seg) if isempty(grain_seg.seg)
fprintf('\n\nWarning! Empty volume in grain %d.\n\n',grainID); fprintf('\n\nWarning! Empty volume in grain %d.\n\n',grainID);
grain_seg.seg = ones(1, 'uint8'); grain_seg.seg = ones(1, 1, 1, 'uint8');
grain_seg.segbb = round([(size(grain_rec.vol) -1), (size(grain_rec.vol) +1)] /2); grain_seg.segbb = round([(size(grain_rec.vol) -1), (size(grain_rec.vol) +1)] /2);
end end
sample.phases{phaseID}.setBoundingBox(grainID, grain_seg.segbb); sample.phases{phaseID}.setBoundingBox(grainID, grain_seg.segbb);
...@@ -240,7 +240,7 @@ classdef GtThreshold < handle ...@@ -240,7 +240,7 @@ classdef GtThreshold < handle
if isempty(cl_seg(1).seg) if isempty(cl_seg(1).seg)
fprintf('\n\nWarning! Empty volume in cluster (%s).\n\n', str_ids); fprintf('\n\nWarning! Empty volume in cluster (%s).\n\n', str_ids);
cl_seg(1).seg = ones(1, 'uint8'); cl_seg(1).seg = ones(1, 1, 1, 'uint8');
cl_seg(1).segbb = round([(size(cl_rec.vol) -1), (size(cl_rec.vol) +1)] /2); cl_seg(1).segbb = round([(size(cl_rec.vol) -1), (size(cl_rec.vol) +1)] /2);
end end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment