print("\\Clear")
// MIT License
// Copyright (c) 2018 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.
//IMB Macro Splash screen (Do not remove this acknowledgement)
scripttitle="LLSM - Edge Clipping";
version="1.1";
versiondate="10/11/2018";
description="This script takes LLSM time point files and trims bright pixels off the edge of the images post deskew."
+"
Input images should be deskewed LLSM files (multi-dimensional is fine). Optional pop-up for also saving Z-Projections with Max- Min- & Average selectable."
+"
Optional Check box for running the 'To Imaris' Imaris plugin if you have the XT package and FIJI linked.";
showMessage("Institute for Molecular Biosciences ImageJ Script", ""
+"
ACRF: Cancer Biology Imaging Facility
+"The Institute for Molecular Bioscience
The University of Queensland
+"ACRF: Cancer Biology Imaging Facility<\h4>"
+"ImageJ Script Macro: "+scripttitle+"
"
+"Version: "+version+" ("+versiondate+")"
+"Created by Nicholas Condon
"
+" contact n.condon@uq.edu.au \n "
+" Available for use/modification/sharing under the "+"MIT License<\h4> "
+" <\h3>"
+""+description+""
+"
"
+" "
+"");
//Log Window Title and Acknowledgement
print("");
print("FIJI Macro: "+scripttitle);
print("Version: "+version+" ("+versiondate+")");
print("ACRF: Cancer Biology Imaging Facility");
print("By Nicholas Condon (2018) n.condon@uq.edu.au")
print("");
getDateAndTime(year, month, week, day, hour, min, sec, msec);
print("Script Run Date: "+day+"/"+(month+1)+"/"+year+" Time: " +hour+":"+min+":"+sec);
print("");
//Directory Warning panel
title = "Select Directory location";
msg = "Use the next window to navigate to your directory of images. (Note a sub-directory called Results will be made within this fodler.)";
waitForUser(title, msg);
//Setting up directory locations etc
start = getTime();
run("Clear Results");
path = getDirectory("Choose Source Directory ");
list = getFileList(path);
resultsDir = path+"Results_Clipped/";
File.makeDirectory(resultsDir);
setBatchMode(true);
//Box for choosing post processing stuff.
Dialog.create("Post Processing Steps");
Dialog.addMessage(" ")
Dialog.addChoice("Run Z-Projection", newArray("No Projection", "Max Intensity", "Average Intensity", "Sum Slices"));
Dialog.addCheckbox("Push to Imaris upon completion", false);
Dialog.show();
projectiontype = Dialog.getChoice();
Imaris = Dialog.getCheckbox();
print("Projection type selected: "+projectiontype);
if (Imaris ==1){print("Images will be pushed to Imaris upon completion.");}
print("");
//warning for having Imaris running if option is selected.
if (Imaris==1) {
Dialog.create("WARNING");
Dialog.addMessage("Imaris must be running. If not start it now before continuing.")
Dialog.show();
}
start = getTime();
//File loop for multiple images in a folder
for (z=0; z