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="Image De-Stacker"; version="1.2"; versiondate="20/09/2018"; description="Details:
This script takes 3D/4D images and de-stacks them into lower dimensional files. Files are filtered by their extension (.czi, .lsm etc) and are opened via Bioformats importer.

Files to be processed should be within their own directory. Processed images/movies will be placed into a subdirectory called Results_(Date&time).

A log file (.txt) will be saved within this directory for recording the processing steps chosen" 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+"." +"

" +" " +""); //Directory Warning panel Dialog.create("Choosing your image location"); Dialog.addMessage("Use the next window to navigate to your directory of images."); Dialog.addMessage("(Note a sub-directory will be made for each input image within this fodler) "); Dialog.addMessage("Take note of your file extension (eg .tif, .czi)"); Dialog.show(); path = getDirectory("Choose Source Directory "); list = getFileList(path); setBatchMode(true); //Parameter selection box ext = ".tif"; Dialog.create("Select DIMENSIONALITY"); Dialog.addString("File Extension:", ext); Dialog.addMessage("(For example .czi .lsm .nd2 .lif .ims)"); Dialog.addMessage(" "); Dialog.addMessage("Select how you wish to reduce the dimensionality of your files"); Dialog.addCheckbox("Frames", false); Dialog.addCheckbox("Slices", false); Dialog.addCheckbox("Channels", false); Dialog.addCheckbox("Subfolders", true); Dialog.show(); choiceFrames=Dialog.getCheckbox(); choiceSlices = Dialog.getCheckbox(); choiceChannels = Dialog.getCheckbox(); choiceSubfolders = Dialog.getCheckbox(); ext = Dialog.getString(); print(""); print("Running Script: Image De-stacker"); print(""); print("Your chosen file extension is: "+ext); start = getTime(); //File loop for multiple images in a folder for (z=0; z