get_mask_dcmseg¶
- formatreader.get_mask_dcmseg(filename: str, mask_id=[0], n_interp=10, smooth_slices=True)¶
Retrieves the surface points of the 3D volume defined by the masks of a DICOM seg file.
- Parameters:
filename (str must be .dcm format) –
mask_id (int default = 0. If 0 all masks are merged into a single point cloud) –
n_interp (int) – Number of slices interpolated between every consecutive original slices. Default = 10.
smooth_slices (bool) – 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.