13 #include "SHCoefficientsToSphericalFunctionSamplesCLP.h" 22 main (
int argc,
char const* argv[])
27 typedef double TScalarType;
29 typedef itk::VectorImage<TScalarType,3> ImageType;
31 ImageType::Pointer inputImage = ImageType::New();
34 unsigned shDim = inputImage->GetNumberOfComponentsPerPixel();
41 std::cout <<
"basisMatrix: \n" << *basisMatrix;
44 FilterType::Pointer filter = FilterType::New();
46 filter->SetInput(inputImage);
47 filter->SetConstantMatrix(*basisMatrix);
50 ImageType::Pointer outputImage, sfImage;
51 sfImage = filter->GetOutput();
52 if (std::fabs(_Power-1.0)>1e-10)
57 itk::UnaryVectorOPImage<ImageType, ImageType>(sfImage, outputImage, pp);
60 outputImage = sfImage;
NDArray is a N-Dimensional array class (row-major, c version)
helper functions specifically used in dmritool
void ReadVectorImage(const std::string &filename, SmartPointer< VectorImage< PixelType, 3 > > &image, const std::string &printInfo="Reading Image:")
bool SaveImage(const SmartPointer< ImageType > &image, const std::string &filename, const std::string &printInfo="Writing Image:")
int DimToRankSH(const int dimm)
std::shared_ptr< NDArray< T, 2 > > ComputeSHMatrix(const unsigned int rank, const NDArray< T, 2 > &grad, const int mode)
int main(int argc, char const *argv[])
calculate samples of a spherical function from its SH coefficients
void SetArgument(TArgument arg)
In each vxoel, multiply the input vector by a matrix.