function coord = getCoordinate(mapping,subject,roi)
% getCoordinate(SubjectRoiMapping,subjectID,roiID) returns the coordinate
% for the given subject and the given roi. Both subjectID and roiID can
% either be a valid Name (see get[Sunject|Roi]NameCellList(mapping) ) or
% the corresponding numerical ID.

if ischar(subject) && ischar(roi)
    coord = getCoordinate(mapping,getSubjectID(mapping,subject),getRoiID(mapping,roi));
elseif isnumeric(subject) && ischar(roi)
    coord = getCoordinate(mapping,subject,getRoiID(mapping,roi));
elseif ischar(subject) && isnumeric(roi)
    coord = getCoordinate(mapping,getSubjectID(mapping,subject),roi);
elseif isnumeric(subject) && isnumeric(roi)
    coord = mapping.coordinate{subject}(roi,:);
    error('SubjectRoiMapping:getCoordinate:BadArguments','Subject has to be a valid subject identifier (either char or integer)');