Skip to content

Instantly share code, notes, and snippets.

@mutterer
Created June 26, 2020 13:06
Show Gist options
  • Save mutterer/5fc71706fd095ef90026a38ab6da6f89 to your computer and use it in GitHub Desktop.
Save mutterer/5fc71706fd095ef90026a38ab6da6f89 to your computer and use it in GitHub Desktop.
ImageJ macro that reads calibration from "AMT Camera System" image metadata and applies it to the current image.
List.setList( getMetadata( "Info" ) );
desc = List.get( "ImageDescription" );
if( desc.indexOf( "AMT" )< 0 ) {
print( "Not an AMT image file" );
exit( );
}
unit = List.get( "Unit" );
cal = List.get( "XpixCal" );
cal = parseFloat( cal.replace( ',', '.' ) );
setVoxelSize( 1 / cal, 1 / cal, 1, unit );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment