I am having problems connecting the following 3 concepts:

2. Optically thin and optically thick mediums.
3. Local thermodynamic equilibrium (LTE) and thermodynamic equilibrium (TE).

I am trying to work out how these are connected. e.g. if you have a optically thin medium in TE does it produce blackbody or thermal radiation. Given that I can't even seem to find clear definitions of each of these properties I am having no luck in this task. Thus my question is this: How are the properties in the list above linked? (definitions would also be helpful)

1for simplicity I am taking the term thermal radiation to exclude blackbody radiation. (non-standard)