From 085ddd30260cac50d57189d682ac684a1a0d3b11 Mon Sep 17 00:00:00 2001 From: Matthew Webster <mwebster@fmrib.ox.ac.uk> Date: Thu, 8 Jan 2015 14:57:44 +0000 Subject: [PATCH] Current Version Jan 15 --- fslsmoothfill.cc | 28 +++++++++++++--------------- fslsplit.cc | 3 --- 2 files changed, 13 insertions(+), 18 deletions(-) diff --git a/fslsmoothfill.cc b/fslsmoothfill.cc index 6a7f051..f25970e 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 68f1b7b..e821d35 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) { -- GitLab