File tree Expand file tree Collapse file tree
clement/macros/measure-rect-over-time Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- var f_before = 1;
2- var f_after = 1;
3- var f_first = 0;
4- var f_last = 0;
5- var n_images = 2;
6- var t_name = "Measurements";
7- var suffix = "_preprocessed.tif";
8- var titles = getList("image.titles");
9- var remember = false;
1+ var f_before = 1;
2+ var f_after = 1;
3+ var f_first = 0;
4+ var f_last = 0;
5+ var n_images = 2;
6+ var t_name = "Measurements";
7+ var suffix = "_preprocessed.tif";
8+ var titles = getList("image.titles");
9+ var remember = false;
10+ var line_length = 0;
11+ var line_width = 0;
12+ var line_set = false;
1013
1114if (titles.length != n_images) {
1215 exit("!!! Only " + n_images + " images should be opened!!!");
@@ -72,14 +75,23 @@ function preprocess() {
7275 Table.reset(t_name);
7376}
7477
75- function shrink_line() {
78+ function ask_line_settings() {
79+ if (line_set) { return; }
7680 Dialog.create("Dimensions");
7781 Dialog.addNumber("Length (um)", 1.5);
7882 Dialog.addNumber("Width (pxl)", 15);
7983 Dialog.show();
8084 l = Dialog.getNumber();
8185 w = Dialog.getNumber();
8286 toUnscaled(l);
87+ line_length = l;
88+ line_width = w;
89+ line_set = true;
90+ }
91+
92+ function shrink_line() {
93+ l = line_length;
94+ w = line_width;
8395 Roi.getCoordinates(xpoints, ypoints);
8496 // original points
8597 p1x = xpoints[0];
@@ -139,7 +151,9 @@ function analyze_cell(cell_index) {
139151 "Draw a thick line perpenticular to the ring"
140152 );
141153 }
154+ ask_line_settings();
142155 shrink_line();
156+ ask_frames();
143157 while (!update_frames()) {
144158 waitForUser(
145159 "Not enough frames",
@@ -189,7 +203,6 @@ function analyze_cell(cell_index) {
189203function main() {
190204 cell_index = 1;
191205 preprocess();
192- ask_frames();
193206 while(true) {
194207 analyze_cell(cell_index);
195208 cell_index++;
You can’t perform that action at this time.
0 commit comments