Stax


Contents:


Starting the program


To launch the program open a terminal window and navigate to the "staxSourceCode" directory, then type


java -jar -Xmx350MB stax.jar &


The -Xmx option allocates more than the default memory to this java application. The more memory you allocate, the larger the stacks you can process and the faaster the program works


The first thing you see will be a file dialog asking you to "Pick the red file".  This means to load up one of a maximum three confocal stacks.  Calling it the "red" file does not mean you have to render that channel in red, unless you want to (which is the default).  Using the file dialog, navigate to a confocal experiment directory and select one of the "...raw0x.pic" files.  The file dialog immediately comes back and asks you for the "green" file.  Again, you will have the opportunity to change the colors.  If you want to work with just a single channel, pick the same file as you did for the red channel; otherwise, choose the next "...raw0x.pic file.  Again the dialog returns and asks for the "blue" file.  If you don't want to load a third channel just re-load one of the others.


You can load a new set by choosing "File->load new triad of files...". If you do not have any BioRad pic format files, three are available to download and practice on from the website from which you downloaded stax.


Moving in stacks


After a short delay the program will bring up four windows, one of which displays the middle image in the stack, in RGB color (had you loaded a single file three times it would appear to be in gray-scale).  At the top of the window is a slider that lets you drag through the stack.  To the right is a panel of navigation buttons.  The "-section" and "+section" do the obvious.  Use "jump back" or "jump ahead" to move some number of sections either way; the number is set in the box labeled "jump-->".  Below that are movie controls.  Clicking "<-movie" or "movie->" starts flipping through the sections at the frame-rate specified in the "fps=" box.  On slower computers this does not go faster than a couple frames per second at present because the program does not keep stacks in memory.  The other controls in this panel are either obvious or I don't yet know what they do.


To save frames for a fly-through movie, choose your color scheme (see below) and choose "File->write images in stack to jpg movie files to local disk"


Choosing colors


On the left the first panel lets you choose colors and which channels to display.  In the first place, by default the program displays your data in RGB.  You can use artistic color choices by clicking the button in the middle of the panel that says "Using RGB standard primaries".  As with most things in this program, it is a toggle, and its label indicates what the program is currently set to do.


At the top there is an editable 3x3 matrix; the rows mean, what is the maximum RGB value for each channel.  That is, if you type (0, 185, 255) into the top row, and the click "set red" and confirm the color choice by clicking on one of the corners, you will see the "red" channel in bluish-cyan.  If you want to pick colors quickly and try out lots, click on the "set red", "set green" or "set blue" buttons; click in the circle to choose a hue and then adjust the position in the triangle to set saturation and brightness, and then click in a corner to update the display. To use these so-called 'art colors' click the big toggle button labeled 'Using RGB primaries. Push to toggle'.


If it so happens that you only want to work with two channels, say, then you should choose not to display the third; click "blue off", for example.  Likewise if you want to work with just one channel.  If you click "red only" or "green only" or "blue only" you have the choice of displaying the data in gray-scale instead of either RGB or art colors; click "gray toggle".  To get back all three channels click the button "all 3 colors".


The rLUT, gLUT, and bLUT buttons bring up editable graphs of look up tables for the three color channels. After clicking the rLUT button, for example, you can click a sequence of points in the graph, proceeding always left to right, to draw a new piecewise linear curve. Both axes run from 0 to the 255 max displayable brightness. The horizontal axis is the intensity of data pixels and the vertical axis is the brightness at which the pixel is displayed. The buttons such as 'red only', 'red off', etc control which of the three channels appear in the drawing window. If a color change you make does not appear immediately, push the 'redraw' button. Once you find a combination of colors you like, use the top menu called 'colors to/from files' to save (and later recover) them in files whose names you make up. This feature of saving and recovering information is common to many panels in the stax program.


Stereo3DReconstructions


There are so many controls in this panel I will go through them glossary-style.


start/stop section : these tell the program the end-points of a subset of the stack that you wish to project.  The first section is #0.  This makes a difference because the ray-tracing is asymmetric, so you have to think about what side you want to appear to be in front when the stereo pair is viewed.


depth cueing : the two numbers determine how much to progressively attenuate the maximum value in the image as you proceed through the stack.  Thus if you choose 255 for the first section and 220 for the last section, the last section will be about 85% as bright as the first, assuming they started out equivalent.


blend fraction : this number determines the relative contribution of the ray-traced versus maximum-projected image.  Somewhere between 0.4 and 0.8 seems to give the best results.


red/green/blue channel transparency : the number refers to the proclivity of voxels at one height to occlude voxels at another.  "255" means everything is transparent, in which case nothing would show up.


red/green/blue boost : this number tells the program by what factor to amplify or attenuate the different channels to balance brightness.


do seg1, etc. : if you so desire, the program will make a movie that has up to four segments with different balance of channel brightness.  To accomplish this you must click the toggles (which by default say "omit seg2", for example) and give numbers for the boosts in each segment.  A nice thing to do, for example, is to have the first segment have all 1.0's, the next have one channel high (1.0 or a little more) and the others low (0.4-0.6), etc.  If you have rendered a stereo pair, you can check what the balance will look like in each segment by clicking "next seg" and then clicking "params from 'Projections'" in the stereo pair display window (see below)


save reverse order movie frames : when making a movie the program generates the appropriate-numbered frames so that a single play through will appear to go forth and back.  Click to change.  Note that this costs no CPU time.


blend max projection with ray-traced projection : the program can generate both a maximum projection, analogous to what ImageJ or LaserSharp make, or a fancier ray-traced image.  The "blendFraction" number determines the contribution of each.  But if you click this button the other options are to generate just the maximum projection, or just the ray-traced image.


cross eyes : for cross-eyed viewing (although this is subtle... see below); the alternative, of course is "diverge eyes".


include red/green/blue channel : these buttons select which channels to render.  If you click one it switches to "omit..." Note that choosing not to display the channel is separate, and controlled in the Pick Colors panel.


make single stereo pair : clicking this button causes the program to render, with the options currently set, a single stereo pair.  Use this to test out your blend, colors, separation angle, etc.


make stereo pair movie : starts the rendering of the movies frames, which takes a long time.  After the first pair is rendered the program will ask you where to save the files.  TO CANCEL A RENDER you must click the "cancel movie" button; you may have to wait until it finishes the current frame.


movie rotates stereo pairs / movie rotates single view : stereo pairs take a lot of screen space for a given level of detail, and it is impractical to make a projection movie at full resolution for most stacks.  To get the best detail you may want to make a rotation of just a single projection, which is what this toggle lets you do.


eye separation angle : sets the amount of angular separation between the two images in the stereo pair.  This is not actually the angle in degrees, however, unless your sections are about 10 times as far apart as your pixels are wide.  Most of my data consists of stacks in which the sections are 0.5 microns apart and the pixels are 0.13 microns wide, and the appropriate value here is about 2.


depthParam : larger/smaller values put more/less space between sections making the reconstruction look deeper/shallower. 


# movie frames, angle between movie frames : pretty obvious; I find that the characteristic defects of this projection method become intolerable beyond about 10 degrees on either side of center.  Furthermore I find a >2 degree angle between frames much too jumpy to be of any use.  Try 15 frames 1 degree apart.


movie frame scale factor : determines how much to shrink the rendered frames.  This is essential if you are going to make a QuickTime movie that has any chance of playing smoothly at all.


read parameters from disk / write parameters to disk : once you've found a set of projection parameters that you like, you can save them in a file, which you can re-load next time you use the program.


Stereo pair display


If you click "make single stereo pair" in the Projections window, the program will do just that.  In the window that displays the stereo pair there are several controls; the important ones are that you can change the scaling and the blend fraction and whether you have a crossed-eyes or diverged-eyes pair.  Clicking "swap eyes" just trades the two images.  Note that in the current version, whether through a quirk in the new OS X java or whatever, the display may not update until you do something to force it, such as slightly resizing the window.


You may change the blend fraction, then click "newBlendFrac..."; again you may need to force re-display by tweaking the window size.  Likewise for the scale.


If you change these same parameters in the "Projections" window, you can update the stereo pair display by clicking "params from 'Projections'" in the lower right corner of the stereo pair display window, and you can similarly transport new values to the Projections window with the "params to 'Projections'" button.  This is also how you get the different segments' settings to apply to the display.


Known problems: 

• windows don't always re-draw or update correctly on OS X with the new java runtime environment.  

• Buttons look a little cramped when windows first come up, but you can just resize the windows.