Skip to content
Snippets Groups Projects
Commit ba4833a4 authored by Nicola Vigano's avatar Nicola Vigano
Browse files

fixed small bugs

parent ede1d5fd
No related branches found
No related tags found
No related merge requests found
......@@ -422,30 +422,26 @@ classdef GtThreshold < handle
if (isfield(obj.param.rec, 'thresholding'))
thr_params = obj.param.rec.thresholding;
def_rec = gtRecDefaultParameters();
def_thr = def_rec.thresholding;
local_thr(1, :) = fieldnames(thr_params);
local_thr(2, :) = struct2cell(thr_params);
[thr_params, ~] = parse_pv_pairs(def_thr, local_thr(:));
else
warning('GtThreshold:old_params', ...
'Old "rec" parameters. You should produce a new version.')
thr_params = struct( ...
'percentile', obj.param.rec.percentile2, ...
'do_morph_recon', obj.param.rec.do_morph_recon, ...
'num_iter', 0, 'iter_factor', 1);
def_rec = gtRecDefaultParameters();
thr_params = def_rec.thresholding;
thr_params = parse_pv_pairs(thr_params, ...
{'percentile', obj.param.rec.percentile2, ...
'do_morph_recon', obj.param.rec.do_morph_recon});
end
if (~isfield(thr_params, 'do_extended'))
thr_params.do_extended = false;
end
if (~isfield(thr_params, 'percent_of_peak'))
thr_params.percent_of_peak = 2.5;
end
if (~isfield(thr_params, 'mask_border_voxels'))
thr_params.mask_border_voxels = 5;
end
if (~isfield(thr_params, 'use_levelsets'))
thr_params.use_levelsets = false;
end
end
function grain_seg = thresholdAutoSingleGrain(obj, grain_rec)
......
......@@ -72,6 +72,14 @@ classdef GtAssembleVol3D < handle
end
end
% Coping with older parameters
def_rec = gtRecDefaultParameters();
def_thr = def_rec.thresholding;
local_thr(1, :) = fieldnames(obj.parameters.rec.thresholding);
local_thr(2, :) = struct2cell(obj.parameters.rec.thresholding);
[def_thr, ~] = parse_pv_pairs(def_thr, local_thr(:));
obj.parameters.rec.thresholding = def_thr;
% Array of all the partial phase volumes
obj.volumes.phases = {};
% Complete volume: merge of all phases has two fields which really
......
......@@ -16,7 +16,7 @@ function par_rec = gtRecGrainsDefaultParameters(algo)
'detector_norm', 'l2', ... % Possibilities are: {'l2'} | 'kl' | 'l1'
'verbose', false ...
);
case {'6DL1', '6DTV', '6DTVL1'}
case {'6DLS', '6DL1', '6DTV', '6DTVL1'}
par_rec_opts = struct( ...
'ospace_resolution', 0.25, ...
'ospace_lims', [], ...
......
......@@ -339,7 +339,7 @@ switch (par.patchmode)
vol_bin = vol_bin | (grains == grainids(ii));
end
gauge.delete();
disp('Creating isosurface...')
vol_smooth = smooth3(vol_bin, 'box', 3);
isoSurf = isosurface(vol_smooth, 0.5);
......@@ -347,7 +347,7 @@ switch (par.patchmode)
verts = get(h.patch, 'vertices');
% Dilation needed before interpolation.
grainsRegion = grains .* int16(vol_bin);
grainsRegion = int16(grains) .* int16(vol_bin);
% Image Processing Toolbox license test before callling imdilate.
% This is to avoid crashing when no license is available.
......
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