function h = preprocdlg(varargin)

%% Show the (singleton) preproc dialog

persistent dlg;

%% If necessary build the merge dialog
if isempty(dlg) || ~ishandle(dlg)
    dlg = tsguis.preprocdlg;
    if nargin>=1
        % The viewnode must be set for the viewnode grandparent to be set
        dlg.ViewNode = varargin{1};
        dlg.initialize
        centerfig(dlg.Figure,0);
    end
elseif nargin>=1
    dlg.ViewNode = varargin{1};
end
%% Return the handle
h = dlg;