core.rst 9.68 KB
Newer Older
Edwin Carlinet's avatar
Edwin Carlinet committed
1
Core Module
2
3
4
5
6
===========




Edwin Carlinet's avatar
Edwin Carlinet committed
7
8
9
.. toctree::
   :hidden:

Edwin Carlinet's avatar
Edwin Carlinet committed
10

Michaël Roynard's avatar
Michaël Roynard committed
11
   core/images
Edwin Carlinet's avatar
Edwin Carlinet committed
12
   core/ranges
Edwin Carlinet's avatar
Edwin Carlinet committed
13
   core/neighborhood
Michaël Roynard's avatar
Michaël Roynard committed
14
15
16
17
18
19
   core/stl





Edwin Carlinet's avatar
Edwin Carlinet committed
20
21
22
23




Michaël Roynard's avatar
Michaël Roynard committed
24
25
26
27
28
.. raw:: html

         <h2>Images</h2>


Edwin Carlinet's avatar
Edwin Carlinet committed
29
30
See :doc:`core/images` for a description of the image concepts and image basics.

Michaël Roynard's avatar
Michaël Roynard committed
31
32
33
34
35

.. topic:: Utilities

   TODO

Edwin Carlinet's avatar
Edwin Carlinet committed
36
37
.. topic:: Fundamental image types

Edwin Carlinet's avatar
Edwin Carlinet committed
38
39
40
41
42
43
44
45
46
47
48
  .. table::
    :class: full
    :widths: auto

    +--------------+-------------------------+
    | `image2d<T>` | Buffer-encoded 2D image |
    +--------------+-------------------------+
    | `image3d<T>` | Buffer-encoded 3D image |
    +--------------+-------------------------+
    | `ndimage<T>` | Buffer-encoded nD image |
    +--------------+-------------------------+
Edwin Carlinet's avatar
Edwin Carlinet committed
49
50
51
52
53

.. topic:: Functional image views

  .. table::
    :widths: auto
Edwin Carlinet's avatar
Edwin Carlinet committed
54
55
    :class: full

Edwin Carlinet's avatar
Edwin Carlinet committed
56

Michaël Roynard's avatar
Michaël Roynard committed
57
58
59
60
61
62
63
64
65
66
67
    +------------------------------------------------------------+--------------------------------------------------------------------------------------------+
    | :cpp:func:`view::transform(ima, f) <mln::view::transform>` | Views the image with a function applied to the values.                                     |
    +------------------------------------------------------------+--------------------------------------------------------------------------------------------+
    | ``view::filter(ima, pred)``                                | Views the image restricted to pixels whose values pass a predicate.                        |
    +------------------------------------------------------------+--------------------------------------------------------------------------------------------+
    | ``view::mask(ima, mask)``                                  | Views the image restricted to pixels in a binary mask.                                     |
    +------------------------------------------------------------+--------------------------------------------------------------------------------------------+
    | ``view::clip(ima, roi)``                                   | Views the image restricted to a sub-region.                                                |
    +------------------------------------------------------------+--------------------------------------------------------------------------------------------+
    | ``view::zip(ima1, ima2, ..., imaN)``                       | Views a list of images as a single image whose values are tuples of the each image values. |
    +------------------------------------------------------------+--------------------------------------------------------------------------------------------+
Edwin Carlinet's avatar
Edwin Carlinet committed
68
69
70
71
72

.. topic:: Common image operators (views)

  .. table::
    :widths: auto
Edwin Carlinet's avatar
Edwin Carlinet committed
73
    :class: full
Edwin Carlinet's avatar
Edwin Carlinet committed
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95

    +--------------+-----------------------------------------------------------+
    | Arithmetical | `a + b`, `a - b`, `a * b`, `a / b`, `a % b`               |
    +--------------+-----------------------------------------------------------+
    | Logical      | ``land(a,b)``, ``lor(a,b)``, ``lnot(a)``                  |
    +--------------+-----------------------------------------------------------+
    | Comparison   | `a < b`, `a <= b`, `a == b`, `a != b`, `a >= b`, `a > b`  |
    +--------------+-----------------------------------------------------------+
    | Conditional  | ``view::ifelse(a,b,c)``                                   |
    +--------------+-----------------------------------------------------------+


.. topic:: Mathematical image operator (views)

  +-------+-------+
  | FIXME | FIXME |
  +-------+-------+

