Skip to content
This repository has been archived by the owner on Jul 29, 2023. It is now read-only.

Fluorescence channel 3D volume segmentation #213

Closed

Conversation

Soorya19Pradeep
Copy link
Contributor

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.

Applies on whole 3D stack. Image stack normalized based
on center slice intensity range.
Copy link
Contributor

@Christianfoley Christianfoley left a 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.


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])
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor

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.

micro_dl/utils/masks.py Outdated Show resolved Hide resolved
micro_dl/utils/masks.py Outdated Show resolved Hide resolved
micro_dl/utils/masks.py Outdated Show resolved Hide resolved
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) / (
Copy link
Contributor

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?

Copy link
Contributor Author

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?

Copy link
Contributor

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.

@Soorya19Pradeep Soorya19Pradeep deleted the preprocessing_3Dsegmentation branch April 3, 2023 15:12
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants