Login  Register

Deconvoluted Image Not Displaying / Saving

Posted by dcsen87 on Jun 08, 2017; 7:36pm
URL: http://imagej.273.s1.nabble.com/Deconvoluted-Image-Not-Displaying-Saving-tp5018870.html

Hello all,

I am trying to write a macro to generate PSFs and then run deconvolution for a set of z-stacks. A new PSF has to be generated for each stack because of the different slice number in each stack. The macro appears to be running fine (generating a new PSF, using the PSF & the image in the deconvolution plugin, running up to 100 iterations of deconvolution), however 1) the temporary deconvolutions (images generated each iteration) are not displayed as is done when running the plug-in outside of the macro and 2) the final deconvoluted image is not displayed and I therefore cannot save it into my output folder.

Any suggestions? Thanks so much in advance if anyone is able to help!

Here is the macro so far in IJM language (new to programming, but have written a few successful batch processing macros in ImageJ)



function pS831Decon(input, output, filename) {
       
open(input + filename);
run("Split Channels");

selectWindow("C2-" + filename);//VG2
close();
selectWindow("C3-" + filename); //PSD95
close();
selectWindow("C1-" + filename); //pS831

slicenumber = nSlices;  

run("Diffraction PSF 3D", "index=1.500 numerical=1.40 wavelength=488 longitudinal=0 image=90 slice=900 width,=324 height,=324 depth,="+slicenumber+" normalization=[Peak = 255] title=pS831PSF-"+filename+"");

run("Iterative Deconvolve 3D", "imga=C1-"+filename+" point=pS831PSF-"+filename+" output=Deconvolved-"+filename+" show log perform detect wiener=0.000 low=1 z_direction=1 maximum=100 terminate=0.010");


selectWindow("Deconvolved-"+filename+"");

saveAs("Tiff", output +"Deconvolved-"+filename+""+ ".tif");
close();


}

input = "/Users/dcs/Documents/Images/Exps/test/";
output = "/Users/dcs/Documents/Images/Exps/pS831decon/";


setBatchMode(true);
list = getFileList(input);
for (i = 0; i < list.length; i++)
       pS831Decon(input, output, list[i]);
setBatchMode(false);