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

deal with lower-dim vols

parent 8379ab47
No related branches found
No related tags found
No related merge requests found
...@@ -44,7 +44,7 @@ int fmrib_main(int argc, char *argv[]) ...@@ -44,7 +44,7 @@ int fmrib_main(int argc, char *argv[])
return(1); return(1);
} }
int xdimtot(header.dim[1]), ydimtot(header.dim[2]), zdimtot(header.dim[3]), tdimtot(header.dim[4]); int xdimtot(max(header.dim[1],1L)), ydimtot(max(header.dim[2],1L)), zdimtot(max(header.dim[3],1L)), tdimtot(max(header.dim[4],1L));
if(direction==4) if(direction==4)
{ {
...@@ -55,10 +55,10 @@ int fmrib_main(int argc, char *argv[]) ...@@ -55,10 +55,10 @@ int fmrib_main(int argc, char *argv[])
for(int vol = 4; vol < argc; vol++) for(int vol = 4; vol < argc; vol++)
{ {
header=reader.loadHeader(return_validimagefilename(string(argv[vol]))); header=reader.loadHeader(return_validimagefilename(string(argv[vol])));
if (direction==0) tdimtot+=header.dim[4]; if (direction==0) tdimtot+=max(header.dim[4],1L);
if (direction==1) xdimtot+=header.dim[1]; if (direction==1) xdimtot+=max(header.dim[1],1L);
if (direction==2) ydimtot+=header.dim[2]; if (direction==2) ydimtot+=max(header.dim[2],1L);
if (direction==3) zdimtot+=header.dim[3]; if (direction==3) zdimtot+=max(header.dim[3],1L);
} }
volume4D<T> output_volume(xdimtot,ydimtot,zdimtot,tdimtot); volume4D<T> output_volume(xdimtot,ydimtot,zdimtot,tdimtot);
read_volume4D(input_volume,string(argv[3])); read_volume4D(input_volume,string(argv[3]));
......
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