Can I get a letter of recommendation from a professor who didn't teach me BUT I did research with?
The point of a letter of recommendation is for the receiving party to obtain third-party verification that you are, indeed, awesome. Generally speaking, people like to receive letters from individuals who know you well professionally. In most cases, teachers cannot write good letters, as they only know you as a face in the class, and never really got to know your work ethic, personality, and capabilities. A research advisor would be able to comment on all those things, and would be able to write a much stronger letter.