Getting brands of a categorie (shop.categories.[ID].brands)?

Hi community,
I'm looking for a solution to get all brands of a categorie so we can add them to the navbar. Preferably sorted on amount of products it contains . Could be something like shop.categories.[ID].brands.
Help would be appreciated, thnx in advance!
UPDATE: sorry for the duplicated post, seems like something went wrong with creating the discussion