Inserting slices into image datasets

From MIPAV
Jump to: navigation, search

When you change an image dataset, you are inserting or removing slices in the dataset or changing their order. You can use the Insert Slice command on the Utilities menu to insert a slice into an image dataset. Although you cannot insert a slice from another file, you can insert either a blank slice or a new slice that is an average of two adjacent slices in the dataset.

Inserting slices into a dataset

To insert slices into image datasets

1 Select Utilities Slice Tools> Insert Slice. The Insert Slice dialog box appears.
2 Enter the number of the new slice position in the Insert before slice (1-124) or enter 125 for new last slice box.
3 Select either the Average or Blank radio button. If you select Average, MIPAV analyzes the slices immediately before and after the new slice in the dataset. The software then generates an intermediary composite by morphing the two slices. This composite becomes the new slice. If you select Blank, MIPAV inserts a blank slice in the dataset.
4 Click OK. MIPAV inserts the new slice into the dataset and opens the new dataset in a new image window.

Figure 60. The Insert Slice dialog box options
Insert before slice (1-124) or enter 125 for new last slice
Specifies the position of the new slice.
InsertSlice.jpg
Average
Inserts a slice that is the average the adjacent slices.
Copy previous adjacent
Insert a slice that is a copy of the preceding slice.
Copy next adjacent
Inserts a slice that is a copy of the following slice.
Blank
Inserts a blank slice.
Original
Inserts an image from the original dataset.
OK
Applies the parameters that you specified to insert the slice in the image dataset.
Cancel
Disregards any changes you made in this dialog box, closes the dialog box, and does not insert the slice into the image dataset.
Help
Displays online help for this dialog box.

Pad slices to power of 2

The utility pads an image with blank slices to an even power of 2 (e.g. 22k). Depending on the selected option (Pad to Front, Pad to Back, or Pad to Half Front and Back), all slices can be inserted in front, in back, or half the slices in front and half the slices in back.

Image types

The algorithm works with 3D and 4D, grayscale, black and white, and color images. It preserves the image type when inserts slices.

Applying the pad to power of 2 utility

To pad the image dataset to power of 2
1 Select Utilities > Slice tools>Pad to Power of 2. The Padding Images dialog box opens.
2 The dialog box window appears indicating how many slices should be added to the image.
3 Choose the method for slice insertion: Pad to Front, Pad to Back, or Pad to Half Front and Half Back.
4 Select the destination. Choose New Image if you want the image with inserted slices appear in a new image frame; choose Replace Image to replace the original image.
5 Click Pad to proceed.

Figure 61. The Padding Images dialog box options
Pad to Front
Inserts slices before the first slice of the image.

PaddingImagesDialogBox.jpg

Pad to Back
Inserts slices after the last slice of the image.
Copy previous adjacent
Insert a slice that is a copy of the preceding slice.
Destination
Pad to half front and half back
Inserts half of the slices before the first slice of the image and half after the last slice.
New Image
Opens the modified image in a new image frame.
Replace image
Replaces the existing image.
Pad
Applies the parameters that you specified to insert the slices in the image dataset.
Cancel
Disregards any changes you made in this dialog box, closes the dialog box, and does not insert the slice into the image dataset.
Help
Displays online help for this dialog box.

Randomizing image (slice) order

To randomize the order of slices in the image dataset, do the following:

1 Open an image that contains slices.
2 Write the slice numbers on a piece of paper.
3 Select Utilities > Slice Tools>Randomize Slice Order.
4 The MIPAV window refreshes and, depending on your selection, the new dataset appears in the same image window as the original dataset.

The new randomized slice ordering appears as a table in the Output window.

Removing images (slices) from datasets

MIPAV allows you to remove one, several, or all slices from an image dataset. In addition, you can specify one or more ranges of slices to remove, or slice removal can include only the even-numbered or only the odd-numbered slices.

To remove slices from datasets
1 Select Utilities > Remove slices. The Remove Slices dialog box opens.
2 Use the image slider in the MIPAV window to locate slices that you want to remove.
3 Decide whether to remove:

  • Most of the slices
  • One or more ranges of slices
  • All even-numbered slices
  • All odd-numbered slices

Tip: Use the image slider on the MIPAV window to look at specific slices to decide which slices to remove.
4 Select one of the following:

  • New image -If the new image dataset should appear in its own image window
  • Replace image -If the dataset should overwrite the original dataset and appear in the original image window

5 Select Remove. A status message appears. Then the MIPAV window refreshes and, depending on your selection, the new dataset appears in either a new image window or in the same image window as the original dataset.

Figure 62. Remove Slices dialog box
Slices
Indicates the slices that you want to remove from the dataset. You can scroll through the list to select one or more slices.

ZeroBased RemovetSlices.jpg

Select all
Selects all of the slices in the dataset.
Clear
Clears all of the slices that are currently selected.
Check even
Selects all of the even-numbered slices.
Check odd
Selects all of the odd-numbered slices.
Specify range of slices
Indicates that you want to remove one or more slices or a range of slices from the dataset.
If you select this check box, you must specify the slices or ranges of slices you want to remove. in the Slice number or range of slices box below.
Replace slices
If you select that option, the removed slices would be replaced using the average method.
New image
Shows the results of the slice removal in a new image window.
Replace image
Replaces the current active dataset with the dataset resulting from the slice removal in the same image window.
Remove
Removes the slices that you indicated in this dialog box.
Cancel
Disregards any changes that you made in this dialog box and closes the dialog box.
Help
Displays online help for this dialog box.

Replace blanks with averages

The algorithm replaces blank slices with slices that carry average pixel values calculated from the neighbor slices. The algorithm, first, counts the number of consecutive blank slices, and then does the following:

1 If the consecutive slices are at the beginning of the image, the all replaced with the first nonblank slice.
2 If the consecutive slices are at the end of the image, they all replaced with the last nonblank slice.
3 If the consecutive slices are somewhere in the middle, they replaced by the weighted sum of the surrounded nonblank slices.
Example: for a single blank slice, the pixel values are replaced by the averages of two surrounding slices. For two consecutive blank slices, the pixel values for the first slice are calculated as (2/3 * bottomNonBlank 1/3 * topNonBlank); and for the second blank slice, the pixel values are calculated as (1/3 * bottomNonBlank 2/3 * topNonBlank).


To run the algorithm, call Utilities >Slice Tools> Replace Blanks with Averages.

Image types

The algorithm is only applicable for 3D, grayscale images.

Replace Slices

For 3D and 4D images, the algorithm allows to replace image slices with some other slices (2D) chosen by a user.

To apply the Replace Slices algorithm,

1 Open an image of interest (3D or 4D).
2 Move the image slider so that it shows the slice that you wish to replace.
3 Open the 2D image that you would like to put in place of the chosen slice.
4 Call Utilities>Slice Tools>Replace Slices.
5 In the dialog box that appears, indicate the slice number that you would like to replace.
6 Press OK. The algorithm replaces the selected slice with the chosen 2D image. See Figure 63.

Figure 63. The Replace Slice dialog box (at the top), the original image (A), and the image (B) that was used to replace the slice 2 of the original image

ReplaceSliceDialogBox.jpg

ReplaceSlicesOriginal.jpg


A

ReplaceSlicesToReplace.jpg


B

Image types

The algorithm is applicable for both grayscale and color 3D images. The image that you use to replace the slice must be 2D.Note that the type of the original image and the image that you use to replace the slice must be the same. E.g. you cannot replace the grayscale slice with the color image.

See also:

Changing Image Datasets Using MIPAV Utilities

Subtract VOI Background