.. topic:: Other image operators (views)

  .. table::
    :widths: auto
Edwin Carlinet's avatar
Edwin Carlinet committed
96
    :class: full
Edwin Carlinet's avatar
Edwin Carlinet committed
97
98
99
100
101
102
103
104
105
106
    
    +---------------------------+---------------------------------------------------+
    | ``view::cast<V>(ima)``    | Views the image with the values casted into ``V`` |
    +---------------------------+---------------------------------------------------+
    | ``view::channel(ima, k)`` | Views the k-th channel of the image               |
    +---------------------------+---------------------------------------------------+
    | ``view::red(ima)``        |                                                   |
    | ``view::green(ima)``      |                                                   |
    | ``view::blue(ima)``       | Views the red, green or blue channel of the image |
    +---------------------------+---------------------------------------------------+
Michaël Roynard's avatar
Michaël Roynard committed
107
108


Edwin Carlinet's avatar
Edwin Carlinet committed
109
110
111
112
113
114
115
.. raw:: html

         <h2>Ranges</h2>


:doc:`core/ranges` extensions for ranges with new concepts and helper functions.

Edwin Carlinet's avatar
Edwin Carlinet committed
116

117
118
.. topic:: Concepts

119
120
   * :ref:`Segmented Range <concept-ranges-SegmentedRange>`
   * :ref:`Reversible Range <concept-ranges-ReversibleRange>`
121
122
123
124
125
126
127
128


.. topic:: Utilities

   * :cpp:func:`mln::ranges::rows`
   * :c:macro:`mln_foreach`

.. topic:: Views
Edwin Carlinet's avatar
Edwin Carlinet committed
129

130
131
   * :doc:`core/ranges/reverse`
   * :doc:`core/ranges/transform`
Edwin Carlinet's avatar
Edwin Carlinet committed
132
   * :doc:`core/ranges/filter`
Michaël Roynard's avatar
Michaël Roynard committed
133
134
   * :doc:`core/ranges/zip`
   * :doc:`core/ranges/zip_with`
Edwin Carlinet's avatar
Edwin Carlinet committed
135
136
137
138




Edwin Carlinet's avatar
Edwin Carlinet committed
139
140
.. raw:: html

Edwin Carlinet's avatar
Edwin Carlinet committed
141
         <h2>Neighborhoods and Structural Elements</h2>
Edwin Carlinet's avatar
Edwin Carlinet committed
142

Michaël Roynard's avatar
Michaël Roynard committed
143

Edwin Carlinet's avatar
Edwin Carlinet committed
144
:doc:`core/neighborhood`  are the fundamental tools for local image processing.
Edwin Carlinet's avatar
Edwin Carlinet committed
145

Edwin Carlinet's avatar
Edwin Carlinet committed
146
147
148
149
.. topic:: Concepts

   * :cpp:concept:`mln::StructuringElement`

Michaël Roynard's avatar
Michaël Roynard committed
150
.. topic::  Predefined Neighborhood
Edwin Carlinet's avatar
Edwin Carlinet committed
151
152
153
154

  * :doc:`core/neighborhood/c4`
  * :doc:`core/neighborhood/c8`

Michaël Roynard's avatar
Michaël Roynard committed
155
.. topic::  Predefined Structuring Elements
Edwin Carlinet's avatar
Edwin Carlinet committed
156
157
158
159

  * :doc:`core/se/disc`
  * :doc:`core/se/rectangle`
  * :doc:`core/se/periodic_lines`
Edwin Carlinet's avatar
Edwin Carlinet committed
160
161
162



Michaël Roynard's avatar
Michaël Roynard committed
163

Edwin Carlinet's avatar
Edwin Carlinet committed
164

Edwin Carlinet's avatar
Edwin Carlinet committed
165
166
167
168
169
170
Image primitives
****************

.. toctree::
    :hidden:

Edwin Carlinet's avatar
Edwin Carlinet committed
171
172
173
    core/algorithm/accumulate    
    core/algorithm/all_any_none_of
    core/algorithm/clone
Edwin Carlinet's avatar
Edwin Carlinet committed
174
    core/algorithm/copy
Edwin Carlinet's avatar
Edwin Carlinet committed
175
176
177
178
    core/algorithm/fill
    core/algorithm/foreach
    core/algorithm/generate  
    core/algorithm/iota
