image3d.hh 15.5 KB
Newer Older
1
2
// Copyright (C) 2007, 2008, 2009 EPITA Research and Development
// Laboratory (LRDE)
Simon Nivault's avatar
Simon Nivault committed
3
//
4
// This file is part of Olena.
Simon Nivault's avatar
Simon Nivault committed
5
//
6
7
8
9
10
// Olena is free software: you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free
// Software Foundation, version 2 of the License.
//
// Olena is distributed in the hope that it will be useful,
Simon Nivault's avatar
Simon Nivault committed
11
12
13
14
15
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public License
16
// along with Olena.  If not, see <http://www.gnu.org/licenses/>.
Simon Nivault's avatar
Simon Nivault committed
17
18
//
// As a special exception, you may use this file as part of a free
19
// software project without restriction.  Specifically, if other files
Simon Nivault's avatar
Simon Nivault committed
20
// instantiate templates or use macros or inline functions from this
21
22
23
24
25
// file, or you compile this file and link it with other files to produce
// an executable, this file does not by itself cause the resulting
// executable to be covered by the GNU General Public License.  This
// exception does not however invalidate any other reasons why the
// executable file might be covered by the GNU General Public License.
Simon Nivault's avatar
Simon Nivault committed
26

27
28
#ifndef MLN_CORE_IMAGE_IMAGE3D_HH
# define MLN_CORE_IMAGE_IMAGE3D_HH
Simon Nivault's avatar
Simon Nivault committed
29

30
/// \file
31
32
///
/// Definition of the basic mln::image3d class.
Simon Nivault's avatar
Simon Nivault committed
33

Thierry Geraud's avatar
Thierry Geraud committed
34
# include <mln/core/internal/fixme.hh>
35
# include <mln/core/internal/image_primary.hh>
36
# include <mln/core/alias/box3d.hh>
Simon Nivault's avatar
Simon Nivault committed
37
38
39

# include <mln/border/thickness.hh>
# include <mln/value/set.hh>
40
# include <mln/fun/i2v/all_to.hh>
Simon Nivault's avatar
Simon Nivault committed
41

42
// # include <mln/core/line_piter.hh>
Simon Nivault's avatar
Simon Nivault committed
43
44
45

// FIXME:

46
// # include <mln/core/pixter3d.hh>
Simon Nivault's avatar
Simon Nivault committed
47
48
49
50
51
52
// # include <mln/core/dpoints_pixter.hh>


namespace mln
{

Guillaume Lazzara's avatar
Guillaume Lazzara committed
53
  // Forward declaration.
54
  template <typename T> struct image3d;
Simon Nivault's avatar
Simon Nivault committed
55
56
57



58
59
60
  namespace internal
  {

Guillaume Lazzara's avatar
Guillaume Lazzara committed
61
    /// Data structure for \c mln::image3d<T>.
62
    template <typename T>
Matthieu Garrigues's avatar
Matthieu Garrigues committed
63
    struct data< image3d<T> >
64
    {
Matthieu Garrigues's avatar
Matthieu Garrigues committed
65
66
      data(const box3d& b, unsigned bdr);
      ~data();
67
68
69
70
71
72
73
74
75
76
77

      T*  buffer_;
      T*** array_;

      box3d b_;  // theoretical box
      unsigned bdr_;
      box3d vb_; // virtual box, i.e., box including the virtual border

      void update_vb_();
      void allocate_();
      void deallocate_();
Matthieu Garrigues's avatar
Matthieu Garrigues committed
78
      void swap_ (data< image3d<T> >& other_);
79
      void reallocate_(unsigned new_border);
80
81
82
83
84
    };

  } // end of namespace mln::internal


Simon Nivault's avatar
Simon Nivault committed
85

Thierry Geraud's avatar
Thierry Geraud committed
86
87
88
89
  namespace trait
  {

