get_mask_dicom

formatreader.get_mask_dicom(directory, n_interp: int = 10, smooth_slices: bool = True)

Retrieves the surface points of the 3D volume defined by a DICOM file.

Parameters:
  • directory (str) – Path to the folder containing the DICOM files.

  • n_interp (int) – Number of slices interpolated between every consecutive original slices. Default = 10.

  • smooth_slices (boolean) – If True, binary slices are smoothed via erosion/dilation operations. Default = True

Returns:

  • contours (Numpy array) – Contains the contours of every slice in voxel coordinates.

  • covers (Numpy array) – Contains the points from the top and bottom slices. Needed to close the .stl geometry.

  • transf_mat (Numpy array) – Transformation matrix to convert from voxel coordinates to space coordinates.