DMRITool  v0.1.1-139-g860d86b4
Diffusion MRI Tool
SHCoefficientsToGFA.cxx
Go to the documentation of this file.
1 
11 #include "SHCoefficientsToGFACLP.h"
12 
13 #include "utl.h"
16 
20 int
21 main (int argc, char const* argv[])
22 {
23  // GenerateCLP
24  PARSE_ARGS;
25 
26  typedef double TScalarType;
27  typedef itk::VectorImage<TScalarType,3> VectorImageType;
28  typedef itk::Image<TScalarType,3> ImageType;
29 
30  VectorImageType::Pointer shImage = VectorImageType::New();
31  itk::ReadVectorImage(_InputSHFile, shImage);
32 
34  FilterType::Pointer filter = FilterType::New();
35 
36  if (_Power==1)
37  {
38  filter->SetInput(shImage);
39  }
40  else
41  {
43  FilterType::Pointer shFilter = FilterType::New();
44 
45 
46  shFilter->SetInput(shImage);
47  shFilter->SetPower(_Power);
48  shFilter->SetSHRank(utl::DimToRankSH(shImage->GetNumberOfComponentsPerPixel()));
49 
50  shFilter->Update();
51 
52  VectorImageType::Pointer shPowerImage = shFilter->GetOutput();
53  filter->SetInput(shPowerImage);
54  }
55 
56  filter->Update();
57  ImageType::Pointer gfaImage = filter->GetOutput();
58 
59  itk::SaveImage(gfaImage, _OutputFile);
60 
61  return 0;
62 }
int main(int argc, char const *argv[])
Calculate GFA from SH coefficients.
helper functions specifically used in dmritool
void ReadVectorImage(const std::string &filename, SmartPointer< VectorImage< PixelType, 3 > > &image, const std::string &printInfo="Reading Image:")
Definition: utl.h:66
bool SaveImage(const SmartPointer< ImageType > &image, const std::string &filename, const std::string &printInfo="Writing Image:")
Definition: utlITK.h:157
int DimToRankSH(const int dimm)
Definition: utlDMRI.h:182
In each vxoel, calculate gfa from SH coefficients.
itk::VectorImage< ScalarType, 3 > VectorImageType
Definition: 4DImageMath.cxx:30
In each vxoel, calculate gfa from SH coefficients Created "02-12-2014.
In each vxoel, the input VectorImage is a SH coefficient vector which represents a spherical function...