    template <typename T>
90
    struct image_< image3d<T> > : default_image_< T, image3d<T> >
Thierry Geraud's avatar
Thierry Geraud committed
91
    {
92
      // misc
93
      typedef trait::image::category::primary category;
94
95
96
97
      typedef trait::image::speed::fastest    speed;
      typedef trait::image::size::regular     size;

      // value
98
99
      typedef trait::image::vw_io::none                    vw_io;
      typedef trait::image::vw_set::none                   vw_set;
100
101
102
      typedef trait::image::value_access::direct           value_access;
      typedef trait::image::value_storage::one_block       value_storage;
      typedef trait::image::value_browsing::site_wise_only value_browsing;
Roland Levillain's avatar
Roland Levillain committed
103
      typedef trait::image::value_alignment::with_grid     value_alignment;
104
105
106
      typedef trait::image::value_io::read_write           value_io;

      // site / domain
107
      typedef trait::image::pw_io::read_write        pw_io;
108
109
110
111
112
113
114
      typedef trait::image::localization::basic_grid localization;
      typedef trait::image::dimension::three_d         dimension;

      // extended domain
      typedef trait::image::ext_domain::extendable ext_domain;
      typedef trait::image::ext_value::multiple    ext_value;
      typedef trait::image::ext_io::read_write     ext_io;
Thierry Geraud's avatar
Thierry Geraud committed
115
116
117
118
119
120
    };

  } // end of namespace mln::trait



Guillaume Lazzara's avatar
Guillaume Lazzara committed
121
  /// Basic 3D image class.
Guillaume Lazzara's avatar
Guillaume Lazzara committed
122
123
124
125
126
127
  ///
  /// The parameter \c T is the type of pixel values.  This image class
  /// stores data in memory and has a virtual border with constant
  /// thickness around data.
  ///
  /// \ingroup modimageconcrete
Guillaume Lazzara's avatar
Guillaume Lazzara committed
128
  //
Simon Nivault's avatar
Simon Nivault committed
129
  template <typename T>
130
  struct image3d : public internal::image_primary< T, box3d, image3d<T> >
Simon Nivault's avatar
Simon Nivault committed
131
132
133
134
135
136
137
138
  {
    // Warning: just to make effective types appear in Doxygen:
    typedef box3d   pset;
    typedef point3d psite;
    typedef point3d point;
    typedef dpoint3d dpoint;
    typedef mln_fwd_piter(box3d) fwd_piter;
    typedef mln_bkd_piter(box3d) bkd_piter;
139
//     typedef line_piter_<point> line_piter;
Simon Nivault's avatar
Simon Nivault committed
140
141
142
    // End of warning.


143
    /// Super type
144
    typedef internal::image_primary< T, box3d, image3d<T> > super_;
145

Simon Nivault's avatar
Simon Nivault committed
146
147
148
149
150
151
152
153
154
    /// Value associated type.
    typedef T         value;

    /// Return type of read-only access.
    typedef const T& rvalue;

    /// Return type of read-write access.
    typedef T&       lvalue;

155
156

    /// Skeleton.
157
    typedef image3d< tag::value_<T> > skeleton;
158

Simon Nivault's avatar
Simon Nivault committed
159
    /// Constructor without argument.
160
    image3d();
Simon Nivault's avatar
Simon Nivault committed
161
162
163

    /// Constructor with a box and the border thickness (default is
    /// 3).
164
    image3d(const box3d& b, unsigned bdr = border::thickness);
Simon Nivault's avatar
Simon Nivault committed
165

166
167
    /// Constructor with the numbers of indexes and the
    /// border thickness.
168
    image3d(int nslis, int nrows, int ncols, unsigned bdr = border::thickness);
Simon Nivault's avatar
Simon Nivault committed
169
170
171


    /// Initialize an empty image.
172
    void init_(const box3d& b, unsigned bdr = border::thickness);
Simon Nivault's avatar
Simon Nivault committed
173
174
175


    /// Test if \p p is valid.
Thierry Geraud's avatar
Thierry Geraud committed
176
    bool has(const point3d& p) const;
Simon Nivault's avatar
Simon Nivault committed
177
178
179
180

    /// Give the definition domain.
    const box3d& domain() const;

181
182
183
    /// Give the bounding box domain.
    const box3d& bbox() const;

Simon Nivault's avatar
Simon Nivault committed
184
185
186
187
    /// Give the border thickness.
    unsigned border() const;

    /// Give the number of cells (points including border ones).
Ugo Jardonnet's avatar
Ugo Jardonnet committed
188
    unsigned nelements() const;
Simon Nivault's avatar
Simon Nivault committed
189
190
191
192
193
194
195

    /// Read-only access to the image value located at point \p p.
    const T& operator()(const point3d& p) const;

    /// Read-write access to the image value located at point \p p.
    T& operator()(const point3d& p);

196
197
    /// Read-only access to the image value located at index \p i.
    const T& element(unsigned i) const;
Simon Nivault's avatar
Simon Nivault committed
198

199
200
    /// Read-write access to the image value located at index \p i.
    T& element(unsigned i);
Simon Nivault's avatar
Simon Nivault committed
201

202
203
    /// Read-only access to the image value located at (\p sli, \p
    /// row, \p col).
Guillaume Lazzara's avatar
Guillaume Lazzara committed
204
    const T& at_(def::coord sli, def::coord row, def::coord col) const;
Simon Nivault's avatar
Simon Nivault committed
205

206
207
    /// Read-write access to the image value located at (\p sli, \p
    /// row, \p col).
Guillaume Lazzara's avatar
Guillaume Lazzara committed
208
    T& at_(def::coord sli, def::coord row, def::coord col);
Simon Nivault's avatar
Simon Nivault committed
209
210


211
    /// Give the number of slices.
212
    unsigned nslis() const;
213
214
215
216
217
218
219
220

    /// Give the number of rows.
    unsigned nrows() const;

    /// Give the number of columns.
    unsigned ncols() const;


Simon Nivault's avatar
Simon Nivault committed
221
222
223
    /// Fast Image method

    /// Give the offset corresponding to the delta-point \p dp.
224
    int delta_index(const dpoint3d& dp) const;
Simon Nivault's avatar
Simon Nivault committed
225
226

    /// Give the point corresponding to the offset \p o.
227
    point3d point_at_index(unsigned o) const;
Simon Nivault's avatar
Simon Nivault committed
228
229
230
231
232
233

    /// Give a hook to the value buffer.
    const T* buffer() const;

    /// Give a hook to the value buffer.
    T* buffer();
234
235

    /// To use the track pointer inherited.
236
    using super_::data_;
237
238
239
240
241
242



    /// Resize image border with new_border.
    void resize_(unsigned new_border);

243
  };
Simon Nivault's avatar
Simon Nivault committed
244

245
  template <typename T, typename J>
246
  void init_(tag::image_t, mln::image3d<T>& target, const J& model);
247
248


Simon Nivault's avatar
Simon Nivault committed
249

250
# ifndef MLN_INCLUDE_ONLY
Simon Nivault's avatar
Simon Nivault committed
251

252
  // init_
253

254
  template <typename T>
255
  inline
256
  void init_(tag::border_t, unsigned& b, const image3d<T>& model)
257
  {
258
259
    b = model.border();
  }
260

261
  template <typename T, typename J>
262
  inline
263
  void init_(tag::image_t, image3d<T>& target, const J& model)
264
265
266
267
268
269
270
  {
    box3d b;
    init_(tag::bbox, b, model);
    unsigned bdr;
    init_(tag::border, bdr, model);
    target.init_(b, bdr);
  }
271
272


Matthieu Garrigues's avatar
Matthieu Garrigues committed
273
  // internal::data< image3d<T> >
Simon Nivault's avatar
Simon Nivault committed
274

275
276
  namespace internal
  {
Simon Nivault's avatar
Simon Nivault committed
277

278
    template <typename T>
279
    inline
Matthieu Garrigues's avatar
Matthieu Garrigues committed
280
    data< image3d<T> >::data(const box3d& b, unsigned bdr)
281
282
283
284
285
286
287
      : buffer_(0),
	array_ (0),
	b_     (b),
	bdr_   (bdr)
    {
      allocate_();
    }
Simon Nivault's avatar
Simon Nivault committed
288

289
    template <typename T>
290
    inline
Matthieu Garrigues's avatar
Matthieu Garrigues committed
291
    data< image3d<T> >::~data()
292
293
294
    {
      deallocate_();
    }
Simon Nivault's avatar
Simon Nivault committed
295

296
    template <typename T>
297
    inline
298
    void
Matthieu Garrigues's avatar
Matthieu Garrigues committed
299
    data< image3d<T> >::update_vb_()
300
    {
301
302
      vb_.pmin() = b_.pmin() - dpoint3d(all_to(bdr_));
      vb_.pmax() = b_.pmax() + dpoint3d(all_to(bdr_));
303
    }
Simon Nivault's avatar
Simon Nivault committed
304

305
    template <typename T>
306
    inline
307
    void
Matthieu Garrigues's avatar
Matthieu Garrigues committed
308
    data< image3d<T> >::allocate_()
309
310
311
312
313
314
315
316
317
318
    {
      update_vb_();
      unsigned
	ns = vb_.len(0),
	nr = vb_.len(1),
	nc = vb_.len(2);
      buffer_ = new T[nr * nc * ns];
      array_ = new T**[ns];
      T* buf = buffer_ - vb_.pmin().col();
      for (unsigned i = 0; i < ns; ++i)
319
320
321
322
      {
	T** tmp = new T*[nr];
	array_[i] = tmp;
	for (unsigned j = 0; j < nr; ++j)
323
	{
324
325
	  array_[i][j] = buf;
	  buf += nc;
326
	}
327
328
	array_[i] -= vb_.pmin().row();
      }
329
330
331
      array_ -= vb_.pmin().sli();
      mln_postcondition(vb_.len(0) == b_.len(0) + 2 * bdr_);
    }
Simon Nivault's avatar
Simon Nivault committed
332

333
    template <typename T>
334
    inline
335
    void
Matthieu Garrigues's avatar
Matthieu Garrigues committed
336
    data< image3d<T> >::deallocate_()
337
338
    {
      if (buffer_)
339
340
341
342
      {
	delete[] buffer_;
	buffer_ = 0;
      }
343
      for (typename point3d::coord i = vb_.pmin().sli(); i <= vb_.pmax().sli(); ++i)
344
345
      {
	if (array_[i])
346
	{
347
348
349
	  array_[i] += vb_.pmin().row();
	  delete[] array_[i];
	  array_[i] = 0;
350
	}
351
      }
352
      if (array_)
353
354
355
356
357
      {
	array_ += vb_.pmin().sli();
	delete[] array_;
	array_ = 0;
      }
358
359
    }

360
    template <typename T>
361
    inline
362
    void
Matthieu Garrigues's avatar
Matthieu Garrigues committed
363
    data< image3d<T> >::swap_(data< image3d<T> >& other_)
364
    {
Matthieu Garrigues's avatar
Matthieu Garrigues committed
365
      data< image3d<T> > self_ = *this;
Nicolas Neri's avatar
Nicolas Neri committed
366
367
      *this = other_;
      other_ = self_;
368
369
370
    }

