diff --git a/fslsmoothfill.cc b/fslsmoothfill.cc index 6a7f051429088afd03acf152c37b5a7142c628e6..f25970e7c78a633f6aaab33b3dd67505b79cdfb0 100644 --- a/fslsmoothfill.cc +++ b/fslsmoothfill.cc @@ -465,8 +465,15 @@ int do_work() { // read in images volume<float> invol; - read_volume(invol,inputname.value()); - + + try { + read_volume(invol,inputname.value()); + } + catch(...) { + cerr << "smoothfill: Problem reading input image " << inputname.value() << endl; + exit(EXIT_FAILURE); + } + // read reference volume and set size of invol read_volume(global_mask,maskname.value()); @@ -478,7 +485,7 @@ int do_work() volume<float> mask; mask=global_mask; dilall_extra(invol,mask); - save_volume(invol,fslbasename(outname.value())+"_init"); + save_volume(invol,make_basename(outname.value())+"_init"); float cost = calc_cost(invol); cout << "Cost is " << cost << endl; // generate subsampled versions of the dilated volume for spatial blurring (distance dependent) @@ -489,8 +496,8 @@ int do_work() vol8 = subsample_by_2(vol4,true); vol16 = subsample_by_2(vol8,true); vol32 = subsample_by_2(vol16,true); - save_volume(vol2,fslbasename(outname.value())+"_vol2"); - save_volume(vol32,fslbasename(outname.value())+"_vol32"); + save_volume(vol2,make_basename(outname.value())+"_vol2"); + save_volume(vol32,make_basename(outname.value())+"_vol32"); for (int z=0; z<=invol.maxz(); z++) { for (int y=0; y<=invol.maxy(); y++) { for (int x=0; x<=invol.maxx(); x++) { @@ -518,7 +525,7 @@ int do_work() if (verbose.value()) { cout << "After gradient descent" << endl; } save_volume(invol,outname.value()); - save_volume(mask,fslbasename(outname.value())+"_idxmask"); + save_volume(mask,make_basename(outname.value())+"_idxmask"); return(EXIT_SUCCESS); } @@ -563,15 +570,6 @@ int main(int argc, char *argv[]) cerr << e.what() << endl; } - volume<float> invol; - try { - read_volume_hdr_only(invol,inputname.value()); - } - catch(...) { - cerr << "smoothfill: Problem reading input image " << inputname.value() << endl; - exit(EXIT_FAILURE); - } - return do_work(); } diff --git a/fslsplit.cc b/fslsplit.cc index 68f1b7bfb8bab4003c4717d985152819dc94b067..e821d35ae2c31b09caaeab24ea585ccac138e445 100755 --- a/fslsplit.cc +++ b/fslsplit.cc @@ -50,9 +50,6 @@ int fmrib_main(int argc, char *argv[]) int main(int argc,char *argv[]) { - - Tracer tr("main"); - string progname=argv[0]; if (argc <= 1 || argc >= 5) {