Dear members,
I shared a new brain segmentation module using deep learning to extract brain and Tsallis entropy for segmentation. If you work on brain images, please have a look and let me know any feedback.
You need to download SlicerBS (GitHub - Mehrancd/SlicerBS: A Slicer module for brain extraction and segmentation) and add it to Slicer->Edit->Application Settings->Modules, then add the path of the module to “Additional module paths” and restart. The module needs TensorFlow, scikit, etc. which automatically will be installed. If you receive an error, push apply again and probably will solve it. If you need a fast processing, you should increase the voxel size using “resample scaler volume” tool. More detail about algorithm: https://doi.org/10.1016/j.mri.2019.11.002)
and how to use: SlicerBS: Extract and segment brain on MRI images into White Matter, Grey Matter and CSF - YouTube
Mehran
Cool work, thanks for making it available
Thank you, this is really nice work! It took 36 minutes on my ultrabook (including downloading and installing all dependencies), but it gave meaningful results for the MRHead volume with default options:
A few suggestions:
- Save segmentation result into a segmentation node. It takes just a few lines of Python script to convert a labelmap volume node to segmentation node. Set the correct segment names.
- Ask the user before starting to download&install enourmous packages, such as tensorflow (right now, the application may remain unresponsive for so long during the installation that, most users would think that the application crashed. See an example in the script repository.
- Instead of lengthy explanation of what the user should do in what order, simplify the user interface. For example, you could create two sections: brain mask extraction and brain segmentation. Remove the “Only extract brain mask” option and instead disable brain segmentation section until a valid brain mask is created or selected. Add a node selector for brain mask (the user may have a brain mask computed already). Disable segmentation section until a valid brain mask is selected. Add more meaningful names for q, alpha, beta, gamma parameters (you can keep the letters in a parentheses in parentheses after the meaningful name, for cross-referencing with the cited paper). Describe meaning of each parameter in tooltips, in a way that is relevant for end uses (description of “Brain extract param” is a good example, it is understandable for the end user).
- Fix typos: “param” (use full word - parameter), “higer” in tooltip, tooltip contradicts with help text (higher “brain extract param” will result in larger or smaller volume? larger would be a bit more intuitive).
- I would recommend to rename the extension to have a more descriptive name, such as TsallisBrainSegmentation. SlicerBS is not descriptive enough and in North America you don’t want your extension to be associated with BS.
- Remove
__pycache__
folders from the repository - Submit this to the extension manager so that users can find it and install it much more easily.
Thanks @lassoan for the great suggestions which I was waiting for.
Thanks @lassoan again. I tried to follow the comments and improve the module (except some which I did not know how) with a new name . In addition, I fixed some issues to improve the accuracy. Please have a look and let me know your feedback. You can resample the head image (e.g., 2x2x2) to decrease time consumption considerably.
Great, thanks for the update! If you have any specific question (any problems or suggestions that you could not fix) then let us know. If everything is ready then send a pull request to the ExtensionsIndex.
I don’t know why I always fail to install tensorflow.
The pip install looks good. You have a few harmless warnings:
- Since you don’t use the command-line from Slicer’s Python environment it is perfectly fine to not adding scripts to the path.
- If you want, you can update pip, but it very rarely makes any difference.
The error is in your Python code: you call GetDimensions()
method for a variable that is set to None
. I would recommend to set up a debugger as described here, because then you don’t need to guess what’s happening or add temporary log messages, but you can very easily step through the code and see what goes wrong.
try the latest version might solve it.
Great work and very useful to know. Thanks for sharing, I appreciate this work!
Thanks @danielgreenwood
Thanks for sharing, I want to save the segmentation result as obj file separately, can this plugin save the segmentation result into the segmentation node separately?
Hi @zhang_han , if I understand well, you want to save label map as segmentation node. To to this, you only need to right-click on label and convert it to segmentation node in Data module. you also can convert each label (GM, WM, CSF) again to binary label map using right-click in the same module.
I’ve successfully exported the file. Thanks for your response!