aimsdata  5.1.2
Neuroimaging data handling
threshold.h
Go to the documentation of this file.
1 /* This software and supporting documentation are distributed by
2  * Institut Federatif de Recherche 49
3  * CEA/NeuroSpin, Batiment 145,
4  * 91191 Gif-sur-Yvette cedex
5  * France
6  *
7  * This software is governed by the CeCILL-B license under
8  * French law and abiding by the rules of distribution of free software.
9  * You can use, modify and/or redistribute the software under the
10  * terms of the CeCILL-B license as circulated by CEA, CNRS
11  * and INRIA at the following URL "http://www.cecill.info".
12  *
13  * As a counterpart to the access to the source code and rights to copy,
14  * modify and redistribute granted by the license, users are provided only
15  * with a limited warranty and the software's author, the holder of the
16  * economic rights, and the successive licensors have only limited
17  * liability.
18  *
19  * In this respect, the user's attention is drawn to the risks associated
20  * with loading, using, modifying and/or developing or reproducing the
21  * software by the user in light of its specific status of free software,
22  * that may mean that it is complicated to manipulate, and that also
23  * therefore means that it is reserved for developers and experienced
24  * professionals having in-depth computer knowledge. Users are therefore
25  * encouraged to load and test the software's suitability as regards their
26  * requirements in conditions enabling the security of their systems and/or
27  * data to be ensured and, more generally, to use and operate it in the
28  * same conditions as regards security.
29  *
30  * The fact that you are presently reading this means that you have had
31  * knowledge of the CeCILL-B license and that you accept its terms.
32  */
33 
34 /*
35  * Threshold operators
36  */
37 #ifndef AIMS_UTILITY_THRESHOLD_H
38 #define AIMS_UTILITY_THRESHOLD_H
39 
40 #include <iostream>
41 #include <limits>
42 #include <functional>
43 
46 #include <aims/mesh/texture.h>
47 
48 
50 {
65 };
66 
92 template <class T,class U>
94 {
95 public:
103  inline AimsThreshold( threshold_t type,T level,T level2 = 0,
104  T backgd = 0,
106  || (std::numeric_limits<U>::max() >= 32767)
107  ? 32767 : std::numeric_limits<U>::max() ) );
108  virtual ~AimsThreshold() {}
109 
114  inline carto::VolumeRef<T> clip(const carto::VolumeRef<T> &sqv);
116  inline carto::VolumeRef<U> bin(const carto::VolumeRef<T> &sqv);
117 
118 protected:
127 };
128 
129 template <class T,class U>
131 {
132 public:
139  inline AimsTexThreshold( threshold_t type,T level,T level2=0, T backgd = 0 );
140  virtual ~AimsTexThreshold() {}
141 
143  inline TimeTexture<T> operator () (const TimeTexture<T> &sqv);
145  inline TimeTexture<U> bin(const TimeTexture<T> &sqv);
146 
147 protected:
155 };
156 
157 template <class T,class U> inline
159  T backgd, U foregd )
160  : _type( type ), _level( level ), _level2( level2 ), _backgd( backgd ), _foregd( foregd )
161 {
162 }
163 
164 template <class T,class U> inline
166  T backgd )
167  : _type( type ), _level( level ), _level2( level2 ), _backgd( backgd )
168 {
169 }
170 
171 namespace internal
172 {
173 
174  template <typename LEFT, typename OP>
175  struct thresh1: public std::unary_function<LEFT, LEFT>
176  {
178  : std::unary_function<LEFT, LEFT>(), threshold( threshold ),
180  {
181  }
182 
183  LEFT operator() (const LEFT & x) const
184  {
185  return OP()( x, threshold ) ? x : background;
186  }
187 
188  LEFT threshold;
190  };
191 
192 
193  template <typename T>
195  {
196  bool operator() (const T & x, const T & y, const T & z) const
197  {
198  return x >= y && x <= z;
199  }
200  };
201 
202 
203  template <typename T>
205  {
206  bool operator() (const T & x, const T & y, const T & z) const
207  {
208  return x > y && x <= z;
209  }
210  };
211 
212 
213  template <typename T>
215  {
216  bool operator() (const T & x, const T & y, const T & z) const
217  {
218  return x >= y && x < z;
219  }
220  };
221 
222 
223  template <typename T>
225  {
226  bool operator() (const T & x, const T & y, const T & z) const
227  {
228  return x > y && x < z;
229  }
230  };
231 
232 
233  template <typename T>
235  {
236  bool operator() (const T & x, const T & y, const T & z) const
237  {
238  return x <= y || x >= z;
239  }
240  };
241 
242 
243  template <typename T>
245  {
246  bool operator() (const T & x, const T & y, const T & z) const
247  {
248  return x < y || x >= z;
249  }
250  };
251 
252 
253  template <typename T>
255  {
256  bool operator() (const T & x, const T & y, const T & z) const
257  {
258  return x <= y || x > z;
259  }
260  };
261 
262 
263  template <typename T>
265  {
266  bool operator() (const T & x, const T & y, const T & z) const
267  {
268  return x < y || x > z;
269  }
270  };
271 
272 
273  template <typename LEFT, typename OP>
274  struct thresh2: public std::unary_function<LEFT, LEFT>
275  {
277  : std::unary_function<LEFT, LEFT>(), threshold1( threshold1 ),
279  {
280  }
281 
282  LEFT operator() (const LEFT & x) const
283  {
284  return OP()( x, threshold1, threshold2 ) ? x : background;
285  }
286 
290  };
291 
292 }
293 
294 template <class T,class U> inline
296 {
297  carto::VolumeRef<T> res( sqv.getSize(), sqv.getBorders() );
298  res.setVoxelSize( sqv.getVoxelSize() );
299 
300  res = T( 0 );
301 
302  switch (_type)
303  { case AIMS_LOWER_THAN :
305  *sqv, *res,
306  ::internal::thresh1<T, carto::volumeutil::less<T> >( _level, _backgd ) );
307  break;
310  *sqv, *res,
312  _backgd ) );
313  break;
314  case AIMS_GREATER_THAN :
316  *sqv, *res,
318  _backgd ) );
319  break;
322  *sqv, *res,
324  _level, _backgd ) );
325  break;
326  case AIMS_EQUAL_TO :
328  *sqv, *res,
330  _level, _backgd ) );
331  break;
332  case AIMS_DIFFER :
334  *sqv, *res,
336  _level, _backgd ) );
337  break;
338  case AIMS_BETWEEN :
340  *sqv, *res,
342  _level, _level2, _backgd ) );
343  break;
346  *sqv, *res,
348  _level, _level2, _backgd ) );
349  break;
352  *sqv, *res,
354  _level, _level2, _backgd ) );
355  break;
358  *sqv, *res,
360  _level, _level2, _backgd ) );
361  break;
362  case AIMS_OUTSIDE :
364  *sqv, *res,
366  _level, _level2, _backgd ) );
367  break;
370  *sqv, *res,
372  _level, _level2, _backgd ) );
373  break;
376  *sqv, *res,
378  _level, _level2, _backgd ) );
379  break;
382  *sqv, *res,
384  _level, _level2, _backgd ) );
385  break;
386  }
387 
388  res.copyHeaderFrom( sqv.header() );
389  return(res);
390 }
391 
392 namespace internal
393 {
394 
395  template <typename LEFT, typename OP>
396  struct clip1: public std::unary_function<LEFT, LEFT>
397  {
398  clip1( LEFT threshold )
399  : std::unary_function<LEFT, LEFT>(), threshold( threshold )
400  {
401  }
402 
403  LEFT operator() (const LEFT & x) const
404  {
405  return OP()( x, threshold ) ? x : threshold;
406  }
407 
408  LEFT threshold;
409  };
410 
411 
412  template <typename T>
414  {
415  int operator() (const T & x, const T & y, const T & z) const
416  {
417  if( x < y )
418  return -1;
419  return x <= z ? 0 : 1;
420  }
421  };
422 
423 
424  template <typename T>
426  {
427  int operator() (const T & x, const T & y, const T & z) const
428  {
429  if( x <= y )
430  return -1;
431  return x <= z ? 0 : 1;
432  }
433  };
434 
435 
436  template <typename T>
438  {
439  int operator() (const T & x, const T & y, const T & z) const
440  {
441  if( x < y )
442  return -1;
443  return x < z ? 0 : 1;
444  }
445  };
446 
447 
448  template <typename T>
450  {
451  int operator() (const T & x, const T & y, const T & z) const
452  {
453  if( x <= y )
454  return -1;
455  return x < z ? 0 : 1;
456  }
457  };
458 
459 
460  template <typename LEFT, typename OP>
461  struct clip2: public std::unary_function<LEFT, LEFT>
462  {
464  : std::unary_function<LEFT, LEFT>(), threshold1( threshold1 ),
466  {
467  }
468 
469  LEFT operator() (const LEFT & x) const
470  {
471  switch( OP()( x, threshold1, threshold2 ) )
472  {
473  case -1:
474  return threshold1;
475  case 0:
476  return x;
477  case 1:
478  return threshold2;
479  }
480  return x; // should not happen, just avoids a warning.
481  }
482 
485  };
486 
487 }
488 
489 template <class T,class U> inline
491 {
492  carto::VolumeRef<T> res( sqv.getSize(), sqv.getBorders() );
493  res.setVoxelSize( sqv.getVoxelSize() );
494 
495  res = T( 0 );
496 
497  typename carto::VolumeRef<T>::iterator it1;
499 
500  switch (_type)
501  { case AIMS_LOWER_THAN :
503  *sqv, *res,
504  ::internal::clip1<T, carto::volumeutil::less<T> >( _level ) );
505  break;
508  *sqv, *res,
510  break;
511  case AIMS_GREATER_THAN :
513  *sqv, *res,
515  break;
518  *sqv, *res,
520  break;
521  case AIMS_BETWEEN :
523  *sqv, *res,
525  _level, _level2 ) );
526  break;
529  *sqv, *res,
531  _level, _level2 ) );
532  break;
535  *sqv, *res,
537  _level, _level2 ) );
538  break;
541  *sqv, *res,
543  _level, _level2 ) );
544  break;
545  case AIMS_OUTSIDE :
549  case AIMS_EQUAL_TO :
550  case AIMS_DIFFER :
551  // Clipping has no real meaning in those cases, thus we do standard
552  // thresholding instead.
553  std::cerr << "Warning: AimsThreshold cannot use clipping with this mode, "
554  "using standard clipping instead." << std::endl;
555  return (*this)(sqv);
556  }
557 
558  res.copyHeaderFrom( sqv.header() );
559  return(res);
560 }
561 
562 template <class T,class U> inline
564 {
565 
566  unsigned i, n = sqv.nItem(), t , tm = sqv.size();
567  TimeTexture<T> res = sqv;
568 
569  switch (_type)
570  { case AIMS_LOWER_THAN :
571  for (t = 0; t < tm ; ++t)
572  for (i = 0; i < n ; ++i)
573  res.item( i ) = ( res[t].item( i ) < _level ? res[t].item( i )
574  : _backgd);
575  break;
576  case AIMS_LOWER_OR_EQUAL_TO :
577  for (t = 0; t < tm ; ++t)
578  for (i = 0; i < n ; ++i)
579  res.item( i ) = ( res[t].item( i ) <= _level ? res[t].item( i )
580  : _backgd);
581  break;
582  case AIMS_GREATER_THAN :
583  for (t = 0; t < tm ; ++t)
584  for (i = 0; i < n ; ++i)
585  res.item( i ) = ( res[t].item( i ) > _level ? res[t].item( i )
586  : _backgd);
587  break;
589  for (t = 0; t < tm ; ++t)
590  for (i = 0; i < n ; ++i)
591  res.item( i ) = ( res[t].item( i ) >= _level ? res[t].item( i )
592  : _backgd);
593  break;
594  case AIMS_EQUAL_TO :
595  for (t = 0; t < tm ; ++t)
596  for (i = 0; i < n ; ++i)
597  res.item( i ) = ( res[t].item( i ) == _level ? res[t].item( i )
598  : _backgd);
599  break;
600  case AIMS_DIFFER :
601  for (t = 0; t < tm ; ++t)
602  for (i = 0; i < n ; ++i)
603  res.item( i ) = ( res[t].item( i ) != _level ? res[t].item( i )
604  : _backgd);
605  break;
606  case AIMS_BETWEEN :
607  for (t = 0; t < tm ; ++t)
608  for (i = 0; i < n ; ++i)
609  res.item( i ) = ( res[t].item( i ) >= _level && res[t].item( i )
610  <= _level2 ? res[t].item( i ) : _backgd);
611  break;
613  for (t = 0; t < tm ; ++t)
614  for (i = 0; i < n ; ++i)
615  res.item( i ) = ( res[t].item( i ) > _level && res[t].item( i )
616  <= _level2 ? res[t].item( i ) : _backgd);
617  break;
619  for (t = 0; t < tm ; ++t)
620  for (i = 0; i < n ; ++i)
621  res.item( i ) = ( res[t].item( i ) > _level && res[t].item( i )
622  < _level2 ? res[t].item( i ) : _backgd);
623  break;
625  for (t = 0; t < tm ; ++t)
626  for (i = 0; i < n ; ++i)
627  res.item( i ) = ( res[t].item( i ) > _level && res[t].item( i )
628  < _level2 ? res[t].item( i ) : _backgd);
629  break;
630  case AIMS_OUTSIDE :
631  for (t = 0; t < tm ; ++t)
632  for (i = 0; i < n ; ++i)
633  res.item( i ) = ( res[t].item( i ) < _level || res[t].item( i )
634  > _level2 ? (U) res[t].item( i ) : _backgd);
635  break;
637  for (t = 0; t < tm ; ++t)
638  for (i = 0; i < n ; ++i)
639  res.item( i ) = ( res[t].item( i ) <= _level || res[t].item( i )
640  > _level2 ? (U) res[t].item( i ) : _backgd);
641  break;
643  for (t = 0; t < tm ; ++t)
644  for (i = 0; i < n ; ++i)
645  res.item( i ) = ( res[t].item( i ) < _level || res[t].item( i )
646  >= _level2 ? (U) res[t].item( i ) : _backgd);
647  break;
649  for (t = 0; t < tm ; ++t)
650  for (i = 0; i < n ; ++i)
651  res.item( i ) = ( res[t].item( i ) <= _level || res[t].item( i )
652  >= _level2 ? (U) res[t].item( i ) : _backgd);
653  break;
654  }
655 
656  //No header for the texture yet...
657  return(res);
658 }
659 
660 namespace internal
661 {
662 
663  template <typename LEFT, typename RIGHT, typename OP>
664  struct thresh1_bin: public std::unary_function<LEFT, RIGHT>
665  {
667  : std::unary_function<LEFT, RIGHT>(), threshold( threshold ),
669  {
670  }
671 
672  RIGHT operator() (const LEFT & x) const
673  {
674  return OP()( x, threshold ) ? foreground : 0;
675  }
676 
677  LEFT threshold;
678  RIGHT foreground;
679  };
680 
681 
682  template <typename LEFT, typename RIGHT, typename OP>
683  struct thresh2_bin: public std::unary_function<LEFT, RIGHT>
684  {
686  : std::unary_function<LEFT, RIGHT>(), threshold1( threshold1 ),
688  {
689  }
690 
691  RIGHT operator() (const LEFT & x) const
692  {
693  return OP()( x, threshold1, threshold2 ) ? foreground : 0;
694  }
695 
698  RIGHT foreground;
699  };
700 
701 }
702 
703 template <class T,class U> inline
705 {
706  carto::VolumeRef<U> res( sqv.getSize(), sqv.getBorders() );
707  res.setVoxelSize( sqv.getVoxelSize() );
708 
709  res = U( 0 );
710 
711  typename carto::VolumeRef<U>::iterator it1;
713 
714  switch (_type)
715  {
716 
717  case AIMS_LOWER_THAN :
719  *sqv, *res,
721  _level, _foregd ) );
722  break;
723  case AIMS_LOWER_OR_EQUAL_TO :
725  *sqv, *res,
727  _level, _foregd ) );
728  break;
729  case AIMS_GREATER_THAN :
731  *sqv, *res,
733  _level, _foregd ) );
734  break;
737  *sqv, *res,
739  _level, _foregd ) );
740  break;
741  case AIMS_EQUAL_TO :
743  *sqv, *res,
745  _level, _foregd ) );
746  break;
747  case AIMS_DIFFER :
749  *sqv, *res,
751  _level, _foregd ) );
752  break;
753  case AIMS_BETWEEN :
755  *sqv, *res,
757  _level, _level2, _foregd ) );
758  break;
761  *sqv, *res,
763  _level, _level2, _foregd ) );
764  break;
767  *sqv, *res,
769  _level, _level2, _foregd ) );
770  break;
773  *sqv, *res,
775  _level, _level2, _foregd ) );
776  break;
777  case AIMS_OUTSIDE :
779  *sqv, *res,
781  _level, _level2, _foregd ) );
782  break;
785  *sqv, *res,
787  _level, _level2, _foregd ) );
788  break;
791  *sqv, *res,
793  _level, _level2, _foregd ) );
794  break;
797  *sqv, *res,
799  _level, _level2, _foregd ) );
800  break;
801  }
802 
803  res.copyHeaderFrom( sqv.header() );
804  return(res);
805 }
806 
807 template <class T,class U> inline
809 {
810  unsigned i, n = sqv.nItem(), t , tm = sqv.size();
811  TimeTexture<T> temp = sqv ;
812  TimeTexture<U> res;
813 
814  switch (_type)
815  { case AIMS_LOWER_THAN :
816  for (t = 0; t < tm ; ++t)
817  for (i = 0; i < n ; ++i)
818  if ( temp[t].item( i ) < _level)
819  res[t].push_back( 1 );
820  else
821  res[t].push_back( 0 );
822 
823  break;
824  case AIMS_LOWER_OR_EQUAL_TO :
825  for (t = 0; t < tm ; ++t)
826  for (i = 0; i < n ; ++i)
827  if ( temp[t].item( i ) <= _level)
828  res[t].push_back( 1 );
829  else
830  res[t].push_back( 0 );
831  break;
832  case AIMS_GREATER_THAN :
833  for (t = 0; t < tm ; ++t)
834  for (i = 0; i < n ; ++i)
835  if ( temp[t].item( i ) > _level)
836  res[t].push_back( 1 );
837  else
838  res[t].push_back( 0 );
839  break;
841  for (t = 0; t < tm ; ++t)
842  for (i = 0; i < n ; ++i)
843  if ( temp[t].item( i ) >= _level)
844  res[t].push_back( 1 );
845  else
846  res[t].push_back( 0 );
847  break;
848  case AIMS_EQUAL_TO :
849  for (t = 0; t < tm ; ++t)
850  for (i = 0; i < n ; ++i)
851  if ( temp[t].item( i ) == _level)
852  res[t].push_back( 1 );
853  else
854  res[t].push_back( 0 );
855  break;
856  case AIMS_DIFFER :
857  for (t = 0; t < tm ; ++t)
858  for (i = 0; i < n ; ++i)
859  if ( temp[t].item( i ) != _level)
860  res[t].push_back( 1 );
861  else
862  res[t].push_back( 0 );
863  break;
864  case AIMS_BETWEEN :
865  for (t = 0; t < tm ; ++t)
866  for (i = 0; i < n ; ++i)
867  if ( temp[t].item( i ) >= _level
868  && temp[t].item( i ) <= _level2 )
869  res[t].push_back( 1 );
870  else
871  res[t].push_back( 0 );
872  break;
874  for (t = 0; t < tm ; ++t)
875  for (i = 0; i < n ; ++i)
876  if ( temp[t].item( i ) > _level
877  && temp[t].item( i ) <= _level2 )
878  res[t].push_back( 1 );
879  else
880  res[t].push_back( 0 );
881  break;
883  for (t = 0; t < tm ; ++t)
884  for (i = 0; i < n ; ++i)
885  if ( temp[t].item( i ) >= _level
886  && temp[t].item( i ) < _level2 )
887  res[t].push_back( 1 );
888  else
889  res[t].push_back( 0 );
890  break;
892  for (t = 0; t < tm ; ++t)
893  for (i = 0; i < n ; ++i)
894  if ( temp[t].item( i ) > _level
895  && temp[t].item( i ) < _level2 )
896  res[t].push_back( 1 );
897  else
898  res[t].push_back( 0 );
899  break;
900  case AIMS_OUTSIDE :
901  for (t = 0; t < tm ; ++t)
902  for (i = 0; i < n ; ++i)
903  if ( temp[t].item( i ) < _level
904  && temp[t].item( i ) > _level2 )
905  res[t].push_back( 1 );
906  else
907  res[t].push_back( 0 );
908  break;
910  for (t = 0; t < tm ; ++t)
911  for (i = 0; i < n ; ++i)
912  if ( temp[t].item( i ) <= _level
913  && temp[t].item( i ) > _level2 )
914  res[t].push_back( 1 );
915  else
916  res[t].push_back( 0 );
917  break;
919  for (t = 0; t < tm ; ++t)
920  for (i = 0; i < n ; ++i)
921  if ( temp[t].item( i ) < _level
922  && temp[t].item( i ) >= _level2 )
923  res[t].push_back( 1 );
924  else
925  res[t].push_back( 0 );
926  break;
928  for (t = 0; t < tm ; ++t)
929  for (i = 0; i < n ; ++i)
930  if ( temp[t].item( i ) <= _level
931  && temp[t].item( i ) >= _level2 )
932  res[t].push_back( 1 );
933  else
934  res[t].push_back( 0 );
935  break;
936  }
937 
938  //No header for the texture yet...
939  return(res);
940 }
941 
942 
943 #endif
TimeTexture< T > operator()(const TimeTexture< T > &sqv)
Return the multi-level thresholded texture.
Definition: threshold.h:563
virtual ~AimsTexThreshold()
Definition: threshold.h:140
threshold_t _type
Threshold type.
Definition: threshold.h:149
T _level
Lower level or unique level.
Definition: threshold.h:151
AimsTexThreshold(threshold_t type, T level, T level2=0, T backgd=0)
Texture thresholding.
Definition: threshold.h:165
TimeTexture< U > bin(const TimeTexture< T > &sqv)
Return the binary thresholded texture.
Definition: threshold.h:808
T _level2
Upper level.
Definition: threshold.h:153
The template class to make thresholds.
Definition: threshold.h:94
carto::VolumeRef< U > bin(const carto::VolumeRef< T > &sqv)
Return the binary thresholded image.
Definition: threshold.h:704
carto::VolumeRef< T > clip(const carto::VolumeRef< T > &sqv)
Return the multi-level thresholded image with clipped values (backgd ignored)
Definition: threshold.h:490
virtual ~AimsThreshold()
Definition: threshold.h:108
T _level2
Upper level.
Definition: threshold.h:124
threshold_t _type
Threshold type.
Definition: threshold.h:120
carto::VolumeRef< T > operator()(const carto::VolumeRef< T > &sqv)
Return the multi-level thresholded image.
Definition: threshold.h:295
AimsThreshold(threshold_t type, T level, T level2=0, T backgd=0, U foregd=(U)(!std::numeric_limits< U >::is_specialized||(std::numeric_limits< U >::max() >=32767) ? 32767 :std::numeric_limits< U >::max()))
Volume thresholding.
Definition: threshold.h:158
T _level
Lower level or unique level.
Definition: threshold.h:122
void push_back(const T &item)
Definition: texture.h:156
const T & item(int n) const
Definition: texture.h:151
size_t nItem() const
Definition: texture.h:149
std::vector< int > getBorders() const
void setVoxelSize(float vx, float vy=1., float vz=1., float vt=1.)
std::vector< float > getVoxelSize() const
virtual void copyHeaderFrom(const PropertySet &other)
std::vector< int > getSize() const
Volume< T >::iterator iterator
const PropertySet & header() const
Volume< T >::const_iterator const_iterator
Volume< OUTP > & applyTowards(const T &cst1, const Volume< U > &vol2, Volume< OUTP > &dst, BinaryFunction func)
bool operator()(const T &x, const T &y, const T &z) const
Definition: threshold.h:196
bool operator()(const T &x, const T &y, const T &z) const
Definition: threshold.h:216
bool operator()(const T &x, const T &y, const T &z) const
Definition: threshold.h:206
bool operator()(const T &x, const T &y, const T &z) const
Definition: threshold.h:226
clip1(LEFT threshold)
Definition: threshold.h:398
LEFT operator()(const LEFT &x) const
Definition: threshold.h:403
clip2(LEFT threshold1, LEFT threshold2)
Definition: threshold.h:463
LEFT operator()(const LEFT &x) const
Definition: threshold.h:469
bool operator()(const T &x, const T &y, const T &z) const
Definition: threshold.h:236
bool operator()(const T &x, const T &y, const T &z) const
Definition: threshold.h:256
bool operator()(const T &x, const T &y, const T &z) const
Definition: threshold.h:246
bool operator()(const T &x, const T &y, const T &z) const
Definition: threshold.h:266
int operator()(const T &x, const T &y, const T &z) const
Definition: threshold.h:415
int operator()(const T &x, const T &y, const T &z) const
Definition: threshold.h:427
int operator()(const T &x, const T &y, const T &z) const
Definition: threshold.h:439
int operator()(const T &x, const T &y, const T &z) const
Definition: threshold.h:451
RIGHT operator()(const LEFT &x) const
Definition: threshold.h:672
thresh1_bin(LEFT threshold, RIGHT foreground)
Definition: threshold.h:666
thresh1(LEFT threshold, LEFT background)
Definition: threshold.h:177
LEFT operator()(const LEFT &x) const
Definition: threshold.h:183
thresh2_bin(LEFT threshold1, LEFT threshold2, RIGHT foreground)
Definition: threshold.h:685
RIGHT operator()(const LEFT &x) const
Definition: threshold.h:691
thresh2(LEFT threshold1, LEFT threshold2, LEFT background)
Definition: threshold.h:276
LEFT operator()(const LEFT &x) const
Definition: threshold.h:282
threshold_t
Definition: threshold.h:50
@ AIMS_EQUAL_TO
Definition: threshold.h:55
@ AIMS_LOWER_OR_EQUAL_TO
Definition: threshold.h:52
@ AIMS_DIFFER
Definition: threshold.h:56
@ AIMS_GREATER_OR_EQUAL_TO
Definition: threshold.h:54
@ AIMS_BETWEEN
Definition: threshold.h:57
@ AIMS_LOWER_THAN
Definition: threshold.h:51
@ AIMS_OUTSIDE_INCLUDE_LOWER_BOUND
Definition: threshold.h:62
@ AIMS_GREATER_THAN
Definition: threshold.h:53
@ AIMS_OUTSIDE
Definition: threshold.h:58
@ AIMS_BETWEEN_EXCLUDE_LOWER_BOUND
Definition: threshold.h:59
@ AIMS_OUTSIDE_INCLUDE_HIGHER_BOUND
Definition: threshold.h:63
@ AIMS_BETWEEN_EXCLUDE_HIGHER_BOUND
Definition: threshold.h:60
@ AIMS_BETWEEN_EXCLUDE_BOUNDS
Definition: threshold.h:61
@ AIMS_OUTSIDE_INCLUDE_BOUNDS
Definition: threshold.h:64