    template <typename T>
371
    inline
372
    void
Matthieu Garrigues's avatar
Matthieu Garrigues committed
373
    data< image3d<T> >::reallocate_(unsigned new_border)
374
    {
Matthieu Garrigues's avatar
Matthieu Garrigues committed
375
      data< image3d<T> >& tmp = *(new data< image3d<T> >(this->b_, new_border));
376
377
378
379
      this->swap_(tmp);
    }


380
381
  } // end of namespace mln::internal

382
  // image3d<T>
Simon Nivault's avatar
Simon Nivault committed
383
384

  template <typename T>
385
  inline
386
  image3d<T>::image3d()
Simon Nivault's avatar
Simon Nivault committed
387
388
389
390
  {
  }

  template <typename T>
391
  inline
392
  image3d<T>::image3d(const box3d& b, unsigned bdr)
Simon Nivault's avatar
Simon Nivault committed
393
  {
394
    init_(b, bdr);
Simon Nivault's avatar
Simon Nivault committed
395
396
397
  }

  template <typename T>
398
  inline
399
  image3d<T>::image3d(int nslis, int nrows, int ncols, unsigned bdr)
Simon Nivault's avatar
Simon Nivault committed
400
  {
401
    init_(make::box3d(nslis, nrows, ncols), bdr);
Simon Nivault's avatar
Simon Nivault committed
402
403
404
  }

