Is mean a mathematical function? I know it is a command in many computer programs, but am I allowed to use it e.g. in a thesis? i.e. would it be correct to write $\mathrm{mean}(x_i)$ instead of $\frac{1}{n}\sum_{i=1}^n x_i$ ?
Edit: I want to express the average pixel value of an arbitrary-shaped region of interest of an image. To be precise I would probably have to write something like $$\bar{I}=\frac{1}{X}\frac{1}{Y}\sum_{x=1}^X\sum_{y=1}^Y I(x,y)\vert x,y \in \mathit{ROI}$$ which does not look very comprehensible to me.
You can use any notation you like, as long as you explain what it means (and as long as it's unambiguous enough that it's clear what you mean when you use it). Of course, where widely used standard notation exists, it's generally preferable to use it as long as it serves the purpose well. But if you find the "standard" notation to work poorly (e.g. to hurt readability by burying the relevant information in a mass of unnecessary boilerplate) it's perfectly fine to use less common notation instead, or even to invent your own.
That said, personally, I find your $\operatorname{mean}(x_i)$ to be somewhat ambiguous, in that it doesn't explicitly indicate what the mean is to be taken over. Something like $\underset{i \in S}{\operatorname{mean}}(x_i)$ would be clearer in this respect.
(Also, I'm more used to seeing $\operatorname{avg}$ instead of $\operatorname{mean}$ used for this, but either name should be understandable as long as you remember to define it.)