ANIMA  4.0
animaPatientToGroupODFComparisonImageFilter.hxx
Go to the documentation of this file.
1 #pragma once
3 
4 namespace anima
5 {
6 
7 template <class PixelScalarType>
8 void
11 {
12  Superclass::BeforeThreadedGenerateData();
13 
14  unsigned int ndim = this->GetInput(0)->GetNumberOfComponentsPerPixel();
15  m_LOrder = (unsigned int)floor((-3.0 + sqrt(8.0 * ndim + 1.0))/2.0);
16 
17  if (m_ShData)
18  delete m_ShData;
19 
20  m_ShData = new anima::ODFSphericalHarmonicBasis (m_LOrder);
21 }
22 
23 template <class PixelScalarType>
24 unsigned int
26 ::SampleFromDiffusionModels(std::vector <VectorType> &databaseValues,
27  VectorType &patientVectorValue)
28 {
29  if (m_SampleDirections.size() == 0)
30  return patientVectorValue.GetSize();
31 
32  unsigned int numItems = databaseValues.size();
33  for (unsigned int i = 0;i < numItems;++i)
34  databaseValues[i] = m_ShData->GetSampleValues(databaseValues[i],m_SampleDirections);
35 
36  patientVectorValue = m_ShData->GetSampleValues(patientVectorValue,m_SampleDirections);
37 
38  return patientVectorValue.GetSize();
39 }
40 
41 } // end namespace anima
unsigned int SampleFromDiffusionModels(std::vector< VectorType > &databaseValues, VectorType &patientVectorValue) ITK_OVERRIDE