NOTICE! This is a static HTML version of a legacy Fiji BugZilla bug.

The Fiji project now uses GitHub Issues for issue tracking.

Please file all new issues there.

Bug 112 - Strange data measurement data logging
Strange data measurement data logging
Status: RESOLVED INVALID
Product: Fiji
Classification: Unclassified
Component: Plugins
unspecified
PC Windows
: P4 normal
Assigned To: ImageJ Bugs Mailing List
Depends on:
Blocks:
 
Reported: 2009-12-02 18:03 CST by Michiel
Modified: 2009-12-20 12:04 CST
1 user (show)

See Also:

Description Michiel 2009-12-02 18:03:44 CST
Hello

I have a stack of different 16bit TIFs in which nuclei have been stained. I am interested in measuring the mean intensity of these nuclei in each slice of the stack.

When I use the macro below on this stack, everything goes fine for the first slice, but for slice 2, 3, etc. there is something strange hapening with the data logging. All the ROIs are measured twice. First all ROI's are logged for slice 0 (this I find strange) with a average intensity of 255. Then all ROI's are logged again for the correct slice with the correct average intensity. See data logging below.

Can you help me out and explain how this is happening?

Thanks,
Michiel


----------------------------------------------------------------------------------------
Macro:
setSlice(1)
i=1;

do {

run("Duplicate...", "title=Mask");

setAutoThreshold("Triangle dark");
run("Convert to Mask");
run("Analyze Particles...", "size=100-Infinity circularity=0.00-1.00 show=Nothing add");
selectWindow("Mask");
close();

name = getTitle;
selectWindow(name);
run("Set Measurements...", "  mean area redirect=None decimal=3");
roiManager("Measure");

dir = getDirectory("image");
name = getInfo("slice.label");
name = name + ".xls";
saveAs("Measurements", dir+name);

name = getInfo("slice.label");
name = name + ".zip";
roiManager("Save", dir+name);

run("Clear Results");
roiManager("Reset");

run("Next Slice [>]");
i=i+1;

}	while (i<=nSlices);

----------------------------------------------------------------------------------------

Data logging:

 	Area	Mean	Slice
1	0.318	255	0
2	0.125	255	0
3	0.210	255	0
4	0.326	255	0
5	0.241	255	0
6	0.036	255	0
7	0.146	255	0
8	0.296	255	0
9	0.173	255	0
10	0.095	255	0
11	0.196	255	0
12	0.272	255	0
13	0.030	255	0
14	0.181	255	0
15	0.320	255	0
16	0.111	255	0
17	0.146	255	0
18	0.316	255	0
19	0.322	255	0
20	0.338	255	0
21	0.333	255	0
22	0.219	255	0
23	0.024	255	0
24	0.183	255	0
25	0.193	255	0
26	0.154	255	0
27	0.022	255	0
28	0.331	255	0
29	0.430	255	0
30	0.142	255	0
31	0.200	255	0
32	0.111	255	0
33	0.193	255	0
34	0.262	255	0
35	0.201	255	0
36	1.058	255	0
37	0.358	255	0
38	1.865	255	0
39	0.529	255	0
40	0.377	255	0
41	0.510	255	0
42	1.264	255	0
43	1.207	255	0
44	0.076	255	0
45	0.165	255	0
46	0.787	255	0
47	0.216	255	0
48	0.029	255	0
49	1.939	255	0
50	0.176	255	0
51	0.026	255	0
52	0.021	255	0
53	0.539	255	0
54	0.140	255	0
55	0.242	255	0
56	0.180	255	0
57	0.382	255	0
58	0.408	255	0
59	0.304	255	0
60	0.121	255	0
61	0.170	255	0
62	0.288	255	0
63	0.496	255	0
64	0.024	255	0
65	0.264	255	0
66	0.347	255	0
67	0.236	255	0
68	0.235	255	0
69	0.317	255	0
70	0.366	255	0
71	0.366	255	0
72	0.175	255	0
73	0.118	255	0
74	0.379	255	0
75	0.140	255	0
76	0.158	255	0
77	0.269	255	0
78	0.431	255	0
79	0.061	255	0
80	0.217	255	0
81	0.098	255	0
82	0.511	255	0
83	0.232	255	0
84	0.148	255	0
85	0.182	255	0
86	0.696	255	0
87	0.350	255	0
88	0.245	255	0
89	0.111	255	0
90	0.201	255	0
91	0.125	255	0
92	0.095	255	0
93	0.222	255	0
94	0.232	255	0
95	0.233	255	0
96	0.381	255	0
97	0.402	255	0
98	0.177	255	0
99	0.493	255	0
100	0.406	255	0
101	0.837	255	0
102	0.332	255	0
103	0.448	255	0
104	0.206	255	0
105	0.311	255	0
106	0.331	255	0
107	0.143	255	0
108	0.164	255	0
109	0.160	255	0
110	0.216	255	0
111	0.108	255	0
112	0.230	255	0
113	0.331	255	0
114	0.318	255	0
115	0.172	255	0
116	0.240	255	0
117	0.532	255	0
118	0.327	255	0
119	0.156	255	0
120	0.163	255	0
121	0.212	255	0
122	0.222	255	0
123	0.051	255	0
124	0.219	255	0
125	0.288	255	0
126	0.162	255	0
127	0.174	255	0
128	0.476	255	0
129	0.171	255	0
130	0.027	255	0
131	0.252	255	0
132	0.043	255	0
133	0.300	255	0
134	0.154	255	0
135	0.151	255	0
136	0.386	255	0
137	0.329	255	0
138	0.713	255	0
139	0.531	255	0
140	0.116	255	0
141	0.135	255	0
142	0.226	255	0
143	0.027	255	0
144	0.179	255	0
145	0.294	255	0
146	0.249	255	0
147	0.154	255	0
148	0.177	255	0
149	0.634	255	0
150	0.066	255	0
151	0.232	255	0
152	0.165	255	0
153	0.336	255	0
154	0.133	255	0
155	0.151	255	0
156	0.178	255	0
157	0.217	255	0
158	0.356	255	0
159	0.141	255	0
160	0.283	255	0
161	0.235	255	0
162	0.177	255	0
163	0.315	255	0
164	0.185	255	0
165	0.361	255	0
166	0.128	255	0
167	1.406	255	0
168	0.523	255	0
169	0.167	255	0
170	0.220	255	0
171	0.252	255	0
172	0.121	255	0
173	0.184	255	0
174	0.228	255	0
175	0.316	255	0
176	0.348	255	0
177	0.129	255	0
178	0.294	255	0
179	0.303	255	0
180	0.143	255	0
181	0.233	255	0
182	0.178	255	0
183	0.642	255	0
184	0.266	255	0
185	0.135	255	0
186	0.178	255	0
187	0.159	255	0
188	0.026	255	0
189	0.328	255	0
190	0.325	255	0
191	0.136	255	0
192	0.164	255	0
193	0.195	255	0
194	0.156	255	0
195	0.636	255	0
196	0.037	255	0
197	0.254	255	0
198	0.299	255	0
199	0.204	255	0
200	0.107	255	0
201	0.358	255	0
202	0.356	255	0
203	0.292	255	0
204	0.185	255	0
205	0.031	255	0
206	0.279	255	0
207	0.149	255	0
208	0.177	255	0
209	0.119	255	0
210	0.176	255	0
211	0.374	255	0
212	0.166	255	0
213	0.024	255	0
214	0.145	255	0
215	0.115	255	0
216	0.213	255	0
217	0.175	255	0
218	0.232	255	0
219	0.272	255	0
220	0.026	255	0
221	0.020	255	0
222	0.083	255	0
223	0.393	255	0
224	0.264	255	0
225	0.234	255	0
226	0.034	255	0
227	0.271	255	0
228	0.511	255	0
229	0.212	255	0
230	0.310	255	0
231	0.237	255	0
232	0.103	255	0
233	0.155	255	0
234	0.220	255	0
235	0.591	255	0
236	0.195	255	0
237	0.721	255	0
238	0.191	255	0
239	0.245	255	0
240	0.210	255	0
241	0.846	255	0
242	0.115	255	0
243	0.056	255	0
244	0.174	255	0
245	0.042	255	0
246	0.268	255	0
247	0.315	255	0
248	0.179	255	0
249	0.234	255	0
250	0.158	255	0
251	0.134	255	0
252	0.321	657.765	2
252	0.321	657.765	2
253	0.125	863.348	2
254	0.210	640.582	2
255	0.334	636.943	2
256	0.241	674.484	2
257	0.036	359.930	2
258	0.147	656.476	2
259	0.297	577.527	2
260	0.173	648.416	2
261	0.095	774.721	2
262	0.196	693.636	2
263	0.273	621.602	2
264	0.030	417.024	2
265	0.183	700.912	2
266	0.322	681.887	2
267	0.111	435.435	2
268	0.146	548.602	2
269	0.317	592.039	2
270	0.324	626.263	2
271	0.346	602.403	2
272	0.333	695.684	2
273	0.219	639.977	2
274	0.024	354.925	2
275	0.184	663.512	2
276	0.193	655.091	2
277	0.155	665.777	2
278	0.022	406.579	2
279	0.344	552.214	2
280	0.442	558.409	2
281	0.143	575.451	2
282	0.202	627.601	2
283	0.111	707.702	2
284	0.193	635.474	2
285	0.266	568.767	2
286	0.201	577.206	2
287	1.067	611.645	2
288	0.361	617.874	2
289	1.894	533.549	2
290	0.530	532.409	2
291	0.380	671.867	2
292	0.515	438.980	2
293	1.275	561.556	2
294	1.259	668.201	2
295	0.076	362.295	2
296	0.165	772.543	2
297	0.802	636.578	2
298	0.218	454.803	2
299	0.029	374.636	2
300	1.995	591.372	2
301	0.179	666.412	2
302	0.028	336.955	2
303	0.022	344.091	2
304	0.540	611.480	2
305	0.140	681.414	2
306	0.243	617.216	2
307	0.180	582.859	2
308	0.385	545.640	2
309	0.415	647.688	2
310	0.311	606.064	2
311	0.122	811.143	2
312	0.170	669.456	2
313	0.288	665.458	2
314	0.500	635.956	2
315	0.026	336.158	2
316	0.264	707.553	2
317	0.348	612.306	2
318	0.236	581.522	2
319	0.237	590.352	2
320	0.317	738.217	2
321	0.369	595.898	2
322	0.366	640.377	2
323	0.176	704.771	2
324	0.118	659.094	2
325	0.381	517.910	2
326	0.140	653.094	2
327	0.158	606.514	2
328	0.270	563.610	2
329	0.431	642.620	2
330	0.061	645.380	2
331	0.218	770.740	2
332	0.098	385.190	2
333	0.518	640.723	2
334	0.232	427.473	2
335	0.149	548.338	2
336	0.182	721.523	2
337	0.704	599.832	2
338	0.350	699.907	2
339	0.247	660.906	2
340	0.111	606.748	2
341	0.202	738.793	2
342	0.125	412.957	2
343	0.096	395.476	2
344	0.224	558.774	2
345	0.233	601.041	2
346	0.233	615.294	2
347	0.384	559.655	2
348	0.403	569.061	2
349	0.178	763.499	2
350	0.506	631.804	2
351	0.419	666.440	2
352	0.865	577.769	2
353	0.332	598.851	2
354	0.455	529.989	2
355	0.208	586.895	2
356	0.312	516.044	2
357	0.332	569.465	2
358	0.143	505.101	2
359	0.167	668.510	2
360	0.160	753.011	2
361	0.217	667.202	2
362	0.108	399.141	2
363	0.230	690.894	2
364	0.332	615.406	2
365	0.319	679.347	2
366	0.174	676.992	2
367	0.241	597.015	2
368	0.535	640.644	2
369	0.334	567.964	2
370	0.158	661.141	2
371	0.165	760.652	2
372	0.213	701.294	2
373	0.222	784.476	2
374	0.052	342.643	2
375	0.221	599.307	2
376	0.291	612.561	2
377	0.166	606.246	2
378	0.174	653.759	2
379	0.483	604.517	2
380	0.171	580.387	2
381	0.027	378.073	2
382	0.254	596.821	2
383	0.043	417.296	2
384	0.302	658.269	2
385	0.155	628.272	2
386	0.151	597.749	2
387	0.393	592.227	2
388	0.331	627.367	2
389	0.719	647.075	2
390	0.540	682.886	2
391	0.119	364.019	2
392	0.144	347.573	2
393	0.227	579.059	2
394	0.028	429.426	2
395	0.179	798.684	2
396	0.297	687.250	2
397	0.249	442.055	2
398	0.156	639.236	2
399	0.178	743.235	2
400	0.645	645.463	2
401	0.068	353.282	2
402	0.233	795.822	2
403	0.165	682.200	2
404	0.337	704.963	2
405	0.133	465.776	2
406	0.151	728.529	2
407	0.178	690.419	2
408	0.220	625.266	2
409	0.357	634.212	2
410	0.141	685.689	2
411	0.284	593.586	2
412	0.238	559.631	2
413	0.177	734.948	2
414	0.315	699.818	2
415	0.186	669.056	2
416	0.364	648.283	2
417	0.129	544.151	2
418	1.417	644.801	2
419	0.525	622.396	2
420	0.167	657.010	2
421	0.221	681.837	2
422	0.255	731.487	2
423	0.121	558.978	2
424	0.184	782.642	2
425	0.229	712.572	2
426	0.317	623.981	2
427	0.349	777.985	2
428	0.129	661.312	2
429	0.295	612.313	2
430	0.304	685.004	2
431	0.143	711.143	2
432	0.233	696.011	2
433	0.178	662.046	2
434	0.660	574.055	2
435	0.267	590.382	2
436	0.135	570.186	2
437	0.179	633.765	2
438	0.159	487.706	2
439	0.027	380.224	2
440	0.329	636.269	2
441	0.326	575.146	2
442	0.136	505.141	2
443	0.165	695.239	2
444	0.196	761.261	2
445	0.157	755.190	2
446	0.641	657.156	2
447	0.038	352.920	2
448	0.255	711.121	2
449	0.300	607.576	2
450	0.205	369.569	2
451	0.107	556.545	2
452	0.360	639.904	2
453	0.363	618.348	2
454	0.303	658.846	2
455	0.185	575.267	2
456	0.032	339.453	2
457	0.280	590.763	2
458	0.149	591.701	2
459	0.177	758.639	2
460	0.119	641.067	2
461	0.177	762.849	2
462	0.375	634.485	2
463	0.167	584.907	2
464	0.024	396.263	2
465	0.146	571.066	2
466	0.115	606.048	2
467	0.214	648.057	2
468	0.177	831.896	2
469	0.237	688.831	2
470	0.273	603.036	2
471	0.026	351.520	2
472	0.020	357.425	2
473	0.086	347.290	2
474	0.395	529.865	2
475	0.265	720.058	2
476	0.234	601.257	2
477	0.034	362.979	2
478	0.273	719.616	2
479	0.517	640.127	2
480	0.212	667.723	2
481	0.311	673.893	2
482	0.237	554.999	2
483	0.104	374.368	2
484	0.156	640.177	2
485	0.221	591.468	2
486	0.596	638.219	2
487	0.196	675.064	2
488	0.724	623.007	2
489	0.191	558.283	2
490	0.245	458.986	2
491	0.210	644.049	2
492	0.855	565.024	2
493	0.115	428.481	2
494	0.057	359.814	2
495	0.174	432.584	2
496	0.043	341.107	2
497	0.269	739.454	2
498	0.316	649.145	2
499	0.179	482.845	2
500	0.234	543.942	2
501	0.158	390.494	2
502	0.134	482.591	2

---------------------------------------------------------------------------------------

Information about your version of Java - this information is useful for the Fiji developers:
  os.arch => amd64
  os.name => Windows 7
  os.version => 6.1
  java.version => 1.6.0_16
  java.vendor => Sun Microsystems Inc.
  java.runtime.name => Java(TM) SE Runtime Environment
  java.runtime.version => 1.6.0_16-b01
  java.vm.name => Java HotSpot(TM) 64-Bit Server VM
  java.vm.version => 14.2-b01
  java.vm.vendor => Sun Microsystems Inc.
  java.vm.info => mixed mode
  java.awt.graphicsenv => sun.awt.Win32GraphicsEnvironment
  java.specification.name => Java Platform API Specification
  java.specification.version => 1.6
  sun.cpu.endian => little
  sun.desktop => windows
  file.separator => \
Comment 1 G. Landini 2009-12-20 12:04:42 CST
This does not seem to be a bug, but a buggy macro.
Perhaps what you want to do is this? (the file saving is missing, but you can add it at the end)
Assuming that your image is called "test" and has 3 slices:


run("Duplicate...", "title=test-1 duplicate range=1-3");
setAutoThreshold("Triangle dark");
run("Convert to Mask", "  black");
run("Set Measurements...", "area mean redirect=test decimal=3");
run("Analyze Particles...", "size=100-Infinity circularity=0.00-1.00 show=Nothing display clear stack");