UU-cellbiology / ComDet

ImageJ plugin detecting and colocalizing particles of given size (vesicles, dots, etc on biological microscopy images)
GNU General Public License v3.0
13 stars 4 forks source link

Can we make ComDet run automatically for multiple images open? #4

Closed redbybeing closed 4 years ago

redbybeing commented 4 years ago

Hi, I am using ComDet frequently and it is so useful to me! I was wondering, is there a way to make ComDet run automatically for multiple images open, once the parameters are set? For my project, I need to run ComDet repeatedly for many serial images, and copy paste the results to excel each time. However, sometimes I need to adjust some detection parameters to make the detection better, and then I have to repeat running ComDet from the beginning with the new adjusted parameter. Do you think there's a way to do this more easily? I look forward to your opinion. Thank you very much! Best, Jiseok

ekatrukha commented 4 years ago

Hello Jiseok,

to run ComDet in batch mode (on a folder with multiple files), I've wrote a small ImageJ macro. Here is how to use it.

  1. You need to download it somewhere on your computer, using this link.

  2. Open FIJI and go to File->New->Script. It will open a script editor. In it, open the downloaded file (File->Open). It will open the text of the macro file.

  3. To use it, you would need to correct two things in the text (they are minor and simple things and you can do that easily).

  4. First, you need to specify extension of files that you want to analyze. It is specified in the following part of the code: suffix = ".tif"; If you want to process .tif files, just keep it as it is. If you have, let's say, Zeiss files with an extension of lsm, change it to suffix = ".lsm"; and so on.

  5. Now you need to specify detection parameters of ComDet. To do that, first open FIJI/ImageJ command recorder: Plugins->Macro->Record. After that open one example frame of your images/stacks. It should be still composite/multichannel image, if you images/stacks are multichannel. Now on that single frame, run ComDet with desired detection parameters.

  6. You will need the last string appearing in the Recorder window of FIJI/ImageJ. It should start with run("Detect Particles",

  7. Now go back to script editor and substitute this string: run("Detect Particles", "ch1i ch1l ch1a=4 ch1s=50 rois=Ovals add=Nothing"); with the string from Recorder.

  8. Press "Run" in the script editor. It will run macro, that will ask you for the folder first and will perform detections for all images and save results in the same folder as csv files.

If you have any questions, ask!

redbybeing commented 4 years ago

Thanks so much for detailed instructions. I'll try it! Best, Jiseok

On Tue, May 5, 2020 at 3:09 AM Eugene Katrukha notifications@github.com wrote:

Closed #4 https://github.com/ekatrukha/ComDet/issues/4.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ekatrukha/ComDet/issues/4#event-3302928770, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOVAZFWRLVHQQM4JMKMGHFLRP63Q3ANCNFSM4K3RMQJA .