From: Cem on
ImageAnalyst <imageanalyst(a)mailinator.com> wrote in message <fba84fcd-76b6-44d0-86fb-7d2e01251c78(a)z6g2000yqz.googlegroups.com>...
> Well apparently when you call this thing, cVolume is zero, thus it
> never gets into the "if" block and "a" never gets assigned, thus it
> can't return "a" as it is required to do. You could simply initialize
> all return arguments immediately upon entering the function so they'll
> always have at least SOMETHING for a value.
>

No. It was the fact that the arguments in the function were not transferred to calling function. So I found the problem. Thank you.
From: Cem on
TideMan <mulgor(a)gmail.com> wrote in message <f36e78d8-1b87-428e-9eee-42831f749070(a)i37g2000yqn.googlegroups.com>...
> On Apr 9, 7:59 am, ImageAnalyst <imageanal...(a)mailinator.com> wrote:
> > Well apparently when you call this thing, cVolume is zero, thus it
> > never gets into the "if" block and "a" never gets assigned, thus it
> > can't return "a" as it is required to do.  You could simply initialize
> > all return arguments immediately upon entering the function so they'll
> > always have at least SOMETHING for a value.
>
> And just some gratuitous advice on coding:
> When you have many individual scalars to return, a better practice is
> to put them into a structure:
> v.a=cVolume;
> v.b=geom(1);
> etc
>
> Then you call with just one output argument:
> v=TumorN(x,y,z,params,fc,fplot,fgsave,fName,ROI_option);
> which is easier to maintain if you change the number of output data at
> some later date.

Thank you. This is a very gratuitous advice and well taken.