macros - Fiji (is just ImageJ) memory issue -
Just a bit of background:
I created Fiji (image only) macro which takes scan A folder of images (combine 6 mm plates into 3 * 4 fashion) recognizes these ROIs and separates them into separate pictures. These single images are then compared with the difference image analysis. And the results are stored as Excel spreadsheets. It has been prepared to be active at the end of the day and it has been left over for the process overnight.
My point is that Fiji's memory slowly recruits, throws an error, to stop the program. I have a garbage collection in my code but it does not fully clean the memory So, the capacity is gradually filled up.
I really should work on most machines (so much more RAM being purchased is not really an option) In my current testing machine, 8 GB RAM and 3/4 FII have been allocated.
Below is the code that I believe is rooted on this issue. (This is the last step of the macro where individual images are compared) Any help is greatly appreciated :)
function jakero (Startdir, enddir) {Path = getFileList (start); For (i = 0; i & lt; path.length; i ++) {open (startdir + path [i]); Print (path [i]); If (i% 2) {runs ("to stack images", "name = stack 1 title = [] use"); Wait (1000); // Select the sequential scan by creating the image difference between window ("stack 1"); Play ("image stabilizer", "change = Affine max_pyramid_levels = 4 template_update_coefficient = 0.90 max_terez = 20000 error_talance = 0.0000001"); Run ("collect collection"); Run ("Z Project ...", "Start = 1 Stop = 2 Projection = [Maximum Intensity]"); ImageCalculator ("Making the Difference", "Stack 1", "MAX_stack1"); SelectWindow ("MAX_stack1"); Wait (2000); Run ("off"); Run ("collect collection"); Wait (100); SelectWindow ("Stack 1 result"); Wait (2000); Run ("Gaussian Blur ...", "Sigma = 2 Stack"); Wait (2000); // for tif 5000 3500 runs ("histresses ...", "high = 30 cum = 10"); Wait (8000); SelectWindow ("Stack 1 result"); Wait (100); Run ("off"); Wait (100); SelectWindow ("hysteresis"); Wait (100); Rename ("Stack 1 result"); Wait (100); Run ("inverse"); Wait (2000); Play ("attribute ...", "channel = 1 slice = 1 frame = 1 unit = mm pixel_width = 0.0105834 pixel_heff = 0.0105834 voxel_depth = 25.4000508 frame = [0 seconds] original = 0,0"); Wait (2000); Run ("analyze particle ...", "size = 0.005-0.8 circular = 0.08-0.8 show = do not show anything except the clear joint"); SelectWindow ("stack1"); Play ("Select All"); RoiManager ("combine"); // Services ("Tiff", Andyear); SelectWindow ("Stack 1 result"); Close (); Run ("collect collection"); Close (); Run ("collect collection"); FileName = Partition (path [i-1], "."); Save ("Results", "" + Interval + "" + Filename [0] + ".xls"); K = 1; For (k = 1; k & lt; = 5; k ++) {run ("Collect Collect"); Phone ("CollectGarbage_.registerCloseListener"); }; }}}
Comments
Post a Comment