Commit e4dca3a3 authored by Edwin Carlinet's avatar Edwin Carlinet
Browse files

Merge branch 'development/extinction' into 'development/ranges'

Extinction and dynamic filters.

See merge request !80
parents 766beb75 64fee302
Pipeline #14184 canceled with stages
in 13 seconds
This diff is collapsed.
\documentclass[svgnames,tikz]{standalone}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}[yscale=1]
\def\signalA{3,1,4,3,6,4,5,3,4,2,3,3,7,7}
\def\signalB{0,6,0,1,0,1,0,1,0,4,0,0,0,0}
\begin{axis}[
x=1cm,y=1cm,
xmin=0,xmax=14,
ymin=0,ymax=10,
xtick={\empty},ytick={},
]
\end{axis}
\draw[blue] (0,0) foreach[count=\x] \y in \signalA { |- (\x,\y) } -- (\x,0);
\foreach[evaluate=\i as \yA using {{\signalA}[\i]},
evaluate=\i as \yB using {{\signalB}[\i]}] \i in {0,...,13}
{
\draw[red,ultra thick] (\i,\yA) ++(+.5,0) edge[<->] ++(0,\yB);
}
\draw[dashed,red,thin] (4,6) -- (12,6);
\draw[dashed,red,thin] (0,7) -- (12,7);
\end{tikzpicture}
\end{document}
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="470.546pt" height="296.526pt" viewBox="0 0 470.546 296.526" version="1.1">
<defs>
<g>
<symbol overflow="visible" id="glyph0-0">
<path style="stroke:none;" d=""/>
</symbol>
<symbol overflow="visible" id="glyph0-1">
<path style="stroke:none;" d="M 4.578125 -3.1875 C 4.578125 -3.984375 4.53125 -4.78125 4.1875 -5.515625 C 3.734375 -6.484375 2.90625 -6.640625 2.5 -6.640625 C 1.890625 -6.640625 1.171875 -6.375 0.75 -5.453125 C 0.4375 -4.765625 0.390625 -3.984375 0.390625 -3.1875 C 0.390625 -2.4375 0.421875 -1.546875 0.84375 -0.78125 C 1.265625 0.015625 2 0.21875 2.484375 0.21875 C 3.015625 0.21875 3.78125 0.015625 4.21875 -0.9375 C 4.53125 -1.625 4.578125 -2.40625 4.578125 -3.1875 Z M 2.484375 0 C 2.09375 0 1.5 -0.25 1.328125 -1.203125 C 1.21875 -1.796875 1.21875 -2.71875 1.21875 -3.3125 C 1.21875 -3.953125 1.21875 -4.609375 1.296875 -5.140625 C 1.484375 -6.328125 2.234375 -6.421875 2.484375 -6.421875 C 2.8125 -6.421875 3.46875 -6.234375 3.65625 -5.25 C 3.765625 -4.6875 3.765625 -3.9375 3.765625 -3.3125 C 3.765625 -2.5625 3.765625 -1.890625 3.65625 -1.25 C 3.5 -0.296875 2.9375 0 2.484375 0 Z M 2.484375 0 "/>
</symbol>
<symbol overflow="visible" id="glyph0-2">
<path style="stroke:none;" d="M 2.9375 -6.375 C 2.9375 -6.625 2.9375 -6.640625 2.703125 -6.640625 C 2.078125 -6 1.203125 -6 0.890625 -6 L 0.890625 -5.6875 C 1.09375 -5.6875 1.671875 -5.6875 2.1875 -5.953125 L 2.1875 -0.78125 C 2.1875 -0.421875 2.15625 -0.3125 1.265625 -0.3125 L 0.953125 -0.3125 L 0.953125 0 C 1.296875 -0.03125 2.15625 -0.03125 2.5625 -0.03125 C 2.953125 -0.03125 3.828125 -0.03125 4.171875 0 L 4.171875 -0.3125 L 3.859375 -0.3125 C 2.953125 -0.3125 2.9375 -0.421875 2.9375 -0.78125 Z M 2.9375 -6.375 "/>
</symbol>
<symbol overflow="visible" id="glyph0-3">
<path style="stroke:none;" d="M 1.265625 -0.765625 L 2.328125 -1.796875 C 3.875 -3.171875 4.46875 -3.703125 4.46875 -4.703125 C 4.46875 -5.84375 3.578125 -6.640625 2.359375 -6.640625 C 1.234375 -6.640625 0.5 -5.71875 0.5 -4.828125 C 0.5 -4.28125 1 -4.28125 1.03125 -4.28125 C 1.203125 -4.28125 1.546875 -4.390625 1.546875 -4.8125 C 1.546875 -5.0625 1.359375 -5.328125 1.015625 -5.328125 C 0.9375 -5.328125 0.921875 -5.328125 0.890625 -5.3125 C 1.109375 -5.96875 1.65625 -6.328125 2.234375 -6.328125 C 3.140625 -6.328125 3.5625 -5.515625 3.5625 -4.703125 C 3.5625 -3.90625 3.078125 -3.125 2.515625 -2.5 L 0.609375 -0.375 C 0.5 -0.265625 0.5 -0.234375 0.5 0 L 4.203125 0 L 4.46875 -1.734375 L 4.234375 -1.734375 C 4.171875 -1.4375 4.109375 -1 4 -0.84375 C 3.9375 -0.765625 3.28125 -0.765625 3.0625 -0.765625 Z M 1.265625 -0.765625 "/>
</symbol>
<symbol overflow="visible" id="glyph0-4">
<path style="stroke:none;" d="M 2.890625 -3.515625 C 3.703125 -3.78125 4.28125 -4.46875 4.28125 -5.265625 C 4.28125 -6.078125 3.40625 -6.640625 2.453125 -6.640625 C 1.453125 -6.640625 0.6875 -6.046875 0.6875 -5.28125 C 0.6875 -4.953125 0.90625 -4.765625 1.203125 -4.765625 C 1.5 -4.765625 1.703125 -4.984375 1.703125 -5.28125 C 1.703125 -5.765625 1.234375 -5.765625 1.09375 -5.765625 C 1.390625 -6.265625 2.046875 -6.390625 2.40625 -6.390625 C 2.828125 -6.390625 3.375 -6.171875 3.375 -5.28125 C 3.375 -5.15625 3.34375 -4.578125 3.09375 -4.140625 C 2.796875 -3.65625 2.453125 -3.625 2.203125 -3.625 C 2.125 -3.609375 1.890625 -3.59375 1.8125 -3.59375 C 1.734375 -3.578125 1.671875 -3.5625 1.671875 -3.46875 C 1.671875 -3.359375 1.734375 -3.359375 1.90625 -3.359375 L 2.34375 -3.359375 C 3.15625 -3.359375 3.53125 -2.6875 3.53125 -1.703125 C 3.53125 -0.34375 2.84375 -0.0625 2.40625 -0.0625 C 1.96875 -0.0625 1.21875 -0.234375 0.875 -0.8125 C 1.21875 -0.765625 1.53125 -0.984375 1.53125 -1.359375 C 1.53125 -1.71875 1.265625 -1.921875 0.984375 -1.921875 C 0.734375 -1.921875 0.421875 -1.78125 0.421875 -1.34375 C 0.421875 -0.4375 1.34375 0.21875 2.4375 0.21875 C 3.65625 0.21875 4.5625 -0.6875 4.5625 -1.703125 C 4.5625 -2.515625 3.921875 -3.296875 2.890625 -3.515625 Z M 2.890625 -3.515625 "/>
</symbol>
<symbol overflow="visible" id="glyph0-5">
<path style="stroke:none;" d="M 2.9375 -1.640625 L 2.9375 -0.78125 C 2.9375 -0.421875 2.90625 -0.3125 2.171875 -0.3125 L 1.96875 -0.3125 L 1.96875 0 C 2.375 -0.03125 2.890625 -0.03125 3.3125 -0.03125 C 3.734375 -0.03125 4.25 -0.03125 4.671875 0 L 4.671875 -0.3125 L 4.453125 -0.3125 C 3.71875 -0.3125 3.703125 -0.421875 3.703125 -0.78125 L 3.703125 -1.640625 L 4.6875 -1.640625 L 4.6875 -1.953125 L 3.703125 -1.953125 L 3.703125 -6.484375 C 3.703125 -6.6875 3.703125 -6.75 3.53125 -6.75 C 3.453125 -6.75 3.421875 -6.75 3.34375 -6.625 L 0.28125 -1.953125 L 0.28125 -1.640625 Z M 2.984375 -1.953125 L 0.5625 -1.953125 L 2.984375 -5.671875 Z M 2.984375 -1.953125 "/>
</symbol>
<symbol overflow="visible" id="glyph0-6">
<path style="stroke:none;" d="M 4.46875 -2 C 4.46875 -3.1875 3.65625 -4.1875 2.578125 -4.1875 C 2.109375 -4.1875 1.671875 -4.03125 1.3125 -3.671875 L 1.3125 -5.625 C 1.515625 -5.5625 1.84375 -5.5 2.15625 -5.5 C 3.390625 -5.5 4.09375 -6.40625 4.09375 -6.53125 C 4.09375 -6.59375 4.0625 -6.640625 3.984375 -6.640625 C 3.984375 -6.640625 3.953125 -6.640625 3.90625 -6.609375 C 3.703125 -6.515625 3.21875 -6.3125 2.546875 -6.3125 C 2.15625 -6.3125 1.6875 -6.390625 1.21875 -6.59375 C 1.140625 -6.625 1.125 -6.625 1.109375 -6.625 C 1 -6.625 1 -6.546875 1 -6.390625 L 1 -3.4375 C 1 -3.265625 1 -3.1875 1.140625 -3.1875 C 1.21875 -3.1875 1.234375 -3.203125 1.28125 -3.265625 C 1.390625 -3.421875 1.75 -3.96875 2.5625 -3.96875 C 3.078125 -3.96875 3.328125 -3.515625 3.40625 -3.328125 C 3.5625 -2.953125 3.59375 -2.578125 3.59375 -2.078125 C 3.59375 -1.71875 3.59375 -1.125 3.34375 -0.703125 C 3.109375 -0.3125 2.734375 -0.0625 2.28125 -0.0625 C 1.5625 -0.0625 0.984375 -0.59375 0.8125 -1.171875 C 0.84375 -1.171875 0.875 -1.15625 0.984375 -1.15625 C 1.3125 -1.15625 1.484375 -1.40625 1.484375 -1.640625 C 1.484375 -1.890625 1.3125 -2.140625 0.984375 -2.140625 C 0.84375 -2.140625 0.5 -2.0625 0.5 -1.609375 C 0.5 -0.75 1.1875 0.21875 2.296875 0.21875 C 3.453125 0.21875 4.46875 -0.734375 4.46875 -2 Z M 4.46875 -2 "/>
</symbol>
<symbol overflow="visible" id="glyph0-7">
<path style="stroke:none;" d="M 1.3125 -3.265625 L 1.3125 -3.515625 C 1.3125 -6.03125 2.546875 -6.390625 3.0625 -6.390625 C 3.296875 -6.390625 3.71875 -6.328125 3.9375 -5.984375 C 3.78125 -5.984375 3.390625 -5.984375 3.390625 -5.546875 C 3.390625 -5.234375 3.625 -5.078125 3.84375 -5.078125 C 4 -5.078125 4.3125 -5.171875 4.3125 -5.5625 C 4.3125 -6.15625 3.875 -6.640625 3.046875 -6.640625 C 1.765625 -6.640625 0.421875 -5.359375 0.421875 -3.15625 C 0.421875 -0.484375 1.578125 0.21875 2.5 0.21875 C 3.609375 0.21875 4.5625 -0.71875 4.5625 -2.03125 C 4.5625 -3.296875 3.671875 -4.25 2.5625 -4.25 C 1.890625 -4.25 1.515625 -3.75 1.3125 -3.265625 Z M 2.5 -0.0625 C 1.875 -0.0625 1.578125 -0.65625 1.515625 -0.8125 C 1.328125 -1.28125 1.328125 -2.078125 1.328125 -2.25 C 1.328125 -3.03125 1.65625 -4.03125 2.546875 -4.03125 C 2.71875 -4.03125 3.171875 -4.03125 3.484375 -3.40625 C 3.65625 -3.046875 3.65625 -2.53125 3.65625 -2.046875 C 3.65625 -1.5625 3.65625 -1.0625 3.484375 -0.703125 C 3.1875 -0.109375 2.734375 -0.0625 2.5 -0.0625 Z M 2.5 -0.0625 "/>
</symbol>
<symbol overflow="visible" id="glyph0-8">
<path style="stroke:none;" d="M 4.75 -6.078125 C 4.828125 -6.1875 4.828125 -6.203125 4.828125 -6.421875 L 2.40625 -6.421875 C 1.203125 -6.421875 1.171875 -6.546875 1.140625 -6.734375 L 0.890625 -6.734375 L 0.5625 -4.6875 L 0.8125 -4.6875 C 0.84375 -4.84375 0.921875 -5.46875 1.0625 -5.59375 C 1.125 -5.65625 1.90625 -5.65625 2.03125 -5.65625 L 4.09375 -5.65625 C 3.984375 -5.5 3.203125 -4.40625 2.984375 -4.078125 C 2.078125 -2.734375 1.75 -1.34375 1.75 -0.328125 C 1.75 -0.234375 1.75 0.21875 2.21875 0.21875 C 2.671875 0.21875 2.671875 -0.234375 2.671875 -0.328125 L 2.671875 -0.84375 C 2.671875 -1.390625 2.703125 -1.9375 2.78125 -2.46875 C 2.828125 -2.703125 2.953125 -3.5625 3.40625 -4.171875 Z M 4.75 -6.078125 "/>
</symbol>
<symbol overflow="visible" id="glyph0-9">
<path style="stroke:none;" d="M 1.625 -4.5625 C 1.171875 -4.859375 1.125 -5.1875 1.125 -5.359375 C 1.125 -5.96875 1.78125 -6.390625 2.484375 -6.390625 C 3.203125 -6.390625 3.84375 -5.875 3.84375 -5.15625 C 3.84375 -4.578125 3.453125 -4.109375 2.859375 -3.765625 Z M 3.078125 -3.609375 C 3.796875 -3.984375 4.28125 -4.5 4.28125 -5.15625 C 4.28125 -6.078125 3.40625 -6.640625 2.5 -6.640625 C 1.5 -6.640625 0.6875 -5.90625 0.6875 -4.96875 C 0.6875 -4.796875 0.703125 -4.34375 1.125 -3.875 C 1.234375 -3.765625 1.609375 -3.515625 1.859375 -3.34375 C 1.28125 -3.046875 0.421875 -2.5 0.421875 -1.5 C 0.421875 -0.453125 1.4375 0.21875 2.484375 0.21875 C 3.609375 0.21875 4.5625 -0.609375 4.5625 -1.671875 C 4.5625 -2.03125 4.453125 -2.484375 4.0625 -2.90625 C 3.875 -3.109375 3.71875 -3.203125 3.078125 -3.609375 Z M 2.078125 -3.1875 L 3.3125 -2.40625 C 3.59375 -2.21875 4.0625 -1.921875 4.0625 -1.3125 C 4.0625 -0.578125 3.3125 -0.0625 2.5 -0.0625 C 1.640625 -0.0625 0.921875 -0.671875 0.921875 -1.5 C 0.921875 -2.078125 1.234375 -2.71875 2.078125 -3.1875 Z M 2.078125 -3.1875 "/>
</symbol>
<symbol overflow="visible" id="glyph0-10">
<path style="stroke:none;" d="M 3.65625 -3.171875 L 3.65625 -2.84375 C 3.65625 -0.515625 2.625 -0.0625 2.046875 -0.0625 C 1.875 -0.0625 1.328125 -0.078125 1.0625 -0.421875 C 1.5 -0.421875 1.578125 -0.703125 1.578125 -0.875 C 1.578125 -1.1875 1.34375 -1.328125 1.125 -1.328125 C 0.96875 -1.328125 0.671875 -1.25 0.671875 -0.859375 C 0.671875 -0.1875 1.203125 0.21875 2.046875 0.21875 C 3.34375 0.21875 4.5625 -1.140625 4.5625 -3.28125 C 4.5625 -5.96875 3.40625 -6.640625 2.515625 -6.640625 C 1.96875 -6.640625 1.484375 -6.453125 1.0625 -6.015625 C 0.640625 -5.5625 0.421875 -5.140625 0.421875 -4.390625 C 0.421875 -3.15625 1.296875 -2.171875 2.40625 -2.171875 C 3.015625 -2.171875 3.421875 -2.59375 3.65625 -3.171875 Z M 2.421875 -2.40625 C 2.265625 -2.40625 1.796875 -2.40625 1.5 -3.03125 C 1.3125 -3.40625 1.3125 -3.890625 1.3125 -4.390625 C 1.3125 -4.921875 1.3125 -5.390625 1.53125 -5.765625 C 1.796875 -6.265625 2.171875 -6.390625 2.515625 -6.390625 C 2.984375 -6.390625 3.3125 -6.046875 3.484375 -5.609375 C 3.59375 -5.28125 3.640625 -4.65625 3.640625 -4.203125 C 3.640625 -3.375 3.296875 -2.40625 2.421875 -2.40625 Z M 2.421875 -2.40625 "/>
</symbol>
</g>
<clipPath id="clip1">
<path d="M 16 6 L 470.546875 6 L 470.546875 291 L 16 291 Z M 16 6 "/>
</clipPath>
<clipPath id="clip2">
<path d="M 16 148 L 470.546875 148 L 470.546875 290 L 16 290 Z M 16 148 "/>
</clipPath>
<clipPath id="clip3">
<path d="M 16 148 L 470.546875 148 L 470.546875 291 L 16 291 Z M 16 148 "/>
</clipPath>
<clipPath id="clip4">
<path d="M 16 63 L 470.546875 63 L 470.546875 291 L 16 291 Z M 16 63 "/>
</clipPath>
</defs>
<g id="surface1">
<g clip-path="url(#clip1)" clip-rule="nonzero">
<path style="fill:none;stroke-width:0.19925;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(50%,50%,50%);stroke-opacity:1;stroke-miterlimit:10;" d="M 0.0016875 -0.00109375 L 4.251687 -0.00109375 M 0.0016875 28.346562 L 4.251687 28.346562 M 0.0016875 56.694219 L 4.251687 56.694219 M 0.0016875 85.041875 L 4.251687 85.041875 M 0.0016875 113.385625 L 4.251687 113.385625 M 0.0016875 141.733281 L 4.251687 141.733281 M 0.0016875 170.080937 L 4.251687 170.080937 M 0.0016875 198.428594 L 4.251687 198.428594 M 0.0016875 226.77625 L 4.251687 226.77625 M 0.0016875 255.12 L 4.251687 255.12 M 0.0016875 283.467656 L 4.251687 283.467656 M 453.548563 -0.00109375 L 449.298563 -0.00109375 M 453.548563 28.346562 L 449.298563 28.346562 M 453.548563 56.694219 L 449.298563 56.694219 M 453.548563 85.041875 L 449.298563 85.041875 M 453.548563 113.385625 L 449.298563 113.385625 M 453.548563 141.733281 L 449.298563 141.733281 M 453.548563 170.080937 L 449.298563 170.080937 M 453.548563 198.428594 L 449.298563 198.428594 M 453.548563 226.77625 L 449.298563 226.77625 M 453.548563 255.12 L 449.298563 255.12 M 453.548563 283.467656 L 449.298563 283.467656 " transform="matrix(1,0,0,-1,16.803,289.995)"/>
<path style="fill:none;stroke-width:0.3985;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;" d="M 0.0016875 -0.00109375 L 0.0016875 283.467656 L 453.548563 283.467656 L 453.548563 -0.00109375 Z M 0.0016875 -0.00109375 " transform="matrix(1,0,0,-1,16.803,289.995)"/>
</g>
<g style="fill:rgb(0%,0%,0%);fill-opacity:1;">
<use xlink:href="#glyph0-1" x="8.302" y="293.205"/>
</g>
<g style="fill:rgb(0%,0%,0%);fill-opacity:1;">
<use xlink:href="#glyph0-2" x="8.302" y="264.859"/>
</g>
<g style="fill:rgb(0%,0%,0%);fill-opacity:1;">
<use xlink:href="#glyph0-3" x="8.302" y="236.513"/>
</g>
<g style="fill:rgb(0%,0%,0%);fill-opacity:1;">
<use xlink:href="#glyph0-4" x="8.302" y="208.166"/>
</g>
<g style="fill:rgb(0%,0%,0%);fill-opacity:1;">
<use xlink:href="#glyph0-5" x="8.302" y="179.82"/>
</g>
<g style="fill:rgb(0%,0%,0%);fill-opacity:1;">
<use xlink:href="#glyph0-6" x="8.302" y="151.473"/>
</g>
<g style="fill:rgb(0%,0%,0%);fill-opacity:1;">
<use xlink:href="#glyph0-7" x="8.302" y="123.127"/>
</g>
<g style="fill:rgb(0%,0%,0%);fill-opacity:1;">
<use xlink:href="#glyph0-8" x="8.302" y="94.78"/>
</g>
<g style="fill:rgb(0%,0%,0%);fill-opacity:1;">
<use xlink:href="#glyph0-9" x="8.302" y="66.434"/>
</g>
<g style="fill:rgb(0%,0%,0%);fill-opacity:1;">
<use xlink:href="#glyph0-10" x="8.302" y="38.087"/>
</g>
<g style="fill:rgb(0%,0%,0%);fill-opacity:1;">
<use xlink:href="#glyph0-2" x="3.321" y="9.741"/>
<use xlink:href="#glyph0-1" x="8.3023" y="9.741"/>
</g>
<g clip-path="url(#clip2)" clip-rule="nonzero">
<path style=" stroke:none;fill-rule:nonzero;fill:rgb(79.998779%,79.998779%,79.998779%);fill-opacity:1;" d="M 16.804688 289.996094 L 16.804688 204.953125 L 45.148438 204.953125 L 45.148438 176.609375 L 130.191406 176.609375 L 130.191406 204.953125 L 186.882812 204.953125 L 186.882812 176.609375 L 215.230469 176.609375 L 215.230469 148.261719 L 413.660156 148.261719 L 413.660156 204.953125 L 442.003906 204.953125 L 442.003906 261.648438 L 470.351562 261.648438 L 470.351562 289.996094 "/>
</g>
<g clip-path="url(#clip3)" clip-rule="nonzero">
<path style="fill:none;stroke-width:0.3985;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(100%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;" d="M 0.0016875 -0.00109375 L 0.0016875 85.041875 L 28.345437 85.041875 L 28.345437 113.385625 L 113.388406 113.385625 L 113.388406 85.041875 L 170.079813 85.041875 L 170.079813 113.385625 L 198.427469 113.385625 L 198.427469 141.733281 L 396.857156 141.733281 L 396.857156 85.041875 L 425.200906 85.041875 L 425.200906 28.346562 L 453.548563 28.346562 L 453.548563 -0.00109375 " transform="matrix(1,0,0,-1,16.803,289.995)"/>
</g>
<g clip-path="url(#clip4)" clip-rule="nonzero">
<path style="fill:none;stroke-width:0.3985;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,100%);stroke-opacity:1;stroke-miterlimit:10;" d="M 0.0016875 -0.00109375 L 0.0016875 85.041875 L 28.345437 85.041875 L 28.345437 170.080937 L 56.693094 170.080937 L 56.693094 141.733281 L 85.04075 141.733281 L 85.04075 198.428594 L 113.388406 198.428594 L 113.388406 85.041875 L 170.079813 85.041875 L 170.079813 113.385625 L 198.427469 113.385625 L 198.427469 141.733281 L 226.775125 141.733281 L 226.775125 226.77625 L 255.122781 226.77625 L 255.122781 141.733281 L 311.814188 141.733281 L 311.814188 226.77625 L 340.161844 226.77625 L 340.161844 141.733281 L 396.857156 141.733281 L 396.857156 85.041875 L 425.200906 85.041875 L 425.200906 28.346562 L 453.548563 28.346562 L 453.548563 -0.00109375 " transform="matrix(1,0,0,-1,16.803,289.995)"/>
</g>
</g>
</svg>
\documentclass[svgnames,tikz]{standalone}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}[yscale=1]
\def\signalA{3,6,5,7,3,3,4,5,8,5,5,8,5,5,3,1}
\def\signalB{3,4,4,4,3,3,4,5,5,5,5,5,5,5,3,1}
\begin{axis}[
x=1cm,y=1cm,
xmin=0,xmax=16,
ymin=0,ymax=10,
xtick={\empty},ytick={},
]
\end{axis}
\draw[fill=gray!40,draw=red] (0,0) foreach[count=\x] \y in \signalB { |- (\x,\y) } -- (\x,0);
\draw[blue] (0,0) foreach[count=\x] \y in \signalA { |- (\x,\y) } -- (\x,0);
\end{tikzpicture}
\end{document}
......@@ -5,20 +5,25 @@ Include :file:`<mln/labeling/local_extrema.hpp>`
.. cpp:namespace:: mln::labeling
#. .. cpp:function:: \
.. cpp:function:: \
template <class Label_t, class I, class N> \
image_ch_value_t<I, Label_t> local_minima(const Image<I>& input, const Neighborhood<N>& nbh, int& nlabel)
#. .. cpp:function:: \
image_ch_value_t<I, Label_t> local_minima(I input, Neighborhood nbh, int& nlabel)
template <class Label_t, class I, class N> \
image_ch_value_t<I, Label_t> local_maxima(const Image<I>& input, const Neighborhood<N>& nbh, int& nlabel)
#. .. cpp:function:: \
image_ch_value_t<I, Label_t> local_maxima(I input, Neighborhood nbh, int& nlabel)
template <class Label_t, class I, class N, class Compare> \
image_ch_value_t<I, Label_t> local_minima(const Image<I>& input, const Neighborhood<N>& nbh, int& nlabel, Compare cmp)
image_ch_value_t<I, Label_t> local_minima(I input, Neighborhood nbh, int& nlabel, Compare cmp)
Labelize the regional minima (1) or maxima (2) of an image with an
optional comparaison function ``cmp`` (3). According to [Soi13]_, a
*regional minimum* `M` of an image `f` at elevation `t` is a connected
component of pixels with the value `t` whose external boundary pixels have
a value strictly greater than `t`. Similarly, a *regional maximum* `M` of an
image `f` at elevation `t` is a connected component of pixels with the value `t`
whose external boundary pixels have a value strictly less than `t`.
Labelize the local minima (1) or maxima (2) of an image with an optional
comparaison function ``cmp`` (3).
:tparam Label_t: The type of label (must be :cpp:concept:`Integral` and
not boolean)
......@@ -42,3 +47,7 @@ Complexity
The algorithm is quasi-linear and requires :math:`n` extra-memory space.
References
----------
.. [Soi13] Soille, P. (2013). Morphological image analysis: principles and applications. Springer Science & Business Media.
......@@ -24,6 +24,8 @@ Geodesic transformations
morpho/opening_by_reconstruction
morpho/area_filter
morpho/dynamic_filter
morpho/extinction_transform
Segmentation
......
Opening and Closing by Dynamic
==============================
Include :file:`<mln/morpho/area_filter.hpp>`
.. cpp:namespace:: mln::morpho
.. cpp:function:: \
Image{I} concrete_t<I> dynamic_opening(I f, Neighborhood nbh, int h)
Image{I} concrete_t<I> dynamic_closing(I f, Neighborhood nbh, int h)
On grayscale images, the dynamic connected opening removes maxima whose
*dynamic* is below a given value where the dynamic stands for the difference
between the lowest and highest value of the component. In [Soi13]_, it
refers to the notion of h-extrema filtering that suppresses all maxima whose
depth is lower or equal to a given threshold level *h*. This is achieved by
performing the reconstruction by dilation of *f* from :math:`f - h`.
.. figure:: /figures/morpho/hextrema.svg
Dynamic opening with a depth *h=3*. The blue function is the original image *f* and is light gray is the opening.
:param f: Input image 𝑓
:param nbh: Elementary structuring element.
:param h: The minimal dynamic to preserve a component
:return: An image whose type is deduced from the input image
:exception: N/A
Notes
-----
Complexity
----------
References
----------
.. [Soi13] Soille, P. (2013). Morphological image analysis: principles and applications. Springer Science & Business Media.
\ No newline at end of file
Extinction transform
====================
Include :file:`<mln/morpho/extinction_transform.hpp>`
.. cpp:namespace:: mln::morpho
.. cpp:function:: \
Image{I} concrete_t<I> minima_extinction_transform(I ima, Neighborhood nbh)
Image{I} concrete_t<I> maxima_extinction_transform(I ima, Neighborhood nbh)
The notion of *extinction* of a local extremum is based on the h-extrema (see. :doc:`dynamic_filter`).
The extinction value of a bassin corresponds its *dynamic* when it merges with another basin.
By definition, the lowest image minima / highest image maxima, have an *extinction* equal to the difference
between the highest and lowest image grey scale values.
Let Mₜ be a regional maximum at level *t* of an image *f*, and 𝓟 any path
linking a pixel *p* of Mₜ to a pixel *q* of a regional maximum Mₜ' higher
than Mₜ. In [Soi13]_, its *extinction* of Mₜ is defined as:
.. math::
\min_{\mathcal{P} = \{p, \cdots, q\}} \left\{ \max_{x \in \mathcal{P}} (f(p) - f(x)) \right\}
.. note::
Pixels that do not belong to a local extremum are set to 0.
.. figure:: /figures/morpho/extinction.svg
Extinction transform of a 1D signal. Red arrows show the extinction value of each minima.
:param f: Input image 𝑓
:param nbh: Elementary structuring element.
:return: An image whose type is deduced from the input image
:exception: N/A
Notes
-----
Complexity
----------
References
----------
.. [Soi13] Soille, P. (2013). Morphological image analysis: principles and applications. Springer Science & Business Media.
\ No newline at end of file
......@@ -40,7 +40,11 @@ namespace mln::morpho::experimental
void on_make_set(P p) noexcept { m_count(p) = 1; }
void on_union(P p, P q) noexcept { m_count(q) += m_count(p); }
P on_union(dontcare_t, P rp, dontcare_t, P rq) noexcept
{
m_count(rp) += m_count(rq);
return rp;
}
void on_finish(P p, P root) noexcept { m_ima(p) = m_ima(root); }
......@@ -85,22 +89,22 @@ namespace mln::morpho::experimental
impl::area_opening_inplace(out, nbh, area, std::move(cmp));
return out;
}
}
template <class InputImage, class N>
image_concrete_t<std::remove_reference_t<InputImage>> //
area_closing(InputImage&& ima, const N& nbh, int area)
{
using I = std::remove_reference_t<InputImage>;
template <class InputImage, class N>
image_concrete_t<std::remove_reference_t<InputImage>> //
area_closing(InputImage&& ima, const N& nbh, int area)
{
using I = std::remove_reference_t<InputImage>;
static_assert(mln::is_a<I, mln::experimental::Image>());
static_assert(mln::is_a<N, mln::experimental::Neighborhood>());
static_assert(mln::is_a<I, mln::experimental::Image>());
static_assert(mln::is_a<N, mln::experimental::Neighborhood>());
mln_entering("mln::morpho::area_closing");
image_concrete_t<I> out = clone(ima);
impl::area_opening_inplace(out, nbh, area, std::greater<image_value_t<I>>());
mln_entering("mln::morpho::area_closing");
image_concrete_t<I> out = clone(ima);
impl::area_opening_inplace(out, nbh, area, std::greater<image_value_t<I>>());
return out;
}
return out;
}
} // namespace mln::moprho::experimental
......@@ -22,10 +22,15 @@ namespace mln::morpho::experimental::canvas
void on_make_set([[maybe_unused]] ignore_t p) {}
/// \brief Called during the merge-step.
/// It returns the new root of the component (either p or q).
///
/// Called when a component rooted in \p p merges with a
/// component rooted in \p q, \p q becomes the new root.
void on_union([[maybe_unused]] ignore_t p, [[maybe_unused]] ignore_t q) {}
/// Called when a component rooted in \p p merges with a component rooted in \p q through the point \p x.
/// The component rooted in p is the last that has been updated (it is initially the current point being process).
///
/// IF YOU WANT THE ROOT TO BE A POINT THAT HAS THE MINIMUM VALUE OF THE COMPONENT: RETURN p (it is usually what you
/// want). You want the root to be defined in another way (e.g. to a local maximum or using a rank criterion)
ignore_t on_union([[maybe_unused]] ignore_t p, [[maybe_unused]] ignore_t rp,
[[maybe_unused]] ignore_t q, [[maybe_unused]] ignore_t rq) { return {}; }
/// \brief Called at the end of the algorithm for each point
///
......@@ -103,34 +108,37 @@ namespace mln::morpho::experimental::canvas
// Forward pass
{
mln_entering("Uniion-find forward pass");
mln_entering("Union-find forward pass");
for (auto p : ::ranges::view::reverse(S))
{
par(p) = p;
viz.on_make_set(p);
status(p) = static_cast<ufstatus>(viz.test(p));
auto rp = p;
ufstatus st = static_cast<ufstatus>(viz.test(p));
for (auto n : nbh(p))
{
if (status.at(n) == ufstatus::NONE) // Out-of-range neighbor
continue;
auto r = zfindroot(par, n);
if (p == r) // Already the root
auto rn = zfindroot(par, n);
if (rn == rp) // Already the root
continue;
if (status(r) == ufstatus::PASS) // Merging with a PASS component => so PASS
{
status(p) = ufstatus::PASS;
}
else
// Merging with a PASS component => so PASS (no need to merge)
if (status(rn) == ufstatus::PASS)
{
par(r) = p;
viz.on_union(r, p);
st = ufstatus::PASS;
continue;
}
auto new_root = viz.on_union(p, rp, n, rn);
par(rp) = new_root;
par(rn) = new_root;
rp = new_root;
}
if (status(p) == ufstatus::FAIL && viz.test(p))
status(p) = ufstatus::PASS;
status(p) = static_cast<ufstatus>((bool)(st) || (bool)(viz.test(p)));
}
}
......
#pragma once
#include <mln/core/concept/new/images.hpp>
#include <mln/core/concept/new/neighborhoods.hpp>
#include <mln/morpho/experimental/canvas/unionfind.hpp>
namespace mln::morpho::experimental
{
/// \brief Compute the dynamic algebraic opening of an image.
///
/// Also called h-maxima transformation. The dynamic represents the difference between the maximum and the minimum of
/// the connected component.
///
/// \param ima The input image
/// \param nbh The neighborhood
/// \param area The grain size
/// \param cmp A strict total ordering on values
template <class I, class N, class Compare = std::less<image_value_t<std::remove_reference_t<I>>>>
image_concrete_t<std::remove_reference_t<I>> //
dynamic_opening(I&& ima, const N& nbh, int dynamic, Compare cmp = {});
/// \brief Compute the dynamic algebraic closing of an image.
///
/// Also called h-minima transformation. The dynamic represents the difference between the maximum and the minimum of
/// the connected component.
///
/// \param ima The input image
/// \param nbh The neighborhood
/// \param area The grain size
template <class I, class N>
image_concrete_t<std::remove_reference_t<I>> //
dynamic_closing(I&& ima, const N& nbh, int dynamic);
/******************************/
/*** Implementation **/
/******************************/
namespace impl
{
template <class I, class Compare>
struct dynamic_filter_ufind_visitor
{
using P = image_point_t<I>;
void on_make_set(P p) noexcept { m_max(p) = m_ima(p); }
void on_finish(P p, P root) noexcept { m_ima(p) = m_ima(root); }
bool test(P p) const noexcept { return std::abs(m_max(p) - m_ima(p)) >= m_dynamic; }
P on_union(dontcare_t, P rp, dontcare_t, P rq) noexcept
{
auto a = m_max(rp);
auto b = m_max(rq);
m_max(rp) = m_cmp(a,b) ? b : a;
return rp;
}
dynamic_filter_ufind_visitor(I& input, Compare cmp, int dynamic)
: m_ima(input)
, m_cmp(cmp)
, m_dynamic(dynamic)
{
m_max = imconcretize(input);
}
private:
I& m_ima;
Compare m_cmp;
int m_dynamic;
image_concrete_t<I> m_max;
};
template <class I, class N, class Compare>
void dynamic_opening_inplace(I& ima, const N& nbh, int dynamic, Compare cmp)
{
dynamic_filter_ufind_visitor viz(ima, cmp, dynamic);
mln::morpho::experimental::canvas::union_find(ima, nbh, viz, cmp);
}
}
template <class InputImage, class N, class Compare>
image_concrete_t<std::remove_reference_t<InputImage>> //
dynamic_opening(InputImage&& ima, const N& nbh, int dynamic, Compare cmp)
{
using I = std::remove_reference_t<InputImage>;
static_assert(mln::is_a<I, mln::experimental::Image>());
static_assert(mln::is_a<N, mln::experimental::Neighborhood>());
mln_entering("mln::morpho::dynamic_opening");
image_concrete_t<I> out = clone(ima);
impl::dynamic_opening_inplace(out, nbh, dynamic, std::move(cmp));
return out;
}
template <class InputImage, class N>
image_concrete_t<std::remove_reference_t<InputImage>> //
dynamic_closing(InputImage&& ima, const N& nbh, int dynamic)
{
using I = std::remove_reference_t<InputImage>;
static_assert(mln::is_a<I, mln::experimental::Image>());
static_assert(mln::is_a<N, mln::experimental::Neighborhood>());
mln_entering("mln::morpho::dynamic_closing");
image_concrete_t<I> out = clone(ima);
impl::dynamic_opening_inplace(out, nbh, dynamic, std::greater<image_value_t<I>>());
return out;
}
} // namespace mln::moprho::experimental
#pragma once
#include <mln/core/concept/new/images.hpp>
#include <mln/core/concept/new/neighborhoods.hpp>
#include <mln/core/trace.hpp>
#include <mln/morpho/experimental/canvas/unionfind.hpp>
namespace mln::morpho::experimental
{
/// \brief Compute the dynamic algebraic opening of an image.
///
/// Also called h-maxima transformation
///
/// \param ima The input image
/// \param nbh The neighborhood
/// \param area The grain size
/// \param cmp A strict total ordering on values
template <class I, class N>
image_concrete_t<std::remove_reference_t<I>> //
maxima_extinction_transform(I&& ima, const N& nbh);
template <class I, class N>
image_concrete_t<std::remove_reference_t<I>> //
minima_extinction_transform(I&& ima, const N& nbh);
/******************************/
/*** Implementation **/
/******************************/