"tools/evalscope-data/reviews/qwen3-8B/math_500_Level 4.jsonl" did not exist on "59a0ec906d79370c4b4e27ec468a1dd12a36527c"
PostEddyCF.h 2.27 KB
Newer Older
wangkx1's avatar
init  
wangkx1 committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
// Declarations of classes and functions that
// perform a post-hoc registration of the shells
// for the eddy project/.
//
// post_registration.h
//
// Jesper Andersson, FMRIB Image Analysis Group
//
// Copyright (C) 2011 University of Oxford
//

#ifndef PostEddyCF_h
#define PostEddyCF_h

#include <cstdlib>
#include <string>
#include <vector>
#include <cmath>
#include "armawrap/newmat.h"
#ifndef EXPOSE_TREACHEROUS
#define EXPOSE_TREACHEROUS           // To allow us to use .set_sform etc
#endif
#include "newimage/newimageall.h"
#include "miscmaths/miscmaths.h"
#include "miscmaths/nonlin.h"
#include "EddyHelperClasses.h"
#include "ECModels.h"

namespace EDDY {


/****************************************************************//**
*
* \brief Class used to implement a Mutual Information cost-
* function for post-hoc registration of shells in the eddy project.
*
* Class used to implement a Mutual Information cost-
* function for post-hoc registration of shells in the eddy project.
* It is implemented using the "Pimpl idiom" which means that this class
* only implements an interface whereas the actual work is being performed
* by the PostEddyCFImpl class which is declared and defined in
* PostEddyCF.cpp or cuda/PostEddyCF.cu depending on what platform
* the code is compiled for.
*
********************************************************************/
class PostEddyCFImpl;
class PostEddyCF : public MISCMATHS::NonlinCF
{
public:
  PostEddyCF(const NEWIMAGE::volume<float>&  ref,
	     const NEWIMAGE::volume<float>&  ima,
	     const NEWIMAGE::volume<float>&  mask,
	     unsigned int                    nbins);
  PostEddyCF(const NEWIMAGE::volume<float>&  ref,
	     const NEWIMAGE::volume<float>&  ima,
	     const NEWIMAGE::volume<float>&  mask,
	     unsigned int                    nbins,
	     unsigned int                    pe_dir);
  ~PostEddyCF();
  NEWIMAGE::volume<float> GetTransformedIma(const NEWMAT::ColumnVector& p) const;
  double cf(const NEWMAT::ColumnVector& p) const;
  NEWMAT::ReturnMatrix grad(const NEWMAT::ColumnVector& p) const;
private:
  int                        _pe_dir;  // 0 for x, 1 for y
  MutualInfoHelper           _fwd_mih;
  MutualInfoHelper           _bwd_mih;
  PostEddyCFImpl             *_pimpl;
};

} // End namespace EDDY

#endif // End #ifndef PostEddyCF_h