Everything is counted. It depends upon the PR of the linking page of article / directory and similarity of the niches of your site with that of article / directory.
that really depends on the directory and the article. but normally, link from article is more valuable since the article has the same content as your site.