Edwin Carlinet's avatar
Edwin Carlinet committed
179
    core/algorithm/paste
Edwin Carlinet's avatar
Edwin Carlinet committed
180
    core/algorithm/sort
Edwin Carlinet's avatar
Edwin Carlinet committed
181
182
183
184
185
186
187
188
189
190
    core/algorithm/transform

Fundamental primitives for basic image manipulation. Those are grouped by:

* *Modifying* or *Non-modifying* if they output and write an image
* *Value* or *Pixel* if the localisation (i.e. point/index) is used for processing



.. rubric:: Non-modifying image primitives that operates on values
Edwin Carlinet's avatar
Edwin Carlinet committed
191

Edwin Carlinet's avatar
Edwin Carlinet committed
192
193
194
.. table::
  :class: full
  :widths: auto
Edwin Carlinet's avatar
Edwin Carlinet committed
195

Edwin Carlinet's avatar
Edwin Carlinet committed
196
197
198
199
200
201
202
203
204
205
206
  +-------------------------------------------+------------------------------------------------------------------------+
  | :doc:`core/algorithm/all_any_none_of`     | checks if a predicate is true for all, any or none of the image values |
  +-------------------------------------------+------------------------------------------------------------------------+
  | :doc:`core/algorithm/foreach`             | applies a function to the values of an image                           |
  +-------------------------------------------+------------------------------------------------------------------------+
  | `count` `count_if`                        | [TBI] returns the number of values satisfying specific criteria        |
  +-------------------------------------------+------------------------------------------------------------------------+
  | `equal`                                   | [TBI] checks if two images have the same values                        |
  +-------------------------------------------+------------------------------------------------------------------------+
  | :doc:`core/algorithm/accumulate` (reduce) | sums up values of an image                                             |
  +-------------------------------------------+------------------------------------------------------------------------+
Michaël Roynard's avatar
Michaël Roynard committed
207
208


Edwin Carlinet's avatar
Edwin Carlinet committed
209
.. rubric:: Non-modifying image primitives that operates on pixels
Michaël Roynard's avatar
Michaël Roynard committed
210
211


Edwin Carlinet's avatar
Edwin Carlinet committed
212
213
214
215
216
217
218
+----------------------------+--------------------------------------------------+
| :doc:`core/algorithm/sort` | returns a container of image points (or indexes) |
+----------------------------+--------------------------------------------------+

.. rubric:: Modifying image primitives that operates on values


Edwin Carlinet's avatar
Edwin Carlinet committed
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
.. table::
  :class: full
  :widths: auto

  +---------------------------------+--------------------------------------------------------------+
  | :doc:`core/algorithm/copy`      | copies image values to another image  (without localization) |
  +---------------------------------+--------------------------------------------------------------+
  | :doc:`core/algorithm/fill`      | assigns a value to image values                              |
  +---------------------------------+--------------------------------------------------------------+
  | :doc:`core/algorithm/clone`     | copies an image in a new image                               |
  +---------------------------------+--------------------------------------------------------------+
  | :doc:`core/algorithm/paste`     | copies image pixels to another image (with localization)     |
  +---------------------------------+--------------------------------------------------------------+
  | :doc:`core/algorithm/transform` | applies a function to the values of an image                 |
  +---------------------------------+--------------------------------------------------------------+
  | :doc:`core/algorithm/generate`  | generate the values of an image by a function                |
  +---------------------------------+--------------------------------------------------------------+
  | :doc:`core/algorithm/iota`      | generate the values of an image with increasing value        |
  +---------------------------------+--------------------------------------------------------------+
Edwin Carlinet's avatar
Edwin Carlinet committed
238
239
240
241
242
243
244

.. rubric:: Modifying image primitives that operates on pixels

+-------------------------------------------+---------------------------------------------------------------------+
| `integrate` (partial sum, inclusive scan) | computes the partial sum of image values (used for integral images) |
+-------------------------------------------+---------------------------------------------------------------------+

Michaël Roynard's avatar
Michaël Roynard committed
245
246
247
248
249
250
.. raw:: html

         <h2>STL</h2>


:doc:`core/stl` are the fundamentals concepts of the C++ standard library that we are building our concept upon. They are our building blocks.
Edwin Carlinet's avatar
Edwin Carlinet committed
251
252