aimsalgo  5.1.2
Neuroimaging image processing
scale_control_d.h
Go to the documentation of this file.
1 /* Copyright (C) 2000-2013 CEA
2  *
3  * This software and supporting documentation were developed by
4  * bioPICSEL
5  * CEA/DSV/I²BM/MIRCen/LMN, Batiment 61,
6  * 18, route du Panorama
7  * 92265 Fontenay-aux-Roses
8  * France
9  */
10 
11 
12 #ifndef AIMS_REGISTRATION_SCALE_CONTROL_D_H
13 #define AIMS_REGISTRATION_SCALE_CONTROL_D_H
14 
15 
17 #include <math.h>
18 
19 
20 template <class T>
21 void ScaleControl::init(const carto::rc_ptr<carto::Volume< T > > ref, int level_start, int level_stop, double cutVar, double stopVar, double seuilCorrel, const Point3d& tailleBloc )
22 {
23  // Calcul du niveau de pyramide adequat si non precise...
24  _currentScale = level_start;
25  if(level_start==-1)
26  {
27  int dimoy = int( (ref->getSizeX() + ref->getSizeY())/2. + 0.5);
28  _currentScale = 0;
29  for(int i = 0;i<15;i++)
30  {
31  if(dimoy<64) break;
32  dimoy = int(dimoy/2. + 0.5);
33  _currentScale = i;
34  }
35  }
36 
37  _level_stop = level_stop;
38  if(level_stop==-1) _level_stop = (_currentScale>2) ? (_currentScale-2) : 0;
39 
40  _cutVar = cutVar;
41  if(cutVar==-1) _cutVar = 0.2 + _currentScale*0.2;
42  _cutVar = (_cutVar <= 1) ? _cutVar : 1;
43 
44  _stopVar = stopVar;
45  if(stopVar==-1) _stopVar = 0.2 + _level_stop*0.2;
46  _stopVar = (_stopVar<=_cutVar) ? _stopVar : _cutVar;
47 
48 
49 
50  // Toutes les valeurs suivantes sont en coordonnees voxels
51  _NN = ( (ref->getSizeX() < ref->getSizeY()) ? ref->getSizeX() : ref->getSizeY())/8;
52  _delta1 = _NN/4;
53  _delta2 = 4;
54  _derniere = false;
55  _seuilCorrel = seuilCorrel;
56  _tailleBloc = tailleBloc;
57  if(ref->getSizeZ()==1) _tailleBloc[2] = 1;
58 }
59 
60 
61 #endif
62 
void init(const carto::rc_ptr< carto::Volume< T > > ref, int level_start, int level_stop, double cutVar, double stopVar, double seuilCorrel, const Point3d &tailleBloc=Point3d(4, 4, 4))
reference_wrapper< T > ref(T &ref)