Re: MTrack3: like MTrack2, but with a different results format

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

Re: MTrack3: like MTrack2, but with a different results format

David Eccles (gringer)
From:    giubi<[hidden email]>
> // If I run this line with MTrack2 I get 5 files, with MTrack3 just one
> for (i=1; i<=5; i++) run("MTrack2 ", "save save=" + dirOut + "file_number_"
> + i);

Hi Giuseppe,

I wasn't actually aware that MTrack2 had a save functionality that
allowed for custom file names, so this 'save' option in the run
arguments is a surprise to me. It is likely that I have done something
so that this previous save function doesn't work as expected, because I
changed the results format (and table names).

However, I can get it to save with different file names when running
this from a macro using the more generic macro save function. So your
script would go something like this:

for (i=1; i<=5; i++){
   run("MTrack3 ");
   selectWindow("Particle positions");
   saveAs("measurements", dirOut + "pos_file_number_" + i + ".csv");
   run("Close"); // possibly not needed
   selectWindow("Track summaries");
   saveAs("measurements", dirOut + "tracks_file_number_" + i + ".csv");
   run("Close"); // possibly not needed
}

Hope this helps,
David
Reply | Threaded
Open this post in threaded view
|

Re: MTrack3: like MTrack2, but with a different results format

giubi
Thank you David,

The generic save macro function works fine. The only annoying thing is
that the *Particle positions* window pop up but is suddenly closed
thereafter.

I also managed to add a minVelocity threshold in MTrack3 to eliminate non
(or slow) moving objects. Next step will be import and visualising data in
R...

Cheers,
Giuseppe


On 28 September 2011 10:48, David Eccles (gringer) <
[hidden email]> wrote:

> From:    giubi<[hidden email]>
>
>> // If I run this line with MTrack2 I get 5 files, with MTrack3 just one
>> for (i=1; i<=5; i++) run("MTrack2 ", "save save=" + dirOut +
>> "file_number_"
>> + i);
>>
>
> Hi Giuseppe,
>
> I wasn't actually aware that MTrack2 had a save functionality that allowed
> for custom file names, so this 'save' option in the run arguments is a
> surprise to me. It is likely that I have done something so that this
> previous save function doesn't work as expected, because I changed the
> results format (and table names).
>
> However, I can get it to save with different file names when running this
> from a macro using the more generic macro save function. So your script
> would go something like this:
>
> for (i=1; i<=5; i++){
>  run("MTrack3 ");
>  selectWindow("Particle positions");
>  saveAs("measurements", dirOut + "pos_file_number_" + i + ".csv");
>  run("Close"); // possibly not needed
>  selectWindow("Track summaries");
>  saveAs("measurements", dirOut + "tracks_file_number_" + i + ".csv");
>  run("Close"); // possibly not needed
> }
>
> Hope this helps,
> David
>