  template <typename T>
405
  inline
406
  void
407
  image3d<T>::init_(const box3d& b, unsigned bdr)
Simon Nivault's avatar
Simon Nivault committed
408
  {
409
    mln_precondition(! this->is_valid());
Matthieu Garrigues's avatar
Matthieu Garrigues committed
410
    this->data_ = new internal::data< image3d<T> >(b, bdr);
Simon Nivault's avatar
Simon Nivault committed
411
412
413
  }

  template <typename T>
414
  inline
Simon Nivault's avatar
Simon Nivault committed
415
  const box3d&
416
  image3d<T>::domain() const
Simon Nivault's avatar
Simon Nivault committed
417
  {
418
    mln_precondition(this->is_valid());
419
    return data_->b_;
Simon Nivault's avatar
Simon Nivault committed
420
421
  }

422
423
424
425
426
  template <typename T>
  inline
  const box3d&
  image3d<T>::bbox() const
  {
427
    mln_precondition(this->is_valid());
428
429
430
    return data_->b_;
  }

Simon Nivault's avatar
Simon Nivault committed
431
  template <typename T>
432
  inline
Simon Nivault's avatar
Simon Nivault committed
433
  unsigned
434
  image3d<T>::border() const
Simon Nivault's avatar
Simon Nivault committed
435
  {
436
    mln_precondition(this->is_valid());
437
    return data_->bdr_;
Simon Nivault's avatar
Simon Nivault committed
438
439
440
  }

