Editor: Crop Editor ()
Figure 1: The Crop editor allows you a crop a 3D image and to modify its bounding box or voxel size. This editor works on 3D fields with an arbitrary number of components defined on a regular grid, e.g., 3D images or 3D vector fields with uniform, stacked, rectilinear, or curvilinear coordinates. It allows you crop such a field, i.e., to discard all voxels lying outside of a specified subvolume in index space. Alternatively, you may adjust the physical size of the field by changing its bounding box. Note that this does not mean Resample, i.e., the number of voxels will not be changed.
Each node of a regular grid can be addressed by an index triple (i,j,k). Each index ranges from zero to the number of slices minus one in that direction. This editor also allows you to add new slices on every side in every dimension. Last but not least, you can flip and rotate the slices with respect to the global x-, y-, or z-direction.
When you activate the crop editor, the dialog shown in Figure 1 pops up. If the editor is activated for a field with uniform, stacked, or rectilinear coordinates, in addition a tab box dragger is displayed in the viewer window. The dragger allows you to specify the subvolume to be cropped interactively in 3D. When you resize the dragger, the index bounds of the current subvolume are permanently updated in the corresponding fields in the dialog window.
The Crop list allows you to select a ROI and use its box coordinates as crop coordinates.
The Auto crop button automatically adjusts the subvolume to be cropped by taking into account the value of the Threshold field. Slices at the boundaries of the original data volume are cropped if they contain only data values smaller than the specified threshold. In this way it is easy to isolate a bright object in a 3D image with a large dark background.
The Adjust section allows you to automatically enlarge or reduce the crop region by taking into account the value of the Adjust field. Each click on the Enlarge or Reduce buttons will enlarge or reduce the crop region with n number of voxels. By default, the default value is set to 8 voxels.
In order to add slices, you must set the indices in the text fields beyond the limits of the total data volume. When slices are added, by default the values of the last slice in that direction are replicated. If you switch off the replicate toggle, the text field pixel value becomes active. You can then specify a data value which is used to initialize the new slices.
In order to manipulate the bounding box of the data object, new values must be entered in the corresponding text fields. For data objects with uniform coordinates two modes are available, Bounding Box and voxel size. See section below for details.
All changes take effect if you press the OK button. They are discarded by activating the Cancel button. As usual, the editor is closed by pressing OK or Cancel. Cancel restores the previous state.
Cropping an Image by Dragging and Moving the Box
Some experience with manipulating draggers is assumed. Using the draggers you can reduce or enlarge the data volume you want to preserve; enlarging is, of course, possible only up to the size of the bounding box. The size of the dragging box can be manipulated intuitively in every direction of the three axes, i.e., along the x-, the y-, or the z-axis. The values in the text fields of the editor change according to your manipulations. A certain minimum thickness is preserved while reducing a dimension of the box; for further reductions the text fields must be used.Using the draggers you control the size of the subset of the data volume which must be preserved, but the location of it in the total data volume is set by moving the box around to the desired location.
Cropping an Image by Setting Values Explicitly in the Text Fields
The text fields in the cropping area of the editor show the indices of the slices that must be preserved for every dimension. You can easily define a subset by setting a range of indices explicitly in the text fields of an axis - this defines the size as well as the location of the data subset. Notice that a slice index refers to an axis that is perpendicular to the slice.
Adding New Slices
Adding new slices is only possible by setting an index that does not fall into the range given by the minimum and maximum presently shown in the Image Crop panel; thus a negative index must be specified if the minimum is zero. Use the Min or Max text field for the required axis text field to enter a new slice index.The slices are added to the volume at the specified end and according to the axis selected. The new slices contain the data of the last slice in this direction, e.g., if you add two slices before the slice with index 0 along the x-axis, they contain exactly the same data as the slice with index 0.
Changing the Size of the Bounding Box
You change the size of the bounding box by setting new values explicitly in the bounding box fields. This does not affect the stored data, but its representation as displayed by a viewing module, e.g., Ortho Slice, by way of a different scaling for the specified dimensions.The bounding box of a data set with uniform coordinates specifies the world coordinates of the center of the lower left front voxel (min values) and the center of the upper right back voxel (max values). For example, if your input is 256 pixels wide and the size of each voxel is 1mm, then you may set xMin to 0 and xMax to 255.
If a data set with uniform coordinates is being edited, instead of the bounding box, also the voxel size can be modified. You can switch between the two modes and see how bounding box and voxel size influence each other.
Flipping Slices in One Dimension
Press one of the three flip buttons to reverse the order of slices in the corresponding dimension, e.g., click on FlipX to flip the slices in the x-dimension.
Exchanging Two Dimensions
Press one of the three exchange buttons to interchange the corresponding dimensions, e.g., click on X-Y to interchange the x- and y-dimension. CAUTION: The exchange operations are not rotations; they change the spatial orientation of the data set.