DMRITool  v0.1.1-139-g860d86b4
Diffusion MRI Tool
SHCoefficientsPower.cxx
Go to the documentation of this file.
1 
11 #include "SHCoefficientsPowerCLP.h"
12 
14 #include "utl.h"
16 
21 int
22 main (int argc, char const* argv[])
23 {
24  // GenerateCLP
25  PARSE_ARGS;
26 
27  utlGlobalException(_Power==1, "need to set power which is not 1");
28 
29  typedef double PrecisionType;
30  typedef itk::VectorImage<PrecisionType, 3> ImageType;
31 
33  FilterType::Pointer filter = FilterType::New();
34 
35  ImageType::Pointer shImage = ImageType::New();
36  itk::ReadImage<ImageType>(_InputFile, shImage);
37 
38  filter->SetInput(shImage);
39  filter->SetPower(_Power);
40  filter->SetSHRank(_SHRank>0 ? _SHRank : utl::DimToRankSH(shImage->GetNumberOfComponentsPerPixel()));
41 
43  if (_ShowProgressArg.isSet())
44  filter->AddObserver( itk::ProgressEvent(), observer );
45  if (_Debug)
46  filter->DebugOn();
47  if (_NumberOfThreads>0)
48  filter->SetNumberOfThreads(_NumberOfThreads);
49 
50  filter->Update();
51 
52  ImageType::Pointer shPowerImage = filter->GetOutput();
53  itk::SaveImage<ImageType>(shPowerImage, _OutputFile);
54 
55  return 0;
56 }
int main(int argc, char const *argv[])
In each voxel, calculate a power function of a given spherical function. Both input function and outp...
helper functions specifically used in dmritool
int DimToRankSH(const int dimm)
Definition: utlDMRI.h:182
#define utlGlobalException(cond, expout)
Definition: utlCoreMacro.h:372
In each vxoel, the input VectorImage is a SH coefficient vector which represents a spherical function...