  template <typename T>
441
  inline
Ugo Jardonnet's avatar
Ugo Jardonnet committed
442
  unsigned
443
  image3d<T>::nelements() const
Simon Nivault's avatar
Simon Nivault committed
444
  {
445
    mln_precondition(this->is_valid());
446
    return data_->vb_.nsites();
Simon Nivault's avatar
Simon Nivault committed
447
448
449
  }

  template <typename T>
450
  inline
Simon Nivault's avatar
Simon Nivault committed
451
  bool
Thierry Geraud's avatar
Thierry Geraud committed
452
  image3d<T>::has(const point3d& p) const
Simon Nivault's avatar
Simon Nivault committed
453
  {
454
    mln_precondition(this->is_valid());
455
    return data_->vb_.has(p);
Simon Nivault's avatar
Simon Nivault committed
456
457
458
  }

  template <typename T>
459
  inline
Simon Nivault's avatar
Simon Nivault committed
460
  const T&
461
  image3d<T>::operator()(const point3d& p) const
Simon Nivault's avatar
Simon Nivault committed
462
  {
Thierry Geraud's avatar
Thierry Geraud committed
463
    mln_precondition(this->has(p));
464
    return data_->array_[p.sli()][p.row()][p.col()];
Simon Nivault's avatar
Simon Nivault committed
465
466
467
  }

  template <typename T>
468
  inline
Simon Nivault's avatar
Simon Nivault committed
469
  T&
470
  image3d<T>::operator()(const point3d& p)
Simon Nivault's avatar
Simon Nivault committed
471
  {
Thierry Geraud's avatar
Thierry Geraud committed
472
    mln_precondition(this->has(p));
473
    return data_->array_[p.sli()][p.row()][p.col()];
Simon Nivault's avatar
Simon Nivault committed
474
475
476
  }

  template <typename T>
477
  inline
Simon Nivault's avatar
Simon Nivault committed
478
  const T&
479
  image3d<T>::element(unsigned i) const
Simon Nivault's avatar
Simon Nivault committed
480
  {
481
482
    mln_precondition(i < nelements());
    return *(data_->buffer_ + i);
Simon Nivault's avatar
Simon Nivault committed
483
484
485
  }

