11 #include "SPFToScalarMapCLP.h" 20 main (
int argc,
char const* argv[])
25 typedef double PrecisionType;
27 typedef itk::Image<PrecisionType, 3> ScalarImageType;
29 VectorImageType::Pointer spf=NULL;
30 ScalarImageType::Pointer maskImage=NULL;
31 itk::ReadImage<VectorImageType>(_InputSPFFile, spf);
32 if (_MaskFileArg.isSet())
33 itk::ReadImage<ScalarImageType>(_MaskFile, maskImage);
35 ScalarImageType::Pointer mdImage= ScalarImageType::New();
36 ScalarImageType::Pointer scaleImage= ScalarImageType::New();
37 if (_MDImageFileArg.isSet())
39 itk::ReadImage<ScalarImageType>(_MDImageFile, mdImage);
42 ScaleFromMDfilterType::Pointer scaleFromMDfilter = ScaleFromMDfilterType::New();
43 scaleFromMDfilter->SetMD0(_MD0);
44 scaleFromMDfilter->SetTau(_Tau);
45 scaleFromMDfilter->SetIsOriginalBasis(
true);
46 scaleFromMDfilter->SetInput(mdImage);
47 scaleFromMDfilter->Update();
48 scaleImage = scaleFromMDfilter->GetOutput();
54 FilterType::Pointer featureFromSPFFilter = FilterType::New();
55 if (_MaskFileArg.isSet())
56 featureFromSPFFilter->SetMaskImage(maskImage);
57 featureFromSPFFilter->SetSHRank(_SHRank);
58 featureFromSPFFilter->SetRadialRank(_RadialRank);
59 featureFromSPFFilter->SetMD0(_MD0);
60 featureFromSPFFilter->SetTau(_Tau);
61 featureFromSPFFilter->SetBasisScale(_Scale);
62 featureFromSPFFilter->SetBasisType(FeaturesFromSPFFilterType::SPF);
63 if (_MDImageFileArg.isSet())
65 featureFromSPFFilter->SetScaleImage(scaleImage);
68 featureFromSPFFilter->SetMapType(FilterType::RTO);
69 else if(_MapType==
"MSD")
70 featureFromSPFFilter->SetMapType(FilterType::MSD);
71 else if(_MapType==
"PFA")
72 featureFromSPFFilter->SetMapType(FilterType::PFA);
74 featureFromSPFFilter->DebugOn();
75 featureFromSPFFilter->SetInput(spf);
76 if (_NumberOfThreads>0)
77 featureFromSPFFilter->SetNumberOfThreads(_NumberOfThreads);
80 if (_ShowProgressArg.isSet())
81 featureFromSPFFilter->AddObserver( itk::ProgressEvent(), observer );
83 std::cout <<
"Scalar map estimation starts" << std::endl << std::flush;
84 featureFromSPFFilter->Update();
85 std::cout <<
"Scalar map estimation ends" << std::endl << std::flush;
87 ScalarImageType::Pointer p0 = featureFromSPFFilter->GetOutput();
88 itk::SaveImage<ScalarImageType>(p0, _OutputFile);
calculate ODFs from SPF coefficients
int main(int argc, char const *argv[])
calculate RTO map from SPF coefficients
Compute SPF scale from mean diffusivity.
SmartPointer< Self > Pointer
itk::VectorImage< ScalarType, 3 > VectorImageType
Compute some features (DWI/EAP profile, ODFs, scalar indices) from SPF coefficients.