Skip to content

Instantly share code, notes, and snippets.

@mutterer
Created October 12, 2022 18:52
Show Gist options
  • Save mutterer/f6a522950fbf4c492242548d4d521b07 to your computer and use it in GitHub Desktop.
Save mutterer/f6a522950fbf4c492242548d4d521b07 to your computer and use it in GitHub Desktop.
toggles between inches and mm for images from flatbed scanner
macro "inches_mm_toggle Action Tool - C000T0608iT3608nT8f08mTef08mL0dd0" {
getVoxelSize(width, height, depth, unit);
if (unit.startsWith("inch")) {
width=width*25.4;
height=height*25.4;
depth=depth*25.4;
unit = "mm";
} else if (unit.startsWith("mm")) {
width=width/25.4;
height=height/25.4;
depth=depth/25.4;
unit = "inches";
}
setVoxelSize(width, height, depth, unit);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment