Re: MTrack2 plugin bug fix

Posted by dscho on
URL: http://imagej.273.s1.nabble.com/MTrack2-plugin-bug-fix-tp3690333p3690341.html

Hi,

On Wed, 25 Nov 2009, chris elliott wrote:

> Thanks for this, but the URL you gave is not giving a full path for the
> server address.

Oops.

http://pacific.mpi-cbg.de/cgi-bin/gitweb.cgi?p=fiji.git;a=commitdiff;h=refs/heads/mtrack2-fix

> I come from a C background, so don't really know all the java possibilites,

"continue" is available in C as well.  It means "skip to the next
iteration of the loop".  With for loops, the increment statement is
executed.

> but just want to ensure we avoid executing the
>
> for (int iPart=0; iPart<sxRes.length; iPart++) {
>
> loop if sxRes is null, so that the code should resume with the next iFrame

This is what the "continue" statement does; instead of dropping out of the
function, it drops out of the current iteration of the enclosing loop.

I only suggested to use it so you do not need to break indentation by
adding curly brackets without increasing the indent level of the enclosed
code block.

Ciao,
Dscho

> Johannes Schindelin wrote:
> > Hi Chris,
> >
> > On Wed, 25 Nov 2009, Johannes Schindelin wrote:
> >
> > > On Wed, 25 Nov 2009, chris elliott wrote:
> > >
> > > > If a sequence of images contains one with no particles, MTrack2 returns
> > > > early and does not write a results file, path plot or other data. The
> > > > attached patch fixes it
> > > Would it not be better to just replace the "return;" in
> > >
> > >                        if (sxRes==null)
> > >                                 return;
> > >
> > > with a "continue;"?
> >
> > Just in case you agree, here is what I would commit to fiji.git:
> >
> > http://pacific/cgi-bin/gitweb.cgi?p=fiji.git;a=commitdiff;h=refs/heads/mtrack2-fix
> >
> > Ciao,
> > Dscho
> >
>
>