  template <typename T>
486
  inline
Simon Nivault's avatar
Simon Nivault committed
487
  T&
488
  image3d<T>::element(unsigned i)
Simon Nivault's avatar
Simon Nivault committed
489
  {
490
491
    mln_precondition(i < nelements());
    return *(data_->buffer_ + i);
Simon Nivault's avatar
Simon Nivault committed
492
493
494
  }

  template <typename T>
495
  inline
Simon Nivault's avatar
Simon Nivault committed
496
  const T&
Guillaume Lazzara's avatar
Guillaume Lazzara committed
497
  image3d<T>::at_(def::coord sli, def::coord row, def::coord col) const
Simon Nivault's avatar
Simon Nivault committed
498
  {
499
    mln_precondition(this->has(point3d(sli, row, col)));
500
    return data_->array_[sli][row][col];
Simon Nivault's avatar
Simon Nivault committed
501
502
503
  }

  template <typename T>
504
  inline
Simon Nivault's avatar
Simon Nivault committed
505
  T&
Guillaume Lazzara's avatar
Guillaume Lazzara committed
506
  image3d<T>::at_(def::coord sli, def::coord row, def::coord col)
Simon Nivault's avatar
Simon Nivault committed
507
  {
508
    mln_precondition(this->has(point3d(sli, row, col)));
509
    return data_->array_[sli][row][col];
Simon Nivault's avatar
Simon Nivault committed
510
511
  }

512
513
514
  template <typename T>
  inline
  unsigned
515
  image3d<T>::nslis() const
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
  {
    mln_precondition(this->is_valid());
    return this->data_->b_.len(0);
  }

  template <typename T>
  inline
  unsigned
  image3d<T>::nrows() const
  {
    mln_precondition(this->is_valid());
    return this->data_->b_.len(1);
  }

  template <typename T>
  inline
  unsigned
  image3d<T>::ncols() const
  {
    mln_precondition(this->is_valid());
    return this->data_->b_.len(2);
  }

Simon Nivault's avatar
Simon Nivault committed
539
  template <typename T>
540
  inline
Simon Nivault's avatar
Simon Nivault committed
541
  const T*
542
  image3d<T>::buffer() const
Simon Nivault's avatar
Simon Nivault committed
543
  {
544
    mln_precondition(this->is_valid());
545
    return data_->buffer_;
Simon Nivault's avatar
Simon Nivault committed
546
547
548
  }

  template <typename T>
549
  inline
Simon Nivault's avatar
Simon Nivault committed
550
  T*
551
  image3d<T>::buffer()
Simon Nivault's avatar
Simon Nivault committed
552
  {
553
    mln_precondition(this->is_valid());
554
    return data_->buffer_;
Simon Nivault's avatar
Simon Nivault committed
555
556
557
  }

  template <typename T>
558
  inline
Simon Nivault's avatar
Simon Nivault committed
559
  int
560
  image3d<T>::delta_index(const dpoint3d& dp) const
Simon Nivault's avatar
Simon Nivault committed
561
  {
562
    mln_precondition(this->is_valid());
563
564
    int o = (dp[0] * this->data_->vb_.len(1)
	     + dp[1]) * this->data_->vb_.len(2) + dp[2];
Simon Nivault's avatar
Simon Nivault committed
565
566
567
568
    return o;
  }

  template <typename T>
569
  inline
Simon Nivault's avatar
Simon Nivault committed
570
  point3d
571
  image3d<T>::point_at_index(unsigned o) const
Simon Nivault's avatar
Simon Nivault committed
572
  {
573
    mln_precondition(o < nelements());
574
575
576
577
578
    def::coord
      sli = static_cast<def::coord>(o / (data_->vb_.len(1) * data_->vb_.len(2)) + data_->vb_.min_sli()),
      row = static_cast<def::coord>((o % (data_->vb_.len(1) * data_->vb_.len(2))) / data_->vb_.len(2) + data_->vb_.min_row()),
      col = static_cast<def::coord>(o % data_->vb_.len(2) + data_->vb_.min_col());
    point3d p = point3d(sli, row, col);
579
    mln_postcondition(& this->operator()(p) == this->data_->buffer_ + o);
Simon Nivault's avatar
Simon Nivault committed
580
581
582
    return p;
  }

583
  template <typename T>
584
  inline
585
586
587
588
589
590
  void
  image3d<T>::resize_(unsigned new_border)
  {
    this->data_->reallocate_(new_border);
  }

Simon Nivault's avatar
Simon Nivault committed
591
592
593
594
595
596
597
598
# endif // ! MLN_INCLUDE_ONLY

} // end of namespace mln



