To get a general introduction to nvm, try running the test scrip:
cd NVM/SegMentor/Test/data
./test1
This will launch nvm using example data. You then need to run SegMentor and
open a test script. Press the SegMentor button,
,
just above the tool pallet. Then, in the SegMentor window, choose the "File:Open"
menu, click on the "Test" directory, and then choose the file, "test.11_10.xml".
Then press "Ok" to load the script.
The SegMentor window will display short text messages that will tell you what is going on. When you press "Enter" or the "a" key (meaning "advance"), the script will execute its next set of commands. These commands control nvm or else display text in the SegMentor window.
Right-click once in the background of the main nvm window to select it so that it will receive keypresses and then press "Enter" (or "a"). The script will adjust the brightness and contrast of the displayed grayscale data. Press Enter again to see another brightness/contrast adjustment, and then press Enter a couple times for more settings. The normal way of adjusting brightness and contrast is to click and drag the middle mouse button in a brain image. Keep the mouse in the image and let go when it looks good to you. Drag up to increase brightness and right to increase contrast (this can be switched in the Preferences).
After pressing Enter enough times, you'll get to the "TODO" message. This is a place holder that describes extra things that this test script should do. NVM is a work in progress, feel free to help out! Press Enter another time to go on to other features. The script will take you through most of the main features of nvm. The sections below follow and explain the script and also points out how to do the same things manually.
The test script will open the Tile Window. Normally, you can show the Tile Window by choosing the "Windows:Tile Window" menu. This will show you most or all slices of the scan. Click with the middle mouse button and drag it to push the window contents around so you can see all slices.
Next, the test script changes the contour color (look at the row of colors
above the main image). The Contour Tool is one of the basic tools in nvm.
It allows you to create iso-intensity contours in the image. These are very
helpful when segmenting (drawing outlines around) neuroanatomical structures.
Different color contours can be used to make segmentation easier. Press Enter
to have the script switch to various colors. You can see the effect of this
change by selecting (left-click on) the Contour Tool,
,
and by left-clicking in the image. Iso-intensity contours will be drawn all
over the image using the intensity of the voxel you choose by your click.
You can change contour colors by clicking on a color. Contours of
different colors stay on the screen at the same time. You can press "x" to
erase the current contour color and "X" to erase all contours (press
the key with the mouse over the image).
Press Enter to let the script choose different tools from the tool pallet. If you have not changed the selected tool (by choosing the Contour Tool above) then the Arrow tool is currently selected. The Arrow Tool is used to select things for editing. The script then selects the Contour, Draw, Erase, and other tools. When the Label Tool is selected, a window appears that lets you choose a label to assign to a neuroanatomical structure. Move this window out of the way (the main window must be selected and the mouse must be over the image before it will accept keypresses).
In the upper left corner of the main nvm window (just below the menu bar) there is a box which shows the current "Segmenter Prefix". The test script will change this prefix. This prefix can be a name or operator initials and is used to identify segmentation result files that are saved to disk. This lets you keep track of who did what or can be used to distinguish different kinds of segmentation of the same neuroanatomical structures.
Press Enter and the script will load outlines for this slice. Move the mouse around (without pressing any button) and the display at the top will show you the label assigned to the outlines (outlines are green). Segmentation results are saved to disk as "Outline" files. In nvm, "Contours" are created and edited and then "extracted" (by pressing "e") to become "Outlines". Contours can be drawn and erased, while Outlines are the finished product and can be labeled. You can load previously created outlines for this slice of this brain scan by pressing the "load otl" button. Press Enter a few times to have the script save outlines and then load all outlines for this scan. To see that all outlines have been loaded, move the mouse over the sagittal or axial images -- the display on top should tell you the name of the structure under the mouse. You can press "R" to show outlines in these images (and "R" again to hide them). When the outlines are showing, try pressing "T". This will show the outlines in filled colors. Press "T" again to hide these colors.
Press Enter again and the script will test to see if saving outline files under a different segmenter prefix creates files with exactly the same content as the originally loaded files. This can take a little time.
Press Enter two more times and the script will show and hide the red "Projection Lines". These show you the locations of the slices seen in the other two images (sagittal on top and axial below that). When you scroll those images to different slices, the projection lines move.
Press Enter again and the script will show and hide Landmarks. Landmarks show up here as yellow cross-hairs. These are 3D positions in the scan and are used for positional normalization, cropping, and for warping one scan onto another.
You can hide and show projection lines and landmarks by clicking on their icons in the upper left corner of any image.
The next commands in the script test the ability to extract Contours into Outlines. The script uses the Contour Tool to create iso-intensity contours in two colors (at the same intensity) and then to extract a small region into an outline. Only yellow contours appear because the red ones are hidden by they yellow (since they are at the same locations). The white region is a selected outline. Whenever outlines are first extracted (by placing the mouse inside them and pressing "e"), they are automatically selected.
Press Enter and the script tests the Eraser Tool. Note that red appears where the Eraser was dragged and that the Eraser Tool has been selected. The red contour was created with the same intensity as the yellow contour so red shows up when yellow is erased.
Press Enter and the script will test some of the more advanced extraction capabilities of nvm. The result is two extracted outlines with the top one selected (white). Press Enter and the last-extracted outline (the selected one) is deleted leaving a yellow contour. Press Enter again and the script will delete the green outline leaving a red contour (since the red contour color was just selected). Press Enter to see how "x" deletes only the current contour color and then again to see the "X" deletes all colors (in this case, it deletes the only other contour which is yellow).
Press Enter to begin a series of tests involving selecting outlines and contours using the Arrow Tool. Two outlines have been extracted and the last one is still selected. Press Enter to have the script select the other one. You can select contours and outlines by clicking on them using the Arrow Tool. Press Enter a few more times. "Promoting" a contour is done by selecting one and then pressing "v". The "Ignored contour" colors are the three colors on the right of the color bar. These are used to designate locations in the brain and are ignored during extraction. For example, ignored contour lines can be drawn in an axial slice and will show up in the coronal slice and can be used as an anatomical reference location. By doing this, you can use information that is only visible in orthogonal image plains. "Demoting" a contour is done by selecting it and pressing "V". Contours and outlines can be shown or hidden using key commands. See the Keyboard Shortcuts for more information. Press Enter some more for some additional tests (yes, some of these are redundant). The final test in this section is to double-click with the right mouse. This changes the slices that are displayed in the other images. Note how the projection lines have moved in the central image to show the new slice locations.
The next series of tests involve the Histogram Tool. Press Enter and the Histogram window will appear and the script will simulate a click somewhere in the image. Since there are no outlines in the image, the histogram will be taken over the entire image. The image window will appear white everywhere to show where the histogram was taken. Press Enter again to remove this white coloring. After the histogram window opens, it will have the keyboard focus so click on the main nvm window to change the focus back. Now when you press Enter, the script should go on. You can manually clear the histogram region by clicking on the button in the Histogram window or by pressing "c" when that window has the keyboard focus.
Press Enter again and the script will change the scale of the data shown in the histogram window. You can do this manually by clicking on the histogram with the rightmost mouse button, dragging, and releasing it. This allows you to zoom in on a range of intensities. The script then sets the maximum range by pressing the "Set Full Intensity Range" button in the Histogram window. Press Enter again and the script will simulate clicking with the middle button on one peak in the histogram, dragging to another, and then releasing. This causes a contour to be created at the intensity midway between these peaks. You can also left-click on the histogram to create an iso-intensity contour at that intensity.
Press Enter again and the script will demonstrate how to take histograms inside outlines. You first extract a closed contour into an outline (by pressing "e") and then select the histogram tool and click inside that outline. If you shift-click inside another outline, it will add that region to the histogram. Normally, the histogram is cleared when a new histogram is taken. Note that the first region is shown in green when the second histogram is taken.
The Label Tool is used to assign a text label to an outline. The script extracts two outlines and labels one. Put the mouse over the two outlines to see that one is labeled and one is not. You can change the label by clicking on the chooser in the Outline Label window. If an outline is selected this will change it's label. Once a label is chosen, you can click on an outline to set that outline's label. The script also tests the Label Tool's review ability: by pressing the "Next" and "Previous" buttons, the Label Tool will select each outline and show you it's label. The script "turns on colors" by pressing "T" to show the labeled outlines using filled colors. Press Enter a few more times for other tests.
Press Enter to open the AutoContour window. This window shows a list of named intensities that can be assigned to contours. For example, the window shows "Exterior" which has an intensity of 1251. When you click on "Exterior:1251" it draws a contour at that intensity in the current slice. Press Enter to see the script test this. The script has turned on the display of contours in the sagittal slice so you can also see the red contours appear there. If you click on a choice widget in the column labeled "contour", you can choose a contour to "attach". Press Enter to see the script test this. The red square that appeared means that when you change slices in the main image, this Exterior contour will be drawn in red. Press Enter to see this tested. Note that green outlines also appear. This is because the outlines were loaded for the entire scan and were deleted during previous tests only for the current slice. If you click on the column labeled "Current" for the Exterior, you can change this intensity by typing a new value. Press Enter to see this happen, and then again to see a new slice with this new intensity.
The purpose of the AutoContour tool is to allow you to assign an intensity to a contour color that will be drawn every time you change slices. These AutoContours can have initial values and also intensity values that are associated with particular slices. When you set a different intensity value for different slices, the intensity used for that AutoContour between those slices is interpolated between the set values. Slices that are beyond set slices use the nearest set slice. Press Enter too set slice 20 with a intensity of 1200 and press Enter again to go to slice 30. Since slice 40 was set to 1500, this slice should have an iso-intensity contour drawn with an intensity of 1350. The green display text at the top of the main nvm window should report this. The sagittal image shows you where the different coronal slices appear. Press Enter again to see slice 25. Press Enter again to see what happens at slice 10 -- it matches the intensity set for slice 20. Press Enter two more times to see what happens when the red contour is unassigned to the Exterior. No contour is created if all AutoContours are off. Press Enter again, but don't save the AutoContour file because it has been modified.
Next, the script tests to see what happens when one of the two set slices is reverted back to it's original value (1251). Press Enter to see that when only a single slice is set to an intensity, that AutoContour will use that set value for all slices.
The next commands show how the SegMentor script can have buttons that control the script's execution. Press the "Do Thing" button in the SegMentor window. This make the script branch to a different path. Press Enter and it will go back, then Enter again and it will skip the branch and get rid of the button.
The final commands in the script test some zooming abilities.