本文整理汇总了C++中V3DPluginArgList类的典型用法代码示例。如果您正苦于以下问题:C++ V3DPluginArgList类的具体用法?C++ V3DPluginArgList怎么用?C++ V3DPluginArgList使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了V3DPluginArgList类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: dofunc
bool mostVesselTracerPlugin::dofunc(const QString & func_name, const V3DPluginArgList & input, V3DPluginArgList & output, V3DPluginCallback2 & callback, QWidget * parent)
{
vector<char*> infiles, inparas, outfiles;
if(input.size() >= 1) infiles = *((vector<char*> *)input.at(0).p);
if(input.size() >= 2) inparas = *((vector<char*> *)input.at(1).p);
if(output.size() >= 1) outfiles = *((vector<char*> *)output.at(0).p);
if (func_name == tr("MOST_trace"))
{
return autotrace(input, output,callback);
}
else if (func_name == tr("help"))
{
cout<<"Usage : v3d -x dllname -f MOST_trace -i <inimg_file> -p <ch> <th> <seed> <slip>"<<endl;
cout<<endl;
cout<<"ch the input channel value, start from 1, default 1"<<endl;
cout<<"th the threshold value, default 20"<<endl;
cout<<"seed window size of the seed, default 20"<<endl;
cout<<"slip window size to slip from seed, default 20"<<endl;
cout<<"The output swc file will be named automatically based on the input image file nmae"<<endl;
cout<<endl;
cout<<endl;
}
else return false;
return true;
}
开发者ID:Vaa3D,项目名称:vaa3d_tools,代码行数:27,代码来源:mostVesselTracer.cpp
示例2: dofunc
bool SigenPlugin::dofunc(
const QString &func_name,
const V3DPluginArgList &input,
V3DPluginArgList & /* output */,
V3DPluginCallback2 &callback,
QWidget *parent) {
using std::vector;
if (func_name == tr("trace")) {
input_PARA PARA;
vector<char *> *pinfiles = (input.size() >= 1) ? (vector<char *> *)input[0].p : 0;
vector<char *> *pparas = (input.size() >= 2) ? (vector<char *> *)input[1].p : 0;
vector<char *> infiles = (pinfiles != 0) ? *pinfiles : vector<char *>();
vector<char *> paras = (pparas != 0) ? *pparas : vector<char *>();
if (infiles.empty()) {
fprintf(stderr, "Need input image. \n");
return false;
} else {
PARA.inimg_file = infiles[0];
}
int k = 0;
PARA.channel = ((int)paras.size() >= k + 1) ? atoi(paras[k]) : 1;
k++;
reconstruction_func(callback, parent, PARA, /* via_gui = */ false);
} else if (func_name == tr("help")) {
////HERE IS WHERE THE DEVELOPERS SHOULD UPDATE THE USAGE OF THE PLUGIN
printf("**** Usage of SIGEN tracing **** \n");
printf("vaa3d -x SIGEN -f trace -i <inimg_file> -p <channel> <other parameters>\n");
printf("inimg_file The input image\n");
printf("channel Data channel for tracing. Start from 1 (default 1).\n");
printf("outswc_file Will be named automatically based on the input image file name, so you don't have to specify it.\n\n");
} else {
return false;
}
return true;
}
开发者ID:arosh,项目名称:Vaa3D-SIGEN,代码行数:35,代码来源:SIGEN_plugin.cpp
示例3: processImage
bool processImage(V3DPluginCallback2 &callback, const V3DPluginArgList & input, V3DPluginArgList & output, unsigned int rotateflag)
{
cout<<"Welcome to Rotate image"<<endl;
if (input.size() != 1 || output.size() != 1) return false;
char * inimg_file = ((vector<char*> *)(input.at(0).p))->at(0);
char * outimg_file = ((vector<char*> *)(output.at(0).p))->at(0);
cout<<"rotateflag = "<<rotateflag<<endl;
cout<<"inimg_file = "<<inimg_file<<endl;
cout<<"outimg_file = "<<outimg_file<<endl;
unsigned char * data1d = 0;
V3DLONG in_sz[4];
int datatype;
if(!simple_loadimage_wrapper(callback, inimg_file, data1d, in_sz, datatype))
{
cerr<<"load image "<<inimg_file<<" error!"<<endl;
return false;
}
unsigned char* outimg = 0;
V3DLONG szx=in_sz[0], szy=in_sz[1], szz=in_sz[2], szc=in_sz[3];
switch (datatype)
{
case 1: rotateimage(data1d, in_sz, V3D_UINT8, rotateflag, outimg); break;
case 2: rotateimage(data1d, in_sz, V3D_UINT16, rotateflag, outimg); break;
case 4: rotateimage(data1d, in_sz, V3D_FLOAT32, rotateflag, outimg); break;
default:
v3d_msg("Invalid datatype.");
if (data1d) {delete []data1d; data1d=0;}
return false;
}
// save image
switch(rotateflag)
{
case 1:
case 2:
in_sz[0]=szy; in_sz[1]=szx;
simple_saveimage_wrapper(callback, outimg_file, (unsigned char *)outimg, in_sz, datatype);
break;
case 3:
in_sz[0]=szx; in_sz[1]=szy;
simple_saveimage_wrapper(callback, outimg_file, (unsigned char *)outimg, in_sz, datatype);
break;
default:
break;
}
if (outimg) {delete []outimg; outimg =0;}
if (data1d) {delete []data1d; data1d=0;}
return true;
}
开发者ID:Vaa3D,项目名称:vaa3d_tools,代码行数:59,代码来源:rotateimg90.cpp
示例4: swc2eswc_io
bool swc2eswc_io(const V3DPluginArgList & input, V3DPluginArgList & output)
{
cout<<"Welcome to swc2eswc_io"<<endl;
vector<char*>* inlist = (vector<char*>*)(input.at(0).p);
vector<char*>* outlist = NULL;
if(input.size() != 1)
{
printf("Please specify both input file name.\n");
return false;
}
QString fileOpenName = QString(inlist->at(0));
QString fileSaveName;
QString tmp = fileOpenName;
if (output.size()==0)
{
printf("No outputfile specified.\n");
tmp.chop(3);
fileSaveName = tmp + "eswc";
}
else if (output.size()==1)
{
outlist = (vector<char*>*)(output.at(0).p);
fileSaveName = QString(outlist->at(0));
}
else
{
printf("You have specified more than 1 output file.\n");
return false;
}
NeuronTree neuron;
vector<V3DLONG> segment_id, segment_layer;
if (fileOpenName.endsWith(".swc") || fileOpenName.endsWith(".SWC"))
{
neuron = readSWC_file(fileOpenName);
segment_id, segment_layer;
if (!swc2eswc(neuron,segment_id, segment_layer))
{
v3d_msg("Cannot convert swc to eswc.", 0);
return false;
}
}
else {
v3d_msg("The file type you specified is not supported. Please check.", 0);
return false;
}
if (!export_eswc(neuron,segment_id,segment_layer,qPrintable(fileOpenName),qPrintable(fileSaveName)))
{
v3d_msg("fail to write the output eswc file.", 0);
return false;
}
return true;
}
开发者ID:Vaa3D,项目名称:vaa3d_tools,代码行数:57,代码来源:eswc_converter_func.cpp
示例5: median_swc_func
bool median_swc_func(const V3DPluginArgList & input, V3DPluginArgList & output)
{
if(input.size()==0) return false;
//parsing input
vector<char *> * inlist = (vector<char*> *)(input.at(0).p);
if (inlist->size() == 0)
{
cerr<<"You must specify input linker or swc files"<<endl;
return false;
}
V3DLONG neuronNum = 0;
vector<NeuronTree> nt_list;
QString qs_linker;
QStringList nameList;
for (int i=0;i<inlist->size();i++)
{
qs_linker = QString(inlist->at(i));
if (qs_linker.toUpper().endsWith(".ANO"))
{
cout<<"(0). reading a linker file."<<endl;
P_ObjectFileType linker_object;
if (!loadAnoFile(qs_linker,linker_object))
{
fprintf(stderr,"Error in reading the linker file.\n");
return 1;
}
nameList = linker_object.swc_file_list;
neuronNum += nameList.size();
for (V3DLONG i=0;i<neuronNum;i++)
{
NeuronTree tmp = readSWC_file(nameList.at(i));
nt_list.push_back(tmp);
}
}
else if (qs_linker.toUpper().endsWith(".SWC"))
{
cout<<"(0). reading an swc file"<<endl;
NeuronTree tmp = readSWC_file(qs_linker);
nt_list.push_back(tmp);
neuronNum++;
}
}
cout << "There are "<<nt_list.size() <<" input neurons."<<endl;
int idx = median_swc(nt_list);
if (idx <0){
cerr << "error in median_swc()" << endl;
return false;
}
cout<<"Median swc is " << idx << endl;
return true;
}
开发者ID:RobertLu5566,项目名称:vaa3d_tools,代码行数:56,代码来源:consensus_skeleton_func.cpp
示例6: dofunc
bool retype_swc::dofunc(const QString & func_name, const V3DPluginArgList & input, V3DPluginArgList & output, V3DPluginCallback2 & callback, QWidget * parent)
{
vector<char*> infiles, paras, outfiles;
if(input.size() >= 1) infiles = *((vector<char*> *)input.at(0).p);
if(input.size() >= 2) paras = *((vector<char*> *)input.at(1).p);
if(output.size() >= 1) outfiles = *((vector<char*> *)output.at(0).p);
if (func_name == tr("retype"))
{
cout<<"Welcome to swc retyping plugin"<<endl;
if(infiles.empty())
{
cerr<<"Need input swc file"<<endl;
return false;
}
QString inswc_file = infiles[0];
int k=0;
int type = (paras.size() >= k+1) ? atoi(paras[k]) : 3; k++;//0;
QString outswc_file;
if(!outfiles.empty())
outswc_file = outfiles[0];
else
outswc_file = inswc_file + "_retyped.swc";
cout<<"inswc_file = "<<inswc_file.toStdString().c_str()<<endl;
cout<<"node type = "<<type<<endl;
cout<<"outswc_file = "<<outswc_file.toStdString().c_str()<<endl;
NeuronTree nt;
nt = readSWC_file(inswc_file);
for(V3DLONG i = 0; i < nt.listNeuron.size(); i++)
{
if(nt.listNeuron[i].parent == -1)
nt.listNeuron[i].type = 1;
else
nt.listNeuron[i].type = type;
}
if (!export_list2file(nt.listNeuron,outswc_file,inswc_file))
{
v3d_msg("fail to write the output swc file.");
return false;
}
}
else if (func_name == tr("help"))
{
cout<<"Usage : v3d -x dllname -f retype -i <inswc_file> -o <outswc_file> -p <type>"<<endl;
cout<<endl;
}
else return false;
return true;
}
开发者ID:Vaa3D,项目名称:vaa3d_tools,代码行数:54,代码来源:retype_swc_plugin.cpp
示例7: dofunc
bool RivuletPlugin::dofunc(const QString & func_name, const V3DPluginArgList & input, V3DPluginArgList & output, V3DPluginCallback2 & callback, QWidget * parent)
{
if (func_name == tr("tracing_func"))
{
bool bmenu = false;
input_PARA PARA;
vector<char*> * pinfiles = (input.size() >= 1) ? (vector<char*> *) input[0].p : 0;
vector<char*> * pparas = (input.size() >= 2) ? (vector<char*> *) input[1].p : 0;
vector<char*> infiles = (pinfiles != 0) ? * pinfiles : vector<char*>();
vector<char*> paras = (pparas != 0) ? * pparas : vector<char*>();
if(infiles.empty())
{
fprintf (stderr, "Need input image. \n");
return false;
}
else
PARA.inimg_file = infiles[0];
int k=0;
PARA.channel = (paras.size() >= k+1) ? atoi(paras[k]) : 1; k++;
PARA.threshold = (paras.size() >= k+1) ? atoi(paras[k]) : 10; k++;
PARA.stepsize = (paras.size() >= k+1) ? atoi(paras[k]) : 1; k++;
PARA.gap = (paras.size() >= k+1) ? atoi(paras[k]) : 15; k++;
PARA.dumpbranch = (paras.size() >= k+1) ? atoi(paras[k]) : 0; k++;
PARA.connectrate = (paras.size() >= k+1) ? atof(paras[k]) : 1.5; k++;
PARA.percentage = (paras.size() >= k+1) ? atof(paras[k]) : 0.98; k++;
if (PARA.percentage > 1.0)
PARA.percentage = 1.0;
PARA.sigma = (paras.size() >= k+1) ? atoi(paras[k]) : 1; k++;
PARA.alpha_one = (paras.size() >= k+1) ? atoi(paras[k]) : 1; k++;
PARA.alpha_two = (paras.size() >= k+1) ? atoi(paras[k]) : 1; k++;
reconstruction_func(callback,parent,PARA,bmenu);
}
else if (func_name == tr("help"))
{
printf("**** Usage of Rivulet tracing **** \n");
printf("vaa3d -x Rivulet -f tracing_func -i <inimg_file> -p <channel> <threshold> <stepsize> <gap> <dumpbranch> <connectrate> <percentage>\n");
printf("inimg_file\tThe input image\n");
printf("channel\tData channel for tracing. Start from 1 (default 1).\n");
printf("threshold\tThe background threshold for segmentation (default 10).\n");
printf("stepsize\tThe step size of gradient descent tracing (default 1).\n");
printf("gap\tThe gap allowed for steps on background voxels. Useful for noisy images (default 15)\n");
printf("dumpbranch\tWhether the unconnected branches will be dumpped. (default 0)\n");
printf("connectrate\tBranch terminis within connectrate*(radius+3) will be connected to the trunk. (default 1.5)\n");
printf("percentage\tThe converage expected on the binary image before stopping tracing. (default 0.98)\n");
printf("outswc_file\tWill be named automatically based on the input image file name, so you don't have to specify it.\n\n");
}
else return false;
return true;
}
开发者ID:CBL-ORION,项目名称:vaa3d_tools-1,代码行数:53,代码来源:Rivulet_plugin.cpp
示例8: dofunc
bool NeuroStalker::dofunc(const QString & func_name,
const V3DPluginArgList & input,
V3DPluginArgList & output,
V3DPluginCallback2 & callback,
QWidget * parent)
{
if (func_name == tr("tracing_func"))
{
bool bmenu = false;
input_PARA PARA;
vector<char*> * pinfiles = (input.size() >= 1) ? (vector<char*> *) input[0].p : 0;
vector<char*> * pparas = (input.size() >= 2) ? (vector<char*> *) input[1].p : 0;
vector<char*> infiles = (pinfiles != 0) ? * pinfiles : vector<char*>();
vector<char*> paras = (pparas != 0) ? * pparas : vector<char*>();
if(infiles.empty())
{
fprintf (stderr, "Need input image. \n");
return false;
}
else
PARA.inimg_file = infiles[0];
int k=0;
PARA.channel = (paras.size() >= k+1) ? atoi(paras[k]) : 1; k++;
PARA.preprocessing = (paras.size() >= k+1) ? atoi(paras[k]) : 1; k++;
PARA.unittest = (paras.size() >= k+1) ? atoi(paras[k]) : 1; k++;
PARA.step = (paras.size() >= k+1) ? atoi(paras[k]) : 1; k++;
PARA.stepsize = (paras.size() >= k+1) ? atoi(paras[k]) : 1; k++;
PARA.threshold = (paras.size() >= k+1) ? atoi(paras[k]) : 1; k++;
cout<<"Input step test: "<<PARA.step<<endl;
reconstruction_func(callback,parent,PARA,bmenu);
}
else if (func_name == tr("help"))
{
////HERE IS WHERE THE DEVELOPERS SHOULD UPDATE THE USAGE OF THE PLUGIN
printf("**** Usage of NeuroStalker tracing **** \n");
printf("vaa3d -x NeuroStalker -f tracing_func -i <inimg_file> -p <channel> <preprocessing> <run unit-tests>\n");
printf("inimg_file The input image\n");
printf("channel Data channel for tracing. Start from 1 (default 1).\n");
printf("preprocessing The preprocessing flag - 1: Crop Only; 2: Downsample; 3: Downsample and crop; \n");
printf("run unit-tests - 1: Run Tracing Only; 2: Run unit-tests only; 3: Run Both Unit Tests and Tracing; \n");
printf("outswc_file Will be named automatically based on the input image file name, so you don't have to specify it.\n\n");
}
else return false;
return true;
}
开发者ID:lsqshr,项目名称:Neurostalker,代码行数:51,代码来源:NeuroStalker_plugin.cpp
示例9: dofunc
bool neurontracing_rotation::dofunc(const QString & func_name, const V3DPluginArgList & input, V3DPluginArgList & output, V3DPluginCallback2 & callback, QWidget * parent)
{
if (func_name == tr("tracing_func"))
{
bool bmenu = false;
input_PARA PARA;
vector<char*> * pinfiles = (input.size() >= 1) ? (vector<char*> *) input[0].p : 0;
vector<char*> * pparas = (input.size() >= 2) ? (vector<char*> *) input[1].p : 0;
vector<char*> infiles = (pinfiles != 0) ? * pinfiles : vector<char*>();
vector<char*> paras = (pparas != 0) ? * pparas : vector<char*>();
if(infiles.empty())
{
fprintf (stderr, "Need input image. \n");
return false;
}
PARA.inimg_file = infiles[0];
PARA.image = 0;
int k=0;
// QString inmarker_file = paras.empty() ? "" : paras[k]; if(inmarker_file == "NULL") inmarker_file = ""; k++;
PARA.rotation_degree = (paras.size() >= k+1) ? atoi(paras[k]) : 36; k++;
PARA.channel = (paras.size() >= k+1) ? atoi(paras[k]) : 1; k++;
PARA.bkg_thresh = (paras.size() >= k+1) ? atoi(paras[k]) : 10; if(PARA.bkg_thresh == atoi("AUTO")) PARA.bkg_thresh = -1;k++;
PARA.b_256cube = (paras.size() >= k+1) ? atoi(paras[k]) : 0; k++;
PARA.b_RadiusFrom2D = (paras.size() >= k+1) ? atoi(paras[k]) : 1; k++;
PARA.is_gsdt = (paras.size() >= k+1) ? atoi(paras[k]) : 0; k++;
PARA.is_break_accept = (paras.size() >= k+1) ? atoi(paras[k]) : 0; k++;
PARA.length_thresh = (paras.size() >= k+1) ? atoi(paras[k]) : 5; k++;
reconstruction_func(callback,parent,PARA,bmenu);
}
else if (func_name == tr("help"))
{
////HERE IS WHERE THE DEVELOPERS SHOULD UPDATE THE USAGE OF THE PLUGIN
printf("**** Usage of neurontracing_rotation tracing **** \n");
printf("vaa3d -x neurontracing_rotation -f tracing_func -i <inimg_file> -p <channel> <other parameters>\n");
printf("inimg_file The input image\n");
printf("channel Data channel for tracing. Start from 1 (default 1).\n");
printf("outswc_file Will be named automatically based on the input image file name, so you don't have to specify it.\n\n");
}
else return false;
return true;
}
开发者ID:Vaa3D,项目名称:vaa3d_tools,代码行数:51,代码来源:neurontracing_rotation_plugin.cpp
示例10: dofunc
bool markertree::dofunc(const QString & func_name, const V3DPluginArgList & input, V3DPluginArgList & output, V3DPluginCallback2 & callback, QWidget * parent)
{
vector<char*> infiles, inparas, outfiles;
if(input.size() >= 1) infiles = *((vector<char*> *)input.at(0).p);
if(input.size() >= 2) inparas = *((vector<char*> *)input.at(1).p);
if(output.size() >= 1) outfiles = *((vector<char*> *)output.at(0).p);
if (func_name == tr("help"))
{
v3d_msg("To be implemented");
}
else return false;
return true;
}
开发者ID:Vaa3D,项目名称:vaa3d_tools,代码行数:15,代码来源:marker_minspanningtree_plugin.cpp
示例11: dofunc
bool border_tips::dofunc(const QString & func_name, const V3DPluginArgList & input, V3DPluginArgList & output, V3DPluginCallback2 & callback, QWidget * parent)
{
vector<char*> infiles, inparas, outfiles;
if(input.size() >= 1) infiles = *((vector<char*> *)input.at(0).p);
if(input.size() >= 2) inparas = *((vector<char*> *)input.at(1).p);
if(output.size() >= 1) outfiles = *((vector<char*> *)output.at(0).p);
if (func_name == tr("help"))
{
qDebug()<<"No do func available.";
}
else return false;
return true;
}
开发者ID:Vaa3D,项目名称:vaa3d_tools,代码行数:15,代码来源:border_tips_plugin.cpp
示例12: dofunc
bool BlastNeuronPlugin::dofunc(const QString & func_name, const V3DPluginArgList & input, V3DPluginArgList & output, V3DPluginCallback2 & callback, QWidget * parent)
{
vector<char*> infiles, inparas, outfiles;
if(input.size() >= 1) infiles = *((vector<char*> *)input.at(0).p);
if(input.size() >= 2) inparas = *((vector<char*> *)input.at(1).p);
if(output.size() >= 1) outfiles = *((vector<char*> *)output.at(0).p);
if (func_name == tr("global_retrieve"))
{
return(global_retrieve_main(input, output));
}
else if (func_name == tr("local_alignment"))
{
return(local_alignment_main(input, output));
}
else if (func_name == tr("batch_compute"))
{
return (batch_compute_main(input, output));
}
else if (func_name == tr("pre_processing"))
{
return (pre_processing_main(input, output));
}
else if (func_name == tr("inverse_projection"))
{
return (inverse_projection_main(input, output));
}
else
{
printf("\nBlastNeuron Plugin: rapid global retrieval and local alignent of 3D neuron morphologies. This plugin also includes pre-processing, inverse projection and batch feature computation. by Yinan Wan.\n\n");
printf("Functions:\n");
printf("\t pre_processing prune, resample and align neuron swcs.\n");
printf("\t global_retrieve given a query neuron, retrieve morphologically similar neurons from a neuron feature database.\n");
printf("\t local_alignment point to point alignment of two morphologically similar neurosn.\n");
printf("\t batch_compute generate neuron feature database (.nfb) file first to speed up neuron retrieve\n");
printf("\t invert_projection find an optimal affine transform between neuron structures regardless of topology.\n\n");
printf("Example: \n");
printf("\t vaa3d -x blastneuron -f pre_processing -p \"#i input.swc #o result.swc #l 3 #s 2 #r 1 \"\n");
printf("\t vaa3d -x blastneuron -f batch_compute -p \"#i mydatabase.ano #o features.nfb\"\n");
printf("\t vaa3d -x blastneuron -f global_retrieve -p \"#d features.nfb #q query.swc #n 10 #m 1,2,4 #o retrieve.ano\"\n");
printf("\t vaa3d -x blastneuron -f local_alignment -p \"#t target.swc #s subject.swc #o match.swc\"\n");
printf("\t vaa3d -x blastneuron -f inverse_projection -p \"#i target.swc #o target_invp.swc\"\n\n");
printf("Type vaa3d -x blastneuron -f <function_name> for instructions to run individual functions.\n");
printf("Alternatively, you can run a query search from the neuron feature database with a bash script: try \"sh blastneuron_plugin.sh\" for detailed instruction\n\n");
return true;
}
}
开发者ID:Vaa3D,项目名称:vaa3d_tools,代码行数:48,代码来源:blastneuron_plugin.cpp
示例13: dofunc
bool file_transform::dofunc(const QString & func_name, const V3DPluginArgList & input, V3DPluginArgList & output, V3DPluginCallback2 & callback, QWidget * parent)
{
vector<char*> infiles, inparas, outfiles;
if(input.size() >= 1) infiles = *((vector<char*> *)input.at(0).p);
if(input.size() >= 2) inparas = *((vector<char*> *)input.at(1).p);
if(output.size() >= 1) outfiles = *((vector<char*> *)output.at(0).p);
if (func_name == tr("affineImage"))
{
qDebug()<<"==== affine and combine images ====";
if(infiles.size()!=3 || outfiles.size()!=1){
qDebug()<<"ERROR: please set input and output!";
printHelp();
return false;
}
QString fname_img_tar=((vector<char*> *)(input.at(0).p))->at(0);
QString fname_img_sub=((vector<char*> *)(input.at(0).p))->at(1);
QString fname_amat=((vector<char*> *)(input.at(0).p))->at(2);
QString fname_output=((vector<char*> *)(output.at(0).p))->at(0);
//init parameters
bool b_channelSeperate = false;
bool b_negativeShift = true;
int interpMethod = 0;
if(input.size() >= 2){
vector<char*> paras = (*(vector<char*> *)(input.at(1).p));
if(paras.size()>0){
int tmp=atoi(paras.at(0));
if(tmp==1)
interpMethod = 1;
}
if(paras.size()>1){
int tmp=atoi(paras.at(1));
if(tmp==0)
b_negativeShift = false;
}
if(paras.size()>2){
int tmp=atoi(paras.at(2));
if(tmp==1)
b_channelSeperate = true;
}
}
doAffineImage(callback, fname_img_tar, fname_img_sub, fname_amat, fname_output, interpMethod, b_negativeShift, b_channelSeperate);
}
else if (func_name == tr("help"))
{
printHelp();
}
else return false;
return true;
}
开发者ID:Vaa3D,项目名称:vaa3d_tools,代码行数:53,代码来源:file_transform_plugin.cpp
示例14: dofunc
bool AnisoDiffPlugin_littlequick::dofunc(const QString & func_name, const V3DPluginArgList & input, V3DPluginArgList & output, V3DPluginCallback2 & callback, QWidget * parent)
{
if (func_name == tr("anisodiff_littlequick_menu"))
{
cout<<"============== Welcome to anisodiff function ================="<<endl;
bool bmenu = false;
input_PARA PARA;
vector<char*> * pinfiles = (input.size() >= 1) ? (vector<char*> *) input[0].p : 0;
vector<char*> infiles = (pinfiles != 0) ? * pinfiles : vector<char*>();
if(infiles.empty())
{
fprintf (stderr, "Need input image. \n");
return false;
}
else
PARA.inimg_file = infiles[0];
anisodiff_func(callback,parent,PARA,bmenu);
}
else
{
printHelp();
}
return true;
}
开发者ID:Vaa3D,项目名称:vaa3d_tools,代码行数:29,代码来源:plugin_anisodiff_littlequick.cpp
示例15: resample_swc_toolbox
bool resample_swc_toolbox(const V3DPluginArgList & input)
{
vaa3d_neurontoolbox_paras * paras = (vaa3d_neurontoolbox_paras *)(input.at(0).p);
NeuronTree nt = paras->nt;
QString fileOpenName = nt.file;
bool ok;
double step = QInputDialog::getDouble(0, "Please specify the resampling step length","Step length:",1,0,2147483647,0.1,&ok);
if (!ok)
return true;
NeuronTree result = resample(nt,step);
QString fileDefaultName = fileOpenName+QString("_resampled.swc");
//write new SWC to file
QString fileSaveName = QFileDialog::getSaveFileName(0, QObject::tr("Save File"),
fileDefaultName,
QObject::tr("Supported file (*.swc)"
";;Neuron structure (*.swc)"
));
if (!export_list2file(result.listNeuron,fileSaveName,fileOpenName))
{
v3d_msg("fail to write the output swc file.");
return false;
}
return true;
}
开发者ID:CBL-ORION,项目名称:vaa3d_tools-1,代码行数:28,代码来源:resample_swc_func.cpp
示例16: dofunc
bool open_fiji::dofunc(const QString & func_name, const V3DPluginArgList & input, V3DPluginArgList & output, V3DPluginCallback2 & callback, QWidget * parent)
{
if (func_name == tr("openfiji"))
{
vector<char*> infiles, outfiles;
if(input.size()==0) {
cout<<"for usage type: vaa3d -x open_fiji -f help"<<endl;
return false;
}
if(input.size() >= 1) infiles = *((vector<char*> *)input.at(0).p);
if(input.size() >= 2)
{
if(output.size() >= 1) outfiles = *((vector<char*> *)output.at(0).p);
}
char * inimg_file = ((vector<char*> *)(input.at(0).p))->at(0);
char * outimg_file = ((vector<char*> *)(output.at(0).p))->at(0);
call_open_using_imagej(false, QString(inimg_file ),QString(outimg_file), callback);
}
else if (func_name == tr("help"))
{
cout<<"Usage : vaa3d -x open_fiji -f openfiji -i <input_file_name> -o <output_file_name> "<<endl;
}
else return false;
return true;
}
开发者ID:Vaa3D,项目名称:vaa3d_tools,代码行数:29,代码来源:open_fiji_plugin.cpp
示例17: neuron_toolbox_func
bool neuron_toolbox_func(V3DPluginCallback2 & callback, QWidget * parent, const V3DPluginArgList & input, V3DPluginArgList & output)
{
QString test_str1 = QString(((vaa3d_neurontoolbox_paras *)(input.at(0).p))->nt.file);
QString test_str = QFileInfo(test_str1).baseName() + "." + QFileInfo(test_str1).completeSuffix();
SelectPluginDlg * selectDlg = new SelectPluginDlg(parent, callback, input);
selectDlg->setWindowTitle(test_str + " - Select plugin to run...");
selectDlg->show();
return true;
}
开发者ID:Vaa3D,项目名称:vaa3d_tools,代码行数:9,代码来源:neuron_toolbox_func.cpp
示例18: v3dneuron_tracing
bool v3dneuron_tracing(const V3DPluginArgList & input, V3DPluginArgList & output)
{
cout<<"Welcome to v3dneuron_tracing"<<endl;
if(input.size() != 2 || output.size() != 1) return false;
char * paras = 0;
if(((vector<char*> *)(input.at(1).p))->empty()){paras = new char[1]; paras[0]='\0';}
else paras = (*(vector<char*> *)(input.at(1).p)).at(0);
cout<<"paras : "<<paras<<endl;
for(int i = 0; i < strlen(paras); i++)
{
if(paras[i] == '#') paras[i] = '-';
}
cout<<"paras : "<<paras<<endl;
cout<<string("v3dneuron_tracing ").append(paras).c_str()<<endl;
system(string("v3dneuron_tracing ").append(paras).c_str());
return true;
}
开发者ID:Vaa3D,项目名称:vaa3d_tools,代码行数:19,代码来源:v3dneuron_tracing_func.cpp
示例19: dofunc
bool nctuTW::dofunc(const QString & func_name, const V3DPluginArgList & input, V3DPluginArgList & output, V3DPluginCallback2 & callback, QWidget * parent)
{
if (func_name == tr("tracing_func"))
{
bool bmenu = false;
input_PARA PARA;
vector<char*> * pinfiles = (input.size() >= 1) ? (vector<char*> *) input[0].p : 0;
vector<char*> * pparas = (input.size() >= 2) ? (vector<char*> *) input[1].p : 0;
vector<char*> infiles = (pinfiles != 0) ? * pinfiles : vector<char*>();
vector<char*> paras = (pparas != 0) ? * pparas : vector<char*>();
if(infiles.empty())
{
fprintf (stderr, "Need input image. \n");
return false;
}
else
PARA.inimg_file = infiles[0];
int k=0;
PARA.inmarker_file = paras.empty() ? "" : paras[k]; if(PARA.inmarker_file == "NULL") PARA.inmarker_file = ""; k++;
PARA.threshold = (paras.size() >= k+1) ? atof(paras[k]) : 0.9;
reconstruction_func(callback,parent,PARA,bmenu);
}
else if (func_name == tr("help"))
{
////HERE IS WHERE THE DEVELOPERS SHOULD UPDATE THE USAGE OF THE PLUGIN
printf("**** Usage of nctuTW tracing **** \n");
printf("vaa3d -x nctuTW -f tracing_func -i <inimg_file> -p <inmarker_file> <threshold>\n");
printf("inimg_file The input image\n");
printf("inmarker_file If no input marker file, please set this para to NULL and it will detect soma automatically.\n");
printf("threshold Default 0.9, otherwise the threshold (from 0 to 1) specified by a user will be used.\n");
printf("outswc_file Will be named automatically based on the input image file name, so you don't have to specify it.\n\n");
}
else return false;
return true;
}
开发者ID:Vaa3D,项目名称:vaa3d_tools,代码行数:43,代码来源:nctuTW_plugin.cpp
示例20: eswc2swc_toolbox
int eswc2swc_toolbox(const V3DPluginArgList & input)
{
vaa3d_neurontoolbox_paras * paras = (vaa3d_neurontoolbox_paras *)(input.at(0).p);
NeuronTree neuron = paras->nt;
QString fileOpenName = neuron.file;
vector<V3DLONG> segment_id, segment_layer;
vector<double> feature;
if (fileOpenName.endsWith(".eswc") || fileOpenName.endsWith(".ESWC"))
{
neuron = read_eswc(segment_id, segment_layer, feature, fileOpenName);
if (!swc2eswc(neuron,segment_id, segment_layer))
{
v3d_msg("Cannot convert eswc to swc.\n");
return -1;
}
}
else {
v3d_msg("The file type you specified is not in .eswc format. Please check.");
return -1;
}
int ret = QMessageBox::Yes;
if (check_eswc(neuron, segment_id, segment_layer)==-1)
{
QMessageBox msgBox;
msgBox.setText("Something is wrong with the eswc file.");
msgBox.setInformativeText("Do you still want to convert it to swc?");
msgBox.setStandardButtons(QMessageBox::Yes | QMessageBox::Cancel);
msgBox.setDefaultButton(QMessageBox::Cancel);
ret = msgBox.exec();
}
if (ret==QMessageBox::Cancel)
return -1;
QString fileDefaultName = fileOpenName;
fileDefaultName.chop(4);
fileDefaultName += QString("swc");
//write new SWC to file
QString fileSaveName = QFileDialog::getSaveFileName(0, QObject::tr("Save File"),
fileDefaultName,
QObject::tr("Supported file (*.swc)"
";;Neuron structure (*.eswc)"
));
if (!export_swc(neuron,qPrintable(fileSaveName)))
{
v3d_msg("fail to write the output swc file.");
return -1;
}
return 1;
}
开发者ID:Vaa3D,项目名称:vaa3d_tools,代码行数:49,代码来源:eswc_converter_func.cpp
注:本文中的V3DPluginArgList类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论