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 1067 - microns are shown as µm x um in the image view!
microns are shown as µm x um in the image view!
Status: RESOLVED FIXED
Product: ImageJ
Classification: Unclassified
Component: Common
unspecified
All Windows
: P5 trivial
Assigned To: Wayne Rasband
Depends on:
Blocks:
 
Reported: 2015-05-11 04:54 CDT by Christoph Derigo
Modified: 2015-05-11 16:54 CDT
2 users (show)

See Also:

Description Christoph Derigo 2015-05-11 04:54:40 CDT
In Calibration.java if one looks at function setUnit ( or setXUnit ) the unit gets sanintized! => if you call it with "um" it changes into "µm"

BUT: for setYUnit and setZUnit this is not done!
SUGGESTED BUGFIX:

private static String sanitizeUnit( String unit ) 
{
    if (unit==null || unit.equals("")) {
	return "pixel";
    } else {
	if (unit.equals("um")) return "\u00B5m";
		return unit;
    }
}
	
/** Sets the default length unit (e.g. "mm", "inch"). */
public void setUnit(String unit) {
 	this.unit = sanitizeUnit( unit );
 	units = null;
}
 	
/** Sets the X length unit. */
public void setXUnit(String unit) {
	setUnit(unit);
}

/** Sets the Y length unit. */
public void setYUnit(String unit) {
        yunit = sanitizeUnit( unit );
}

/** Sets the Z length unit. */
public void setZUnit(String unit) {
 	zunit = sanitizeUnit( unit );
}
Comment 1 Mark Hiner 2015-05-11 10:42:59 CDT
Hi Wayne - I changed the assignee to you since this is an ij.measure class[1].

Thanks, Christoph, for the detailed report with suggested fix.

[1] https://github.com/imagej/ImageJA/blob/v1.49s/src/main/java/ij/measure/Calibration.java#L100-108
Comment 2 Wayne Rasband 2015-05-11 16:54:21 CDT
Christoph's suggested fix for this bug is in the latest ImageJ daily build (1.49t20).