DMRITool  v0.1.1-139-g860d86b4
Diffusion MRI Tool
SamplingSchemeQSpaceIMOCEstimation.cxx
Go to the documentation of this file.
1 
19 #include "utl.h"
22 
23 #include "SamplingSchemeQSpaceIMOCEstimationCLP.h"
24 
29 int
30 main (int argc, char const* argv[])
31 {
32 
33  PARSE_ARGS;
34 
35  typedef itk::SamplingSchemeQSpace<double> SamplingType;
36  typedef SamplingType::Pointer SamplingPointer;
38  EstimationType::Pointer estimator = EstimationType::New();
39 
40  utlGlobalException(_NumberOfSamples.size()==0, "should give the numbers of samples in shells");
41  EstimationType::IndexVectorType numbers(_NumberOfSamples.size());
42  for ( unsigned int i = 0; i < _NumberOfSamples.size(); i += 1 )
43  numbers[i] = _NumberOfSamples[i];
44 
45  EstimationType::MatrixPointer fineOrientations(new EstimationType::MatrixType());
46 
47  estimator->SetDebug(_Debug);
48  estimator->SetNumbersInShell(numbers);
49  estimator->SetTessellationOrder(_Order);
50  if(_FineOrientationsArg.isSet())
51  {
52  fineOrientations = utl::ReadGrad<double>(_FineOrientations, DIRECTION_NODUPLICATE, CARTESIAN_TO_CARTESIAN);
53  estimator->SetFineOrientations(fineOrientations);
54  }
55  estimator->SetWeightForSingleShell(_Weight);
56  estimator->SetAngleMinChange(_MinChange);
57  estimator->SetChooseMinimalCoverageShell(true);
58 
59  itk::TimeProbe clock;
60  clock.Start();
61  estimator->UpdateOutputData();
62  clock.Stop();
63  std::cout << "Elapsed time : " << clock.GetTotal() << std::endl;
64 
65  SamplingPointer output = estimator->GetOutputOrientations();
66  // output->Print(std::cout<<"output");
67 
69  WriterType::Pointer writer = WriterType::New();
70  writer->SetSampling(output);
71  writer->SetOrientationFile(_OutputOrientations);
72  writer->SaveSingleShellOn();
73  writer->SaveAllShellsInOneFileOff();
74  writer->Update();
75 
76  return 0;
77 }
78 
Estimation of single/multi-shell orientations using Iterative Maximum Overlap Construction (IMOC) ...
helper functions specifically used in dmritool
int main(int argc, char const *argv[])
incrementatl estimation for single and multiple shell sampling scheme
#define utlGlobalException(cond, expout)
Definition: utlCoreMacro.h:372
this class describes sampling in Q space.
write orientations and b values (single/multiple shells) into text files