Odd post-processing behavior when batch processing files

10 views
Skip to first unread message

Brian

unread,
Jul 30, 2021, 2:04:18 PMJul 30
to ThunderSTORM: discussion group
Hi all,

I've been using ThunderSTORM with no issue for years, but fired it up to batch process some .nd2 files yesterday and found that the post-processing "merge" function is being skipped while iterating over my image files.

I also found that when I manually open images and process them using the ThunderSTORM GUI after running any batch macro that executes the merge function, some post-processing options are no longer operable.  For example, the drift correction "Apply" button and the merging "Merge" button are both greyed/faded out and cannot be clicked.  However, if I hit "enter" while in any of the drift correction parameter fields, the drift correction step runs and the "apply" button becomes function again.    Unfortunately, I cannot get the "merge" button to work.

Thankfully, I've found that drift correction does correctly execute on each iteration of a for loop.  But I cannot get the merge function to execute from any script after the first processed image, or use it in the GUI.  It seems to run once, and then become nonfunctional, requiring me to restart a new Fiji session.  The exported analysis protocols confirm that the merge function is being skipped after the first image.

This happened on the most recent version of Fiji.  I've downloaded and installed prior versions of ImageJ/Fiji and nothing seems to fix the issue so far.  Anybody else experiencing this?

I wrote up a simple macro script to reproduce the problem (below).  One can comment out the drift correction or merge steps as necessary to see the different behavior for each respective post-processing function.

macro "debug" {
dir1 = getDirectory("Choose Source Directory ");
dir2 = getDirectory("Choose Output Directory ");
data = getFileList(dir1);

for (i=0; i<data.length; i++) {
 showProgress(i+1, data.length);
 run("Bio-Formats Importer", "open=["+dir1+data[i]+"] autoscale color_mode=Default rois_import=[ROI manager] view=[Standard ImageJ] stack_order=Default");
 run("Run analysis", "filter=[Lowered Gaussian filter] sigma=1.0 detector=[Local maximum] connectivity=8-neighbourhood threshold=200 estimator=[PSF: Integrated Gaussian] sigma=1.0 fitradius=3 method=[Maximum likelihood] full_image_fitting=false mfaenabled=false renderer=[Averaged shifted histograms] pickedlut=physics magnification=25.0 colorize=true threed=false shifts=2 repaint=1000");
 //Drift correction step here (this runs successfully each iteration
 run("Show results table", "action=drift smoothingbandwidth=0.05 method=[Fiducial markers] ontimeratio=0.1 distancethr=100.0 save=false");
 //Merge step here (this only runs on the first file in data
 run("Show results table", "action=merge zcoordweight=0.1 offframes=0 dist=90 framespermolecule=0");
 title = replace(data[i],".nd2",".csv");
 run("Export results", "floatprecision=5 filepath=["+dir2+title+"] file=[CSV (comma separated)] sigma=true intensity=true offset=false saveprotocol=true x=true y=true bkgstd=false id=true uncertainty_xy=true frame=true detections=true");
 }
}

For me, this executes the drift correction each time but only executes the merge function on the first image in a directory.

I also tried this with the ChriSTORM scripts and found that merge step was not executing there either, using the Batch Process Locs macro.  It throws a Java error (java.lang.NullPointerException) and a long error log.ChriSTORM merge error.PNG


Any idea what might be going on?  (Hopefully I've just introduced a mistake in my macro).

Thanks!



Brian

unread,
Jul 30, 2021, 3:58:37 PMJul 30
to ThunderSTORM: discussion group
Update - I think this is solved by installing a different ThunderSTORM version, which I must have changed inadvertently to an earlier release at some point after updating Fiji this year (go figure).

I also see this problem is similar to a previous issue with filtering calls from a macro (https://groups.google.com/g/thunderstorm-users/c/Z6Vx5T5P-3U)

It looks like it is easily solved by restoring simply re-installing ThunderSTORM from the following link:  https://github.com/zitmen/thunderstorm/releases/tag/dev-2016-09-10-b1

Cheers,

Brian
Reply all
Reply to author
Forward
0 new messages