You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
3. (Array-Level) Extract beamform from a video (list of images)
fromultramlimportextract_ultrasound_video_foreground, convert_img_to_uint8video_frames_arr= ... # list of numpy image arraysultrasound_foreground, static_mask=extract_ultrasound_video_foreground(
img_sequence=video_frames_arr,
apply_filter=True,
crop=True
)
# Function returns: (i) the video frames with extracted foreground and# (ii) a mask for the static parts of the image# To get the background, mask out the static parts of any image framefirst_img=video_frames_arr[0]
background_img=convert_img_to_uint8(first_img)
background_img[~static_mask] =0
4. (Array-Level) Extract ultrasound from a single image
fromultramlimportextract_ultrasound_image_foregroundimg_arr= ... # single numpy image arrayultrasound_foreground, static_mask=extract_ultrasound_image_foreground(
img=img_arr,
apply_filter=True,
crop=True
)
# Function returns: (i) the image frame with extracted foreground and# (ii) a mask for the estimated background of the image# To get the background, mask out the static parts of any image framebackground_img=convert_img_to_uint8(img_arr)
background_img[~static_mask] =0
About
A simple package for ultrasound ML data preprocessing