-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBatch_Z-stack_Trimmer.ijm
More file actions
107 lines (88 loc) · 4.18 KB
/
Batch_Z-stack_Trimmer.ijm
File metadata and controls
107 lines (88 loc) · 4.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
print("\\Clear");
// This script has been made with the help of Nicholas Condon's script Generator
// MIT License
// Copyright (c) 2025 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.
scripttitle= "DRAFT Manasa Script 2";
version= "0.4";
date= "23-10-2025";
description= "Cell, Puncta & Donut Measurer";
/*
* v0.3
* Added mito raw integrated density measurements
* changed NLRP mean to integrated density measurements
*
* v0.4
* Changed from intden to rawintden
*
*/
showMessage("ImageJ Script Information Box", "<html>
+"<h1><font color=black>ImageJ Script Macro: "+scripttitle+"</h1>
+"<p1>Version: "+version+" ("+date+")</p1>"
+"<H2><font size=3>Created by Nicholas Condon</H2>"
+"<p1><font size=2> contact n.condon@uq.edu.au \n </p1>"
+"<P4><font size=2> Available for use/modification/sharing under the "+"<p4><a href=https://opensource.org/licenses/MIT/>MIT License</a><h4> </P4>"
+"<h3> <h3>"
+"<p1><font size=3 i>"+description+"</p1>
+"<h1><font size=2> </h1>"
+"<h0><font size=5> </h0>"
+"");
print("");
print("FIJI Macro: "+scripttitle);
print("Version: "+version+" Version Date: "+date);
print("By Nicholas Condon (2025) 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("");
// --- Parameters ---
pixelSize = 0.0353646; // µm per pixel
radius_um = 2.0; // circle radius in µm
radius_px = radius_um / pixelSize;
//Directory Warning and Instruction panel
Dialog.create("Choosing your working directory.");
Dialog.addMessage("Use the next window to navigate to the directory of your images.");
Dialog.addMessage("(Note a sub-directory will be made within this folder for output files) ");
Dialog.addMessage("Take note of your file extension (eg .tif, .czi)");
Dialog.show();
//Directory Location
path = getDirectory("Choose Source Directory ");
list = getFileList(path);
getDateAndTime(year, month, week, day, hour, min, sec, msec);
ext = ".tif";
Dialog.create("Settings");
Dialog.addString("File Extension: ", ext);
Dialog.addMessage("(For example .czi .lsm .nd2 .lif .ims)");
Dialog.addNumber("What Size band would you like?", 20);
Dialog.show();
ext = Dialog.getString();
start = getTime();
//Creates Directory for output images/logs/results table
resultsDir = path+"_Results_"+"_"+year+"-"+(month+1)+"-"+day+"_at_"+hour+"."+min+"/";
File.makeDirectory(resultsDir);
print("Working Directory Location: "+path);
for (z=0; z<list.length; z++) {
if (endsWith(list[z],ext)){
// run("Bio-Formats Importer", "open=["+path+list[z]+"] autoscale color_mode=Default rois_import=[ROI manager] view=Hyperstack stack_order=XYCZT");
run("Bio-Formats Importer", " open=["+path+list[z]+"] autoscale color_mode=Default rois_import=[ROI manager] specify_range view=Hyperstack stack_order=XYCZT z_begin=190 z_end=260 z_step=1");
windowtitle = getTitle();
save(resultsDir+windowtitle);close();
}}
//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);