Skip to content
Snippets Groups Projects
Commit 085ddd30 authored by Matthew Webster's avatar Matthew Webster
Browse files

Current Version Jan 15

parent 3992c613
No related branches found
No related tags found
No related merge requests found
...@@ -465,8 +465,15 @@ int do_work() ...@@ -465,8 +465,15 @@ int do_work()
{ {
// read in images // read in images
volume<float> invol; 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 reference volume and set size of invol
read_volume(global_mask,maskname.value()); read_volume(global_mask,maskname.value());
...@@ -478,7 +485,7 @@ int do_work() ...@@ -478,7 +485,7 @@ int do_work()
volume<float> mask; volume<float> mask;
mask=global_mask; mask=global_mask;
dilall_extra(invol,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); float cost = calc_cost(invol);
cout << "Cost is " << cost << endl; cout << "Cost is " << cost << endl;
// generate subsampled versions of the dilated volume for spatial blurring (distance dependent) // generate subsampled versions of the dilated volume for spatial blurring (distance dependent)
...@@ -489,8 +496,8 @@ int do_work() ...@@ -489,8 +496,8 @@ int do_work()
vol8 = subsample_by_2(vol4,true); vol8 = subsample_by_2(vol4,true);
vol16 = subsample_by_2(vol8,true); vol16 = subsample_by_2(vol8,true);
vol32 = subsample_by_2(vol16,true); vol32 = subsample_by_2(vol16,true);
save_volume(vol2,fslbasename(outname.value())+"_vol2"); save_volume(vol2,make_basename(outname.value())+"_vol2");
save_volume(vol32,fslbasename(outname.value())+"_vol32"); save_volume(vol32,make_basename(outname.value())+"_vol32");
for (int z=0; z<=invol.maxz(); z++) { for (int z=0; z<=invol.maxz(); z++) {
for (int y=0; y<=invol.maxy(); y++) { for (int y=0; y<=invol.maxy(); y++) {
for (int x=0; x<=invol.maxx(); x++) { for (int x=0; x<=invol.maxx(); x++) {
...@@ -518,7 +525,7 @@ int do_work() ...@@ -518,7 +525,7 @@ int do_work()
if (verbose.value()) { cout << "After gradient descent" << endl; } if (verbose.value()) { cout << "After gradient descent" << endl; }
save_volume(invol,outname.value()); save_volume(invol,outname.value());
save_volume(mask,fslbasename(outname.value())+"_idxmask"); save_volume(mask,make_basename(outname.value())+"_idxmask");
return(EXIT_SUCCESS); return(EXIT_SUCCESS);
} }
...@@ -563,15 +570,6 @@ int main(int argc, char *argv[]) ...@@ -563,15 +570,6 @@ int main(int argc, char *argv[])
cerr << e.what() << endl; 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(); return do_work();
} }
...@@ -50,9 +50,6 @@ int fmrib_main(int argc, char *argv[]) ...@@ -50,9 +50,6 @@ int fmrib_main(int argc, char *argv[])
int main(int argc,char *argv[]) int main(int argc,char *argv[])
{ {
Tracer tr("main");
string progname=argv[0]; string progname=argv[0];
if (argc <= 1 || argc >= 5) if (argc <= 1 || argc >= 5)
{ {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment