Skip to content
Snippets Groups Projects
gt6DCreateProjDataFromExtendedGrains.m 1.73 KiB
Newer Older
function gt6DCreateProjDataFromExtendedGrains(first, last, workingdirectory, phaseID, parameters, varargin)
% FUNCTION [proj, refor, or] = gt6DCreateProjDataFromExtendedGrainss(first, last, workingdirectory, phase_id, varargin)
%   proj: is a grain.proj structure
%   refor: is a grain structure for the average orientation in the average
%       point
%   or: is a set of grain structures for the extreeme corners of the
%       orientation space that should be considered
    cd (workingdirectory);
    if (~exist('parameters','var') || isempty(parameters))
        parameters = gtLoadParameters();
    end

     conf = struct( ...
        'verbose', false, ...
        'min_eta', 20, ...
        'det_index', 1, ...
        'ospace_oversize', 1.1, ...
        'rspace_oversize', 1.1, ...
        'stack_oversize', 1.2, ...
        'ospace_lims', [], ...
        'include_all', false, ...
        'use_volume_mask', true, ...
        'save', false, ...
        'use_extended', true, ...
        'psf', [], ...
        'grain_ids', []);
    conf = parse_pv_pairs(conf, varargin);

    if isempty(conf.grain_ids)
        grains_list = first : last;
    else
        grains_list = conf.grain_ids;
    end

    check = inputwdefault('Launch Creation of Extended Grains via OAR? [y/n]', 'y');
    launch_on_OAR = strcmpi(check, 'y');

    if (launch_on_OAR)
        gtLaunchOnOAR('gt6DCreateProjDataFromExtendedGrain', first, last, phaseID_str, ...
                    parameters, 'njobs', 8, 'walltime', 3600 * 16, ...
                    'gpu', false, 'distribute', true, 'list', conf.grain_ids);
    else
        gt6DCreateProjDataFromExtendedGrain(first, last, pwd, phaseID, parameters.acq.dir, ...
                    parameters, 'grain_ids', conf.grain_ids);
    end

end