How to create an US image mask

  1. Obtain an US image slice in MINC format for which the mask is to be applied
  2. Open the image slice using Display
  • e.g. Display L5–1_6cm.00044.mnc
  1. Use the Segmenting menu (F key) to segment a label that covers the area on the image that is to be masked in (in our case, the area is the fan shaped section that contains the US image). The most efficient and accurate way to segment this label is the following

    • Change the brush size to minimum (XY Radius, F key)to 1
    • Use the brush (press the right mouse button) to trace out the contour of the area to be included in the mask
    • Do a Label Fill (E key)
    • Fine-tune the contour of the area by using the brush (right mouse key) or the erase brush (right mouse key and shift)
  2. Save the segmented label in a MINC file by going back to the main menu, then go to the File menu (T key). At this menu, do Save Labels .mnc (W key), and input the file name in the console.

    • e.g. label_65mm.mnc
  3. Back in the console, do mincresample the label to be like the image slice from which it was generated.

    • e.g. mincresample -like L5–1_6cm.00044.mnc label_65mm.mnc mask_65mm.mnc
      (Note that the image slice after the -like option has to be the slice from which the label was generated, otherwise, the mask may not be at the same physical space as the slice).
  4. When multiplying the generated mask to US image slices, use the -nocheck_dim option so that the multiplication is in image space and not in physical space

    • e.g. mincmath -nocheck_dim -mult mask_65mm.mnc L5–1_6cm.00413.mnc L5–1_6cm.00413m.mnc

Special Note:

  1. If the mask must be applied on an rgb minc file, before doing the mincmath:
    • mincconcat -concat_dimension vector_space mask_65mm.mnc mask_65mm.mnc mask_65mm.mnc mask_65mm_rgb.mnc (to create vector_space)
    • mincreshape -dimorder xspace,yspace,zspace,vector_space mask_65mm_rgb.mnc mask_65mm_rgb_reordered.mnc (to put that dimension last)