Updated Below
In my thesis, I am discussing an image processing mask, which is a matrix of the same size as some image but with ones where that image meets some criteria and zeroes elsewhere. I am wondering what is a good way to describe such a matrix mathematically?
As an example, suppose I have two grayscale images Z1 and Z2, and a matrix M_BothSat that has ones wherever both images are above some saturation threshold t_OS. How would I describe M_BothSat so that
- It's clear what M_BothSat is.
- The notation is rigorous enough mathematically for an engineering master's thesis.
- I can define more masks in the future without introducing ambiguity or conflicting definitions with earlier masks.
I realize this is more a math question than Latex, but I'm betting this is the best place to get an answer to it.
I have included an example of what I'm trying to do below, and several different options I've looked at that all say the same thing in different ways. The red text is my thoughts on each, the black is what I'm proposing using in my thesis. Can anyone either tell me which of these approaches is the best, or suggest another better form of notation, that would be great. My set notation's a little rusty. Thanks.
\documentclass[12pt, oneside]{report}
\usepackage[english]{babel}
\usepackage{blindtext}
\usepackage{color}
\usepackage{amsmath}
\newcommand{\mat}[1]{\ensuremath{\mathbf{#1}}}
\begin{document}
\textcolor{red}{
\textbf{Option 0}
This option uses a combination of plain english and math equation. It works nicely for here, but I'm going to define a series of logical masks $\mat{M}$, and seems it will be confusing to redefine $m_{i,j}$ repeatedly.
}
The areas \textit{saturated in both} images are given by the set $\mat{M}_{BothSat}$ of logical values $m_{i,j}$ such that
\begin{equation}
m_{i,j} = \begin{cases} 1 & \text{if} \quad z_{i,j,1} > t_{OS} , z_{i,j,2} > t_{OS} \\
0 & \text{if} \quad \text{else}
\end{cases},
\end{equation}
\textcolor{red}{
\textbf{Option 1}
This expresses what I'm trying to say: $\mat{M}_{BothSat}$ is a matrix the same size as $\mat{Z}$, with ones where $\mat{Z_1}$ and $\mat{Z_2}$ are both less than some threshold $t_{OS}$. However, to my eye this looks horrible. with the two opening squiggly braces. If the one beginning the cases could be made thinner, so that the one closing the overall set is less ambiguous, that might work. }
\begin{equation}
\mat{M}_{BothSat} = \left\{ m_{i,j} | m_{i,j} = \begin{cases} 1 & \text{if} \quad z_{i,j,1} > t_{OS} , z_{i,j,2} > t_{OS} \\
0 & \text{if} \quad \text{else}
\end{cases}
\right\},
\end{equation}
\textcolor{red}{
\textbf{Option 2}
This tries to say the same thing, but breaking it apart into two equations. Will this option be confusing if I define a series of different masks $\mat{M}$ with equations like this where each one contains a line defining $m_{i,j}$? }
\begin{gather}
\mat{M}_{BothSat} = \left\{ m_{i,j} \right\} \nonumber
\\m_{i,j} = \begin{cases} 1 & \text{if} \quad z_{i,j,1} > t_{OS} , z_{i,j,2} > t_{OS} \\
0 & \text{if} \quad \text{else}
\end{cases},
\end{gather}
\end{document}
Update
I found another post on here about modifying the cases environment, and I used that approach to add a closing brace to the cases environment so it can be placed inside a set notation, thereby making the set's closing brace slightly less visually confusing. Any feedback? Here's an example:
\documentclass{article}
\usepackage[english]{babel}
\usepackage{amsmath}
\DeclareMathOperator{\rank}{rank}
\makeatletter
\newenvironment{closedcases}{%
\matrix@check\closedcases\env@closedcases
}{%
\endarray\right\}% \right\lrack
}
\def\env@closedcases{%
\let\@ifnextchar\new@ifnextchar
\left\{
\def\arraystretch{1.2}%
\array{@{}l@{\quad}l@{}}%
}
\makeatother
\newcommand{\mat}[1]{\ensuremath{\mathbf{#1}}}
\begin{document}
\begin{equation}
\mat{M}_{BothSat} = \left\{ m_{i,j} | m_{i,j} = \begin{closedcases} 1 & \text{if} \quad z_{i,j,1} > t_{OS} , z_{i,j,2} > t_{OS} \\
0 & \text{else}
\end{closedcases}
\right\},
\end{equation}
\end{document}



Undefined control sequence. l.17 \global\@altsecnumformattrue. – N.N. Aug 08 '11 at 16:53