-
Notifications
You must be signed in to change notification settings - Fork 7
Fluorescence channel 3D volume segmentation #213
Fluorescence channel 3D volume segmentation #213
Conversation
Applies on whole 3D stack. Image stack normalized based on center slice intensity range.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs to update the docstring. otherwise looks good! This branch will cause some merge conflicts with the updates in the iohub-dependency
branch. We should get this branch merged first.
micro_dl/utils/masks.py
Outdated
|
||
elif style == 'binary': | ||
ret, mask = cv2.threshold(input_image_norm.astype(np.uint8), thresh_input, 255, cv2.THRESH_BINARY) | ||
input_image_norm = 255*(input_image_blur - thresh_input[1])/(thresh_input[0] - thresh_input[1]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is thresh_input an int or an iterable here? Can you add its parameter description to the docstring?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @Christianfoley! I have added the docstring for thresh_input.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small thing, if the parameter is Iterable
but the default is set to 0, the parameter type description should be "0 or Iterable". I would suggest in this case you set the default parameter to an empty list (description: "Iterable" makes sense) or None (description to "Iterable or None") according to Sphinx docstrings.
focus_max = np.max(input_image_blur[mid_slice_id,:,:]) | ||
focus_min = np.min(input_image_blur[mid_slice_id,:,:]) | ||
|
||
input_image_norm = (input_image_blur - focus_min) / ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is unit intensity needed if only the binary mask is returned?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean the rescaling the intensity values of all slices based on intensity value range of the middle slice?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, since this operation does not skew the histogram, it should not affect otsu.
The otsu thresholding for fluorescence segmentation extended for 3D volume segmentation in preprocessing module. This avoids the deconvolution artifacts in out-of-plane slices. The normalization of slices was performed based on intensity range of center slice and simple thresholding was perform from the threshold value of center slice.