File: antsRegistrationTemplateHeader.cxx

package info (click to toggle)
ants 2.5.4%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 11,672 kB
  • sloc: cpp: 85,685; sh: 15,850; perl: 863; xml: 115; python: 111; makefile: 68
file content (93 lines) | stat: -rw-r--r-- 2,221 bytes parent folder | download
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
#include "antsRegistrationTemplateHeader.h"

namespace ants
{
const char *
RegTypeToFileName(const std::string & type, bool & writeInverse, bool & writeVelocityField, bool minc)
{
  std::string str(type);

  ConvertToLowerCase(str);
  if (str == "syn" || str == "symmetricnormalization" || str == "bsplinesyn" ||
      str == "timevaryingbsplinevelocityfield" || str == "tvdmffd" || str == "timevaryingvelocityfield" ||
      str == "tvf" || str == "exponential" || str == "bsplineexponential")
  {
    writeInverse = true;
  }
  else
  {
    writeInverse = false;
  }

  if (str == "timevaryingvelocityfield" || str == "tvf" || str == "exp" || str == "exponential" ||
      str == "bsplineexponential")
  {
    writeVelocityField = true;
  }
  else
  {
    writeVelocityField = false;
  }

  if (str == "rigid")
  {
    if (minc)
      return "_Rigid.xfm";
    else
      return "Rigid.mat";
  }
  else if (str == "affine" || str == "compositeaffine" || str == "compaff")
  {
    if (minc)
      return "_Affine.xfm";
    else
      return "Affine.mat";
  }
  else if (str == "similarity")
  {
    if (minc)
      return "_Similarity.xfm";
    else
      return "Similarity.mat";
  }
  else if (str == "translation")
  {
    if (minc)
      return "_Translation.xfm";
    else
      return "Translation.mat";
  }
  else if (str == "bspline" || str == "ffd")
  {
    if (minc)
      return "_BSpline.txt";
    else
      return "BSpline.txt";
  }
  else if (str == "genericaffine")
  {
    if (minc)
      return "_GenericAffine.xfm";
    else
      return "GenericAffine.mat";
  }
  else if (str == "gaussiandisplacementfield" || str == "gdf" || str == "bsplinedisplacementfield" || str == "dmffd" ||
           str == "syn" || str == "symmetricnormalization" || str == "bsplinesyn" || str == "exp" ||
           str == "exponential" || str == "bsplineexponential")
  {
    if (minc)
      return "_NL.xfm";
    else
      return "Warp.nii.gz";
  }
  else if (str == "timevaryingvelocityfield" || str == "tvf" || str == "timevaryingbsplinevelocityfield" ||
           str == "tvdmffd")
  {
    if (minc)
      return "_Warp.mnc";
    else
      return "Warp.nii.gz";
  }
  return "BOGUS.XXXX";
}
} // end namespace ants