# include <mln/core/trait/pixter.hh>
# include <mln/core/dpoints_pixter.hh>
599
# include <mln/core/pixter3d.hh>
Simon Nivault's avatar
Simon Nivault committed
600
601
602
603
604
605
606
607
608
609
610
611
# include <mln/core/w_window.hh>


namespace mln
{

  namespace trait
  {

    // pixter

    template <typename T>
612
    struct fwd_pixter< image3d<T> >
Simon Nivault's avatar
Simon Nivault committed
613
    {
614
      typedef fwd_pixter3d< image3d<T> > ret;
Simon Nivault's avatar
Simon Nivault committed
615
616
617
    };

    template <typename T>
618
    struct fwd_pixter< const image3d<T> >
Simon Nivault's avatar
Simon Nivault committed
619
    {
620
      typedef fwd_pixter3d< const image3d<T> > ret;
Simon Nivault's avatar
Simon Nivault committed
621
622
623
    };

    template <typename T>
624
    struct bkd_pixter< image3d<T> >
625
626
627
628
629
630
    {
      typedef bkd_pixter3d< image3d<T> > ret;
    };

    template <typename T>
    struct bkd_pixter< const image3d<T> >
Simon Nivault's avatar
Simon Nivault committed
631
    {
632
      typedef bkd_pixter3d< const image3d<T> > ret;
Simon Nivault's avatar
Simon Nivault committed
633
634
635
636
637
    };

    // qixter

    template <typename T, typename W>
638
    struct fwd_qixter< image3d<T>, W >
Simon Nivault's avatar
Simon Nivault committed
639
    {
640
      typedef dpoints_fwd_pixter< image3d<T> > ret;
Simon Nivault's avatar
Simon Nivault committed
641
642
643
    };

    template <typename T, typename W>
644
    struct fwd_qixter< const image3d<T>, W >
Simon Nivault's avatar
Simon Nivault committed
645
    {
646
      typedef dpoints_fwd_pixter< const image3d<T> > ret;
Simon Nivault's avatar
Simon Nivault committed
647
648
649
    };

    template <typename T, typename W>
650
    struct bkd_qixter< image3d<T>, W >
Simon Nivault's avatar
Simon Nivault committed
651
    {
652
      typedef dpoints_bkd_pixter< image3d<T> > ret;
Simon Nivault's avatar
Simon Nivault committed
653
654
    };

655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
    template <typename T, typename W>
    struct bkd_qixter< const image3d<T>, W >
    {
      typedef dpoints_bkd_pixter< const image3d<T> > ret;
    };

    // nixter

    template <typename T, typename W>
    struct fwd_nixter< image3d<T>, W >
    {
      typedef dpoints_fwd_pixter< image3d<T> > ret;
    };

    template <typename T, typename W>
    struct fwd_nixter< const image3d<T>, W >
    {
      typedef dpoints_fwd_pixter< const image3d<T> > ret;
    };

    template <typename T, typename W>
    struct bkd_nixter< image3d<T>, W >
    {
      typedef dpoints_bkd_pixter< image3d<T> > ret;
    };

    template <typename T, typename W>
    struct bkd_nixter< const image3d<T>, W >
    {
      typedef dpoints_bkd_pixter< const image3d<T> > ret;
    };
686

Simon Nivault's avatar
Simon Nivault committed
687
688
689
690
691
  } // end of namespace mln::trait

} // end of namespace mln


692
#endif // ! MLN_CORE_IMAGE_IMAGE3D_HH