To use a scale bar sensibly in Amira, you need to

  1. Switch to orthographic projection (ie where the cube looks like a cube and the scene does not have a vanishing point)
  2. Add a 2D measurement
    1. try to get it as horizontal as possible but you can fix this up later
    2. get the width that you want +/- 0.1 micron
  3. save the camera status (especially zoom)
  4. Save a simple network to get some tcl code to play with or edit what's below

The key bit in this code is:

Measurement $tmp point 0 0.607430 0.301837 0.000000
Measurement $tmp point 1 0.837349 0.301837 0.000000

Don't believe the number of microns that is displayed - zoom in and out and it should change.

# add scale bar
set hideNewModules 0
dso open hxmeasure
create HxMeasureTools Measurement
Measurement setIconPosition 511 78
Measurement fire
Measurement clearElems
set tmp [ Measurement addLine 2D ]
Measurement $tmp init
Measurement $tmp point 0 0.607430 0.301837 0.000000
Measurement $tmp point 1 0.837349 0.301837 0.000000
Measurement $tmp drawText 0
Measurement $tmp drawTicks 1
Measurement $tmp name {2D Length}
Measurement $tmp format {100}
Measurement $tmp color 1.000000 1.000000 1.000000
Measurement $tmp pointSize 1.000000
Measurement $tmp fontSize 14.000000
Measurement $tmp locked 0
Measurement $tmp noDepthTest 0
Measurement $tmp visible 1
Measurement $tmp viewerId 0
Measurement $tmp useSpecialValue 0
Measurement $tmp specialValue 0.000000
Measurement fire
Measurement setViewerMask 65535
Measurement select
Measurement setPickable 1

Note that tcl commands like Measurement $tmp drawText 0 only work on Amira versions >5.2

Using it - be sure to use the same camera definition!

proc frontalView { } {
	viewer setCameraOrientation 0.961736 0.150452 0.228973 2.40614
	viewer setCameraPosition 177.847 -14.2337 -92.4693
	viewer setCameraFocalDistance 201.708
	viewer setCameraNearDistance 46.8413
	viewer setCameraFarDistance 319.4
	viewer setCameraType orthographic
	viewer setCameraHeight 166.698
}

frontalView
Measurement tool0 visible 1
viewer snapshot ${snapshotsFolder}PLoblique_mPNs+fru_with50umbar.png
Measurement tool0 visible 0
viewer snapshot ${snapshotsFolder}PLoblique_mPNs+fru.png

Log In