18 #include "OrientationStatisticsCLP.h" 30 std::cout <<
"size = " << size << std::endl << std::flush;
32 int numberUniqueSamples=0, numberAntipodalSamples=0, numberRepeatedSamples=0;
33 scheme->
GetNumbers(numberUniqueSamples, numberAntipodalSamples, numberRepeatedSamples);
34 std::cout << numberUniqueSamples <<
" unique samples, " << numberAntipodalSamples <<
" antipodal samples, " << numberRepeatedSamples <<
" repeated samples." << std::endl << std::flush;
38 std::cout <<
"minimal angle = " << stats[0]*180.0/
M_PI <<
", radian=" << stats[0] <<
" (covering radius)" << std::endl << std::flush;
39 std::cout <<
"maximal angle = " << stats[1]*180.0/
M_PI <<
", radian=" << stats[1] << std::endl << std::flush;
40 std::cout <<
"mean angle = " << stats[2]*180.0/
M_PI << std::endl << std::flush;
41 std::cout <<
"std angle = " << stats[3]*180.0/
M_PI << std::endl << std::flush;
43 double ud2 = SamplingType::CalculateMinDistanceUpperBound(2*size);
44 double ud = SamplingType::CalculateMinDistanceUpperBound(size);
45 std::cout <<
"upper bound ("<< 2*size <<
" points) = " << ud2*180/
M_PI <<
", radian=" << ud2 << std::endl << std::flush;
46 std::cout <<
"upper bound ("<< size <<
" points) = " << ud*180/
M_PI <<
", radian=" << ud << std::endl << std::flush;
48 if (numberRepeatedSamples==0)
53 std::cout <<
"electrostaticEnergy (order=2) = " << electrostaticEnergy << std::endl << std::flush;
55 std::cout <<
"electrostaticEnergy (order=1) = " << electrostaticEnergy << std::endl << std::flush;
58 std::cout <<
"Spherical packing density = " << packing_density << std::endl << std::flush;
70 main (
int argc,
char const* argv[])
75 SamplingType::Pointer schemeAll = SamplingType::New();
78 for (
int i = 0; i < _InputOrientationFile.size(); i += 1 )
80 std::cout <<
"file: " << _InputOrientationFile[i] << std::endl << std::flush;
81 SamplingType::Pointer scheme = SamplingType::New();
82 scheme->ReadOrientationFile(_InputOrientationFile[i]);
85 std::cout << std::endl << std::flush;
86 if (_Combine && _InputOrientationFile.size()>1)
88 for (
int j = 0; j < scheme->size(); j += 1 )
89 schemeAll->AppendOrientation((*scheme)[j]);
93 if (_Combine && _InputOrientationFile.size()>1)
95 std::cout <<
"Combine " << _InputOrientationFile.size() <<
" orientations" << std::endl << std::flush;
99 std::cout <<
"Spherical code cost function = " << cost << std::endl << std::flush;
void GetNumbers(int &numberUniqueSamples, int &numberAntipodalSamples, int &numberRepeatedSamples) const
double processOrientation(const itk::SamplingScheme3D< double >::Pointer scheme, const bool _Asymmetric)
helper functions specifically used in dmritool
std::vector< double > GetContainerStats(IteratorType v1, IteratorType v2)
double CalculateElectrostaticEnergy(const double order=2.0, const bool isNormalize=true, const bool countHalf=true) const
int main(int argc, char const *argv[])
obtain energies, minimal angles from a given set of orientations
unsigned int GetNumberOfSamples() const
this class describes sampling in a 3D space (Q space or R space).
SmartPointer< Self > Pointer
double CalculateMinDistance(const unsigned int index, const bool isSymmetric=true) const
double CalculatePackingDensity(const bool isSymmetric=true) const