Mtracck2 problems

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Mtracck2 problems

sjvinay
Dear All,

I am writing a macro to track nuclei from a live cell imaging movie. I am
using Mtrack2 to automate the tracking. I am having several problems with
this macro. It seems that the macro is not able to generate tracks from
binary images of DAPI stained nuclei. However, when I invert the images to a
white foreground, the Mtrack2 algorithm works when i use it manually with the imagej.
However, when I run Mtrack2 from my own macro. The tracking does not work.
Please help.

I have put my code below. stackpath is the path to the stack of
images(binary images of nuclei)

stackPath = stackFolder + "Stack.tif";

open(stackPath);

run("Invert","stack");


call("MTrack2_.setProperty","minSize","50");
call("MTrack2_.setProperty","maxSize","2000");
call("MTrack2_.setProperty","minTrackLength","3");
call("MTrack2_.setProperty","maxVelocity","4");
call("MTrack2_.setProperty","saveResultsFile","false");
call("MTrack2_.setProperty","showPaths","true");
call("MTrack2_.setProperty","showPathLengths","true");
call("MTrack2_.setProperty","showLabels","false");
call("MTrack2_.setProperty","showPositions","true");
call("MTrack2_.setProperty","skipDialogue","true");

run("MTrack2");


regards,
Vinay
Reply | Threaded
Open this post in threaded view
|

Re: Mtracck2 problems

chris elliott
Please see comments below:

On Sep 13 2010, Vinay sj wrote:

>Dear All,
>
> I am writing a macro to track nuclei from a live cell imaging movie. I am
> using Mtrack2 to automate the tracking. I am having several problems with
> this macro. It seems that the macro is not able to generate tracks from
> binary images of DAPI stained nuclei. However, when I invert the images
> to a white foreground, the Mtrack2 algorithm works when i use it manually
> with the imagej. However, when I run Mtrack2 from my own macro. The
> tracking does not work. Please help.
>
>I have put my code below. stackpath is the path to the stack of
>images(binary images of nuclei)
>
>stackPath = stackFolder + "Stack.tif";
>

are you sure that stackFolder ends with a directory separator ? / or \\ ?

>open(stackPath);
>
>run("Invert","stack");
>
>
>call("MTrack2_.setProperty","minSize","50");
>call("MTrack2_.setProperty","maxSize","2000");
>call("MTrack2_.setProperty","minTrackLength","3");
>call("MTrack2_.setProperty","maxVelocity","4");
>call("MTrack2_.setProperty","saveResultsFile","false");
>call("MTrack2_.setProperty","showPaths","true");
>call("MTrack2_.setProperty","showPathLengths","true");
>call("MTrack2_.setProperty","showLabels","false");
>call("MTrack2_.setProperty","showPositions","true");
>call("MTrack2_.setProperty","skipDialogue","true");
>
>run("MTrack2");

I did run("MTrack2 ", "minimum=6 maximum=999999 maximum_=100 save
save=&path4");

see http://biolpc22.york.ac.uk/drosophila/larvae/ for analysing a directory
full of avi (rather than tif) stacks; I did the task in two parts, one to
convert all the images to black/white, and the other to do the tracking.
Any comments appreciated chris
Reply | Threaded
Open this post in threaded view
|

Re: Mtracck2 problems

chenyanpei
Are you sure you could use 'call'?
because I see the demo of call is
// The methods in this class are called from the CallJavaDemo
// macro at <http://rsb.info.nih.gov/ij/macros/CallJavaDemo.txt>.
// This class can be compiled with ImageJ's
//  Plugins>Compile and Run command.

public class CallDemo {

        public static String method0() {
                return "method0";
        }

        public static String method1(String arg1) {
                return "method1"+"("+arg1+")";
        }

        public static String method2(String arg1, String arg2) {
                return "method2"+"("+arg1+", "+arg2+")";
        }

}
so it just return a string. I do  not know it can work like it.
I just used ' call ' to return the version of ImageJ.
you can change the plugin parametre in the program and then just run it if
you not always change your parameter.

2010/9/14 Chris Elliott <[hidden email]>

> Please see comments below:
>
> On Sep 13 2010, Vinay sj wrote:
>
>  Dear All,
>>
>> I am writing a macro to track nuclei from a live cell imaging movie. I am
>> using Mtrack2 to automate the tracking. I am having several problems with
>> this macro. It seems that the macro is not able to generate tracks from
>> binary images of DAPI stained nuclei. However, when I invert the images to a
>> white foreground, the Mtrack2 algorithm works when i use it manually with
>> the imagej. However, when I run Mtrack2 from my own macro. The tracking does
>> not work. Please help.
>>
>> I have put my code below. stackpath is the path to the stack of
>> images(binary images of nuclei)
>> stackPath = stackFolder + "Stack.tif";
>>
>>
> are you sure that stackFolder ends with a directory separator ? / or \\ ?
>
>  open(stackPath);
>>
>> run("Invert","stack");
>>
>>
>> call("MTrack2_.setProperty","minSize","50");
>> call("MTrack2_.setProperty","maxSize","2000");
>> call("MTrack2_.setProperty","minTrackLength","3");
>> call("MTrack2_.setProperty","maxVelocity","4");
>> call("MTrack2_.setProperty","saveResultsFile","false");
>> call("MTrack2_.setProperty","showPaths","true");
>> call("MTrack2_.setProperty","showPathLengths","true");
>> call("MTrack2_.setProperty","showLabels","false");
>> call("MTrack2_.setProperty","showPositions","true");
>> call("MTrack2_.setProperty","skipDialogue","true");
>>
>> run("MTrack2");
>>
>
> I did run("MTrack2 ", "minimum=6 maximum=999999 maximum_=100 save
> save=&path4");
>
> see http://biolpc22.york.ac.uk/drosophila/larvae/ for analysing a
> directory full of avi (rather than tif) stacks; I did the task in two parts,
> one to convert all the images to black/white, and the other to do the
> tracking. Any comments appreciated chris
>



--
Chen Yanpei, phD
MssMat
Ecole Centrale Paris
Grande voie des vignes
92295 Châtenay Malabry
Paris, France