本文整理汇总了C++中ScalarField::init方法的典型用法代码示例。如果您正苦于以下问题:C++ ScalarField::init方法的具体用法?C++ ScalarField::init怎么用?C++ ScalarField::init使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ScalarField
的用法示例。
在下文中一共展示了ScalarField::init方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char *argv[])
{
char str[200];
int i;
if(argc<7 )
{
std::cout<<"Usage: dtiFA xsize ysize zsize input_dtfile output_fa_file switch_endian_input(0/1)\n";
exit(0);
}
int Xdim= atoi(argv[1]);
int Ydim= atoi(argv[2]);
int Zdim= atoi(argv[3]);
TensorField dti;
dti.init(Xdim,Ydim,Zdim);
int endian_be=0; endian_be= atoi(argv[6]);
if(endian_be)
{
//std::cout<<"Reading in big endian format\n";
dti.importRawFieldFromFile_BE(argv[4]);
}
else
{
dti.importRawFieldFromFile(argv[4]);
}
//std::cout<<"DTI read\n";
ScalarField fa;
fa.init(Xdim,Ydim,Zdim);
// fa.setVoxelSize(0,Xres); fa.setVoxelSize(1,Yres); fa.setVoxelSize(2,Zres);
dti.ComputeFA(&fa);
//std::cout<<"Smooth FA computed\n";
sprintf(str,"%s",argv[5]);
fa.exportRawFieldToFile(str);
return 0;
}
示例2: main
int main(int argc, char *argv[])
{
char str[200];
int i;
if(argc<7 )
{
std::cout<<"Usage: dtiTrace xsize ysize zsize input_dtfile output_trace_file switch_endian_input(0/1)\n";
exit(0);
}
int Xdim= atoi(argv[1]);
int Ydim= atoi(argv[2]);
int Zdim= atoi(argv[3]);
TensorField dti;
dti.init(Xdim,Ydim,Zdim);
int endian_be=0; endian_be= atoi(argv[6]);
if(endian_be)
dti.importRawFieldFromFile_BE(argv[4]);
else
dti.importRawFieldFromFile(argv[4]);
std::cout<<"DTI read\n";
//std::cout<<"DTI read\n";
ScalarField trace;
trace.init(Xdim,Ydim,Zdim);
// trace.setVoxelSize(0,Xres); trace.setVoxelSize(1,Yres); trace.setVoxelSize(2,Zres);
dti.ComputeTrace(&trace);
//std::cout<<"Smooth TRACE computed\n";
sprintf(str,"%s",argv[5]);
trace.exportRawFieldToFile(str);
return 0;
}
示例3: main
int main(int argc, char *argv[])
{
char str[200];
int i;
if(argc<9)
{
std::cout<<"Usage: dtiEigD switch_endian_input(0/1) xsize ysize zsize input_dtfile output_dir faweightingPD(0/1) addoffsetPD(0/1) \n";
exit(0);
}
int Xdim= atoi(argv[2]);
int Ydim= atoi(argv[3]);
int Zdim= atoi(argv[4]);
float Xres= 1.72;
float Yres= 1.72;
float Zres= 3.0;
TensorField dti;
dti.init(Xdim,Ydim,Zdim);
dti.setVoxelSize(0,Xres); dti.setVoxelSize(1,Yres); dti.setVoxelSize(2,Zres);
int endian_be=0; endian_be= atoi(argv[1]);
if(endian_be)
dti.importRawFieldFromFile_BE(argv[5]);
else
dti.importRawFieldFromFile(argv[5]);
std::cout<<"DTI read\n";
ScalarField e1;
VectorField pd1;
ScalarField e2;
VectorField pd2;
ScalarField e3;
VectorField pd3;
ScalarField Tr;
ScalarField Fa;
Tr.init(Xdim,Ydim,Zdim);
Tr.setVoxelSize(0,Xres); Tr.setVoxelSize(1,Yres); Tr.setVoxelSize(2,Zres);
Fa.init(Xdim,Ydim,Zdim);
Fa.setVoxelSize(0,Xres); Fa.setVoxelSize(1,Yres); Fa.setVoxelSize(2,Zres);
e1.init(Xdim,Ydim,Zdim);
e1.setVoxelSize(0,Xres); e1.setVoxelSize(1,Yres); e1.setVoxelSize(2,Zres);
e2.init(Xdim,Ydim,Zdim);
e2.setVoxelSize(0,Xres); e2.setVoxelSize(1,Yres); e2.setVoxelSize(2,Zres);
e3.init(Xdim,Ydim,Zdim);
e3.setVoxelSize(0,Xres); e3.setVoxelSize(1,Yres); e3.setVoxelSize(2,Zres);
pd1.init(Xdim,Ydim,Zdim);
pd1.setVoxelSize(0,Xres); pd1.setVoxelSize(1,Yres); pd1.setVoxelSize(2,Zres);
pd2.init(Xdim,Ydim,Zdim);
pd2.setVoxelSize(0,Xres); pd2.setVoxelSize(1,Yres); pd2.setVoxelSize(2,Zres);
pd3.init(Xdim,Ydim,Zdim);
pd3.setVoxelSize(0,Xres); pd3.setVoxelSize(1,Yres); pd3.setVoxelSize(2,Zres);
Tr.init(Xdim,Ydim,Zdim);
Tr.setVoxelSize(0,Xres); Tr.setVoxelSize(1,Yres); Tr.setVoxelSize(2,Zres);
Fa.init(Xdim,Ydim,Zdim);
Fa.setVoxelSize(0,Xres); Fa.setVoxelSize(1,Yres); Fa.setVoxelSize(2,Zres);
ScalarField Phi;
ScalarField Theta;
ScalarField Psi;
Phi.init(Xdim,Ydim,Zdim);
Phi.setVoxelSize(0,Xres); Phi.setVoxelSize(1,Yres); Phi.setVoxelSize(2,Zres);
Theta.init(Xdim,Ydim,Zdim);
Theta.setVoxelSize(0,Xres); Theta.setVoxelSize(1,Yres); Theta.setVoxelSize(2,Zres);
Psi.init(Xdim,Ydim,Zdim);
Psi.setVoxelSize(0,Xres); Psi.setVoxelSize(1,Yres); Psi.setVoxelSize(2,Zres);
dti.ComputeEigD(&e1, &e2, &e3, &pd1, &pd2, &pd3, &Tr, &Fa, atoi(argv[7]), &Phi, &Theta, &Psi);
//dti.ComputeEigD(&e1, &e2, &e3, &pd1, &pd2, &pd3, &Tr, &Fa, atoi(argv[7]));
std::cout<<"Full Eigen Decomposition computed\n";
if(atoi(argv[8])==1)
{
pd1.AddOffset();
pd2.AddOffset();
pd3.AddOffset();
}
sprintf(str,"%s/FA%d.img",argv[6],Xdim);
Fa.exportRawFieldToFile(str);
sprintf(str,"%s/ADC%d.img",argv[6],Xdim);
Tr.exportRawFieldToFile(str);
sprintf(str,"%s/e1%d.img",argv[6],Xdim);
e1.exportRawFieldToFile(str);
sprintf(str,"%s/e2%d.img",argv[6],Xdim);
//.........这里部分代码省略.........