Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //to import code in ImageJ: File>New>New text window>paste the following:
- input = "C:/Users/Zsofi/Desktop/test2/"; //change imput dir as required
- output = "C:/Users/Zsofi/Desktop/test2/"; //change output dir as required
- path = getDirectory("image");
- list=getFileList("C:/Users/Zsofi/Desktop/test2/"); //change imput dir as required
- for (i = 0; i < list.length; i++){
- action(input, output, list[i]);
- }
- function action(input, output, filename) {
- open(input + filename);
- img_title = getTitle();
- run("Split Channels");
- selectWindow(img_title+" (blue)");
- close(); //closes DAPI/blue channel
- selectWindow(img_title+" (red)");
- run("Find Maxima...", "prominence=100 output=[Point Selection]"); //change prominance val. based on manual checking
- run("Enlarge...", "enlarge=12"); //change enlarge based on ROI size
- selectWindow(img_title+" (green)");
- run("Restore Selection");
- run("ROI Manager...");
- roiManager("Add");
- roiManager("Split");
- roiManager("Measure"); //gives you a brightness value in the green channel for every red dot
- roiManager("Delete");
- selectWindow(img_title+" (red)");
- close();
- selectWindow(img_title+" (green)");
- close();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement