imagej / ImageJ

Public domain software for processing and analyzing scientific images
http://imagej.org
Other
513 stars 218 forks source link

In macros, List.get("Mean"), List.get("StdDev"), etc. return string instead of float when the value is 0 #161

Closed Sethur closed 2 years ago

Sethur commented 2 years ago

Testing Environment:

Issue When using

List.setMeasurements();
meanVal = List.get("Mean");
stdVal = List.get("StdDev");

on a ROI that only contains 0 in a 16-bit DICOM, meanVal and stdVal are of type string and contain "0.0" instead of the respective float number.

rasband commented 2 years ago

Use List.getValue() instead of List.get().

  List.setMeasurements();
  mean = List.getValue("Mean");
  std = List.getValue("StdDev");
  print("mean: "+mean);
  print("std: "+std);