diff --git a/Modules/DiffusionImaging/mitkDiffusionFunctionCollection.cpp b/Modules/DiffusionImaging/mitkDiffusionFunctionCollection.cpp index 53d6d1dcc8..2d55483cec 100644 --- a/Modules/DiffusionImaging/mitkDiffusionFunctionCollection.cpp +++ b/Modules/DiffusionImaging/mitkDiffusionFunctionCollection.cpp @@ -1,101 +1,104 @@ -/*========================================================================= +/*=================================================================== -Program: Medical Imaging & Interaction Toolkit -Language: C++ -Date: $Date: 2009-07-14 19:11:20 +0200 (Tue, 14 Jul 2009) $ -Version: $Revision: 18127 $ +The Medical Imaging Interaction Toolkit (MITK) -Copyright (c) German Cancer Research Center, Division of Medical and -Biological Informatics. All rights reserved. -See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. +Copyright (c) German Cancer Research Center, +Division of Medical and Biological Informatics. +All rights reserved. -This software is distributed WITHOUT ANY WARRANTY; without even -the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR -PURPOSE. See the above copyright notices for more information. +This software is distributed WITHOUT ANY WARRANTY; without +even the implied warranty of MERCHANTABILITY or FITNESS FOR +A PARTICULAR PURPOSE. -=========================================================================*/ +See LICENSE.txt or http://www.mitk.org for details. + +===================================================================*/ #include "mitkDiffusionFunctionCollection.h" #include #include "mitkVector.h" +// for Windows +#ifndef M_PI +#define M_PI 3.14159265358979323846 + // Namespace ::SH #include #include #include // Namespace ::vnl_function //#include "vnl/vnl_vector.h" //------------------------- SH-function ------------------------------------ double mitk::sh::factorial(int number) { if(number <= 1) return 1; double result = 1.0; for(int i=1; i<=number; i++) result *= i; return result; } void mitk::sh::Cart2Sph(double x, double y, double z, double *cart) { double phi, th, rad; rad = sqrt(x*x+y*y+z*z); if( rad < mitk::eps ) { th = M_PI/2; phi = M_PI/2; } else { th = acos(z/rad); phi = atan2(y, x); } cart[0] = phi; cart[1] = th; cart[2] = rad; } double mitk::sh::legendre0(int l) { if( l%2 != 0 ) { return 0; } else { double prod1 = 1.0; for(int i=1;i vnl_vector mitk::vnl_function::element_cast (vnl_vector const& v1) { vnl_vector result(v1.size()); for(int i = 0 ; i < v1.size(); i++) result[i] = static_cast(v1[i]); return result; }