//This script is written in the IJ1 Language
print("\\Clear")
// MIT License
// Copyright (c) 2019 Nicholas Condon n.condon@uq.edu.au
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
//Script Details and Acknowledgement
scripttitle="Felicity - Ca 2+ Quantification Script";
version="1.0";
date="27/03/19";
description="This script takes 2-channel images and measures intensity (red/green), cell length over time. "
+"
Total cell intensity can be normalised using the Simple Ratio method in FIJI."
+"
This script can be run in the background by selecting Batch Mode."
showMessage("Institute for Molecular Biosciences ImageJ Script", ""
+"
ACRF: Cancer Biology Imaging Facility
+"The University of Queensland
+"ACRF: Cancer Biology Imaging Facility<\h4>"
+"ImageJ Script Macro: "+scripttitle+"
"
+"Version: "+version+" ("+date+")"
+"Created by Nicholas Condon
"
+" contact n.condon@uq.edu.au \n "
+" Available for use/modification/sharing under the "+"MIT License<\h4> "
+" <\h3>"
+""+description+""
+"
"
+" "
+"");
//Creates a Parameters dialog box
ext = ".oir";
Dialog.create("Parameters");
Dialog.addMessage("Configuration Controls:")
Dialog.addMessage(" ");
Dialog.addString("Choose your file extension:", ext); //Option to choose your file extension
Dialog.addMessage("(For example .czi .lsm .nd2 .lif .ims)");
Dialog.addMessage(" ");
Dialog.addCheckbox("Run Bleaching Normalisation", true); //Option for bleach mode
Dialog.addCheckbox("Run in batch mode (Background)", true); //Option for batch mode
Dialog.show();
ext = Dialog.getString(); //Updates file extension variable
Bleach = Dialog.getCheckbox(); //Updates Bleach correction variable
batch = Dialog.getCheckbox(); //Updates Batch mode variable
if (batch==1) {setBatchMode(true); print("Batch Mode: ON");}
if (batch==0) {setBatchMode(false); print("Batch Mode: OFF");}
run("Set Measurements...", "area mean standard modal min feret's median display"); //Sets measurements needed for all analysis
getDateAndTime(year, month, week, day, hour, min, sec, msec); //Gets date and time info for folders
print("\\Clear"); //Clears log window
roiManager("Reset"); //Clears ROI manager
run("Clear Results"); //Clears Results Window
path = getDirectory("Choose Source Directory ");
list = getFileList(path);
resultsDir = path+"_Results_"+"_"+year+"-"+month+"-"+day+"_at_"+hour+"."+min+"/"; //Defines Results Directory filepath and name
File.makeDirectory(resultsDir); //Creates Results directory
start = getTime(); //Starts timer
for (i=0; i0) { //Looks for any residual open images
selectImage(nImages); //Selects the open images
close(); //Closes the images
}
}
}
//Writes to log window script title and acknowledgement
print("\\Clear");
print("");
print("FIJI Macro: "+scripttitle);
print("Version: "+version+" Version Date: "+date);
print("ACRF: Cancer Biology Imaging Facility");
print("By Nicholas Condon (2019) n.condon@uq.edu.au");
print("");
print("Script Run Date: "+day+"/"+(month+1)+"/"+year+" Time: " +hour+":"+min+":"+sec);
print("");
print("Working Directory Location: "+path);
print("Files Processed: "+i);
print("");
if (batch==1) {print("Batch Mode: ON");}
if (batch==0) {print("Batch Mode: OFF");}
if (Bleach==1) {print("Bleach correction Mode: ON");}
if (Bleach==0) {print("Bleach correction Mode: OFF");}
print("File extension used: " +ext);
print("");
print("Batch Completed");
print("Total Runtime was:");
print((getTime()-start)/1000);
selectWindow("Log"); //Selects the Log window
saveAs("Text", resultsDir+"Log.txt"); //Saves the log window
//exit message to notify user that the script has finished.
title = "Batch Completed";
msg = "Put down that coffee! Your analysis is finished";
waitForUser(title, msg);