diff --git a/cluster.cc b/cluster.cc index c1956c767d52c3bd8da44a4b4932d029907a8331..6353b313273e14cdaf6bdd5ed470f5449dde0ff2 100644 --- a/cluster.cc +++ b/cluster.cc @@ -85,12 +85,6 @@ Option<string> talvolname(string("--talvol"), string(""), string("filename for talairach volume"), false, requires_argument); -template <class T> -void print_dims(const volume<T>& vol) -{ - cout << "dims=(" << vol.xdim()*vol.xsign() << "," - << vol.ydim()*vol.ysign() << "," << vol.zdim()*vol.zsign() << ")"; -} template <class T> @@ -377,7 +371,7 @@ int fmrib_main(int argc, char *argv[]) // read in the volume volume<T> zvol, mask, cope; read_volume(zvol,inputname.value()); - if (verbose.value()) {cout<<"Zvol: "; print_dims(zvol); cout<<endl;} + if (verbose.value()) print_volume_info(zvol,"Zvol"); if ( fractional.value() ) { float frac = th; @@ -386,14 +380,15 @@ int fmrib_main(int argc, char *argv[]) mask = zvol; mask.threshold((T) th); if (minv.value()) { mask = ((T) 1) - mask; } - if (verbose.value()) {cout<<"Mask: "; print_dims(mask); cout<<endl;} + if (verbose.value()) print_volume_info(mask,"Mask"); // Find the connected components labelim = connected_components(mask,numconnected.value()); - if (verbose.value()) {cout<<"Labelim: "; print_dims(labelim); cout<<endl;} + if (verbose.value()) print_volume_info(labelim,"Labelim"); // process according to the output format get_stats(labelim,zvol,size,maxvals,meanvals,maxpos,cog,minv.value()); + if (verbose.value()) {cout<<"Number of labels = "<<size.size()<<endl;} // process the cope image if entered vector<int> copesize; @@ -414,6 +409,7 @@ int fmrib_main(int argc, char *argv[]) pthreshsize = size; int nozeroclust=0; if (!pthresh.unset()) { + if (verbose.value()) {cout<<"Re-thresholding with p-value"<<endl;} Infer infer(dLh.value(), th, voxvol.value()); for (int n=1; n<length; n++) { int k = size[n]; @@ -424,10 +420,12 @@ int fmrib_main(int argc, char *argv[]) } } } + if (verbose.value()) {cout<<"Number of sub-p clusters = "<<nozeroclust<<endl;} // get sorted index (will revert to cluster size if no pthresh) vector<int> idx; idx = get_sortindex(pthreshsize); + if (verbose.value()) {cout<<pthreshsize.size()<<" labels in sortedidx"<<endl;} vector<int> threshidx(length); for (int n=length-1; n>=1; n--) {