function argout = sample_description(s, name)
%SAXS/SAMPLE_DESCRIPTION Set or retrieve the sample description for SAXS image.
%   SAMPLE_DESCRIPTION_FILENAME(S) returns the sample description for SAXS image S.
%
%   SAMPLE_DESCRIPTION_FILENAME(S, NAME) returns a SAXS image object copied from S with
%   sample_desctription.

switch nargin
case 1  % return transfact
    if ~ isa(s, 'saxs')
        error('The first argument must be a SAXS image object.')
    end
    argout = s.sample_description;
case 2  % set transfact
    if ~ isa(s, 'saxs')
        error('The first argument must be a SAXS image object.')
    end
    argout = s;
    if isstr(name)  == 1
        argout.sample_description = name;
    else
        error('The sample_description is not a string.')
    end
otherwise  % we don't understand
    error('I need one or two arguments.')
end
