Created
October 12, 2022 18:52
-
-
Save mutterer/f6a522950fbf4c492242548d4d521b07 to your computer and use it in GitHub Desktop.
toggles between inches and mm for images from flatbed scanner
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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