Differences between revisions 16 and 17
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
||Up to ScubaGuide||Back to [:ScubaGuide/ScubaWorkingWithData: ScubaWorkingWithData]||Continue to [:ScubaGuide/ScubaWorkingWithData/ScubaVolumeROIs: ScubaVolumeROIs]|| ||Up to ScubaGuide||Back to [[ScubaGuide/ScubaWorkingWithData| ScubaWorkingWithData]]||Continue to [[ScubaGuide/ScubaWorkingWithData/ScubaVolumeROIs| ScubaVolumeROIs]]||
Line 33: Line 33:
For example, this line sets the brightness to 0.5 and the contrast to 20. For additonal options you can pass in on the command line, see the ["scuba"] page for command line reference. For example, this line sets the brightness to 0.5 and the contrast to 20. For additonal options you can pass in on the command line, see the [[scuba]] page for command line reference.
Line 93: Line 93:
attachment:scuba_grayscale.jpg {{attachment:scuba_grayscale.jpg}}
Line 99: Line 99:
Volume editing is done with the Voxel Editing tool, which is the attachment:icon_edit_volume.gif, and the Voxel Filling tool, which is the attachment:icon_fill_volume.gif. The options for these tools are in the Tools panel. Volume editing is done with the Voxel Editing tool, which is the {{attachment:icon_edit_volume.gif}}, and the Voxel Filling tool, which is the {{attachment:icon_fill_volume.gif}}. The options for these tools are in the Tools panel.
Line 129: Line 129:
 '''Stop at paths''': You can use the path tool, attachment:icon_draw_line.gif, too draw paths that you can use as filling boundaries if this option is checked. The fill will not cross a path.  '''Stop at paths''': You can use the path tool, {{attachment:icon_draw_line.gif}}, too draw paths that you can use as filling boundaries if this option is checked. The fill will not cross a path.

Up to ScubaGuide

Back to ScubaWorkingWithData

Continue to ScubaVolumeROIs

Anatomical Volumes

Scuba can view multiple anatomical volumes and show them composited in the same space, each with different opacity and thresholding options. Volumes can be treated as anatomical, meaning they are drawn in grayscale, as segmentations, drawn with a color table and each voxel treated as an anatomical labelling, or functional, drawn with a heatscale and with special thresholding options. This section deals with options and controls relating to anatomical volumes, which also generally apply to the other volume types.

Loading Volumes

You can load a volume from the command line or from within the program. From the command line, use the -v option:

scuba -v FILENAME

If you have the SUBJECTS_DIR variable defined, you can use the -s option to declare a subject, and scuba will search for any file names passed to -v in the subject's mri/ directory. These are equivalent:

setenv SUBJECTS_DIR /home/myname/subjects
scuba -s bert -v T1.mgz

scuba -v /home/myname/subjects/bert/mri/T1.mgz

cd /home/myname/subjects/bert/mri
scuba -v T1.mgz

You can also pass in additional options to configure the layer that the volume will be displayed it, e.g.:

scuba -v T1.mgz:brightness=0.5:contrast=20

For example, this line sets the brightness to 0.5 and the contrast to 20. For additonal options you can pass in on the command line, see the scuba page for command line reference.

Alternatively, you can use the File->Load Volume... menu command from within the program to use a standard dialog box to load a volume. Note that this dialog box also has an option labeled, Automatically add new layer to all views. This is enabled by default. If checked, the layer that will display this volume will be added in the next empty slot to all existing views. This is probably what you want to happen, unless you specially want to exclude this volume from certain views.

To scroll through your loaded volume, use the 'Page Up' and 'Page Down' keys on your keyboard.

Display Options

Like other layer types and data collections, display options for anatomical volumes in the Layers panel, and settings for transforms are in the Data panel. Some settings may be disabled if they do not apply to the current mode.

In the Layers panel, you can configure the following things:

  • Layer: This pull-down menu will let you select the layer to configure.

    Name: This editable field lets you change the name of the layer. Initially, the names of the layers are the same as the data collections they are drawing. You don't have to set or change the name, but it may help if you wish to distinguish multiple layers.

    Opacity: Use the opacity slider to change the opacity of this layer, from transparent to fully opaque.

    Color Map: These buttons configure how the layer translates volume values into colors.

    • Grayscale: This will display volumes in grayscale from dark for low values to bright for high values. This is appropriate for anatomical scans.

      Heat scale: The volume values will be drawn. You can use the Heat Scale Min, Mid, and Max fields can be used to configure the heat scale. This is appropriate for functional activation volumes.

      LUT: The volume will be drawn using a look up table. For each value in the volume, an entry in the look up table will specify the color to be used, as well as an anatomical label to be displayed in the label area. This is appropriate for anatomical segmentation volumes.

    LUT: This chooses the LUT to be used if the LUT value is chosen for the Color Map option. You can load additional LUTs from the File menu, and set their names in the Color LUTs panel.

    Draw 0 values clear: Normally, the value of 0 is drawn in whatever is appropriate for the current color map. This checkbox will make all 0 values transparent. It's useful for overlay volumes.

    Interpolation method: These buttons set the kind of interpolation used when drawing the volume. The following options are available:

    • Nearest: This rounds volume coordinates to the nearest integer and samples the volume at that point. This is the quickest method, but it looks blocky.

      Trilinear: This option uses trilinear sampling.

      Sinc: This option is the slowest, but the nicest looking interpolation.

    Brightness, Contrast: Sets the brightness and contrast, applicable only to grayscale volumes. This shapes the sinusoidal curve that controls grayscale level adjustment within the range determined by the window and level.

    Window, Level: Sets the grayscale level and window. This is used in configuring the range of the brightness and contrast curve. This can also be set by clicking and dragging if you hold down the shift key and drag with mouse button 1.

    Min, Max: Sets the minimum and maximum visible values for volume display. Values below the the minimum value and above the maximum value will not be drawn, so those voxels will be transparent.

    Heat Scale: The Min, Mid, and Max values configure the heat scale display. The heat scale is a piecewise linear threshold with two segments: the first from Min to Mid and the second from Mid to Max.

    Frame: In a multi-frame volume, this sets the frame to be currently displayed. Disabled if there is only one frame in the volume.

    Editable ROI: By default, ROIs belonging to this collection are editable with the ROI tools. Uncheck this option to lock the ROIs to keep them from being edited.

    ROI Opacity: This is the translucency for the ROIs associated with the data collection the layer is drawing, which can be controlled separately from the layer opacity.

You can also set display transforms and data transforms that may affect the display of the volume, from the View and Data panels, respectively.

Grayscale Display

There are several factors that control the grayscale display. The Visible Min and Max control the lowest and highest values that are drawn. Values outside of this range are drawn with intensity 0, and will be translucent if the Draw Zero Values Clear options is on. The Window and Level control the range of values that are mapped to intensities within the Visible range. The Level defines the midpoint, and the Window defines the extent; the darkest value is (Level - (Window/2)) and the brightest value is (Level + (Window/2)). Finally, the Brightness and Contrast define a sigmoid curve inside the visible range to further tweak the intensities. Brightness controls the offset of the curve, bringing it closer to the end of the range defined by the Level and Window. The Contrast defines the sharpness of the curve; a low contrast looks like a straight line, a middle Contrast looks like an S curve, and a high contrast looks more like a stepwise function.

This diagram may help:


Additionally, here is the code to build the lookup table. ScubaGrayscaleCode

Voxel Editing

Volume editing is done with the Voxel Editing tool, which is the icon_edit_volume.gif, and the Voxel Filling tool, which is the icon_fill_volume.gif. The options for these tools are in the Tools panel.

  • Target Layer: This sets the layer that changes will be made to. It's very important to check the target layer when making edits, as it can be difficult to tell which layer you are editing if your layers are similar.

    Brush Options: This sets the shape of your brush. Voxel will paint just a single voxel, while Circle and Square will use the Radius setting to draw with shaped brush.

    Radius: This slider sets the size of the Circle and Square brushes. The radius is in millimeters, in world space.

    Only brush zero values: This limits the voxels that can be edited to only those with 0 values. This is useful for editing segmentation values, as it prevents already edited voxels from being re-edited.

    New Value: This is the value that will be painted when using the middle mouse button. You can set it numerically, or, if the volume is a segmentation volume, use the label values in the list below.

    LUT: This is the source of the available label values that you can use for the new value if the volume being edited is a segmentation volume. Beneath this is a list of values in the LUT selected. Click on an entry in the list to set the New Value from the LUT entry.

    • Sort: The LUT entry table can be sorted with the Table option, to use the order from the LUT file, or with the User option, that only shows the entries clicked by the user. The User list can be used to build a list of custom entries, which is useful if your LUT is long and you only want to see a limited selection of entries. Just switch to Table mode, click on the entries you wish to use, and then switch to User mode to see only those entries.

      Clear User List: Use this button to clear the list of entries displayed when the list is in User mode.

    Erase Value: This will set the value drawn when the right mouse button is used. By default, it sets voxels to 0. In the case of a segmentation volume, this erases the segmentation label.

Additionally, if you hold down the shift key while the editing tool is active, you will see a line stretch from the last clicked point to the mouse. If you middle or right click with the shift key still held down, scuba will brush that line with the value corresponding to the mouse button you clicked. You can use this to brush straight lines.

Voxel Filling

Selecting the Voxel Filling tool will show a different set of options in the Tools panel. The filling algorithm starts at a seed point and fills adjacent voxels that are similar to the seed voxel. The degree of similarity is what can be configured with the filling options.

  • Source Data: This selects the data collection to use as source data for the fills. This is the data that the filling algorithm is looking at when finding adjacent voxels to be filled. This can be the same volume as the target layer, for example if you are drawing anatomical ROIs on to that anatomical volume, or can be different, for example if you are filling values in a segmentation volume based on an anatomical volume.

    Stop at other ROIs: This option is not relevant for voxel filling.

    Stop at paths: You can use the path tool, icon_draw_line.gif, too draw paths that you can use as filling boundaries if this option is checked. The fill will not cross a path.

    Fuzziness: This controls the numerical measure of similarity when filling. For an adjacent voxel to be filled, the difference of the value of that voxel must be within the fuzziness. A fuzziness of 0 will fill any voxel.

    Max Distance: This is the maximum distance in millimeters that the fill will expand from the seed point. You can use this to fill small areas at a time.

    Fuzziness Type: This controls the value that an adjacent voxel value is compared to when assessing similarity with the fuzziness value. With the Seed option, it will be compared to the value of the voxel that was clicked to start the fill. With the Gradient, it will be compared to voxel that was just filled. This lets you fill regions whose overall intensity varies over distance.

    Work in 3D: Normally, fills are only done inplane, but this option will let the fill go in 3D. Use this option carefully, as it can be difficult to see the full extent of the fill unless you are in a multiple views mode, looking at different orientations.

    Only fill zero values: With this option checked, only voxels whose values are 0 will be filled.

It also contains the same New Value and LUT list as the Voxel Editing tool. See the above section for details.

Undoing Edits

Note that all edits and fills are undoable with the File->Undo command. All undone actions are then redoable in a stacking fashion.

Saving Volumes

After your careful edits, you will want to save your volume. If using multiple data collections, first make sure it is the currently selected data collection. To do this, go into the Data panel and select your volume from the pull-down menu at the top of the panel. Then use the File->Save command.

There are three versions of the Save command in the File menu. They will all contain the name of the data collection currently selected in the data panel. The Save... command will overwrite the data that you orinally loaded. The Save As... command will save this data with a new name and location, and subsequent Save... commands will save in this new location. The Save Copy As... command will save this data in a new location with a new name, but will continue to work on the original data, that is, subsequent Save... commands will overwrite the original location.

We recommend you save your volume as a .mgh file or a compressed .mgh file, .mgz. Scuba will guess the file type to save based on the format of the file name you choose. To save as a set of COR files, choose a directory as the save target.

ScubaGuide/ScubaWorkingWithData/ScubaAnatomicalVolumes (last edited 2008-04-29 11:45:31 by localhost)