Automated brain segmentation into White Matter Volume, GMV, and CSF Vol?

Does anyone know if there is an extension that facilitates whole brain segmentation into CSF, gray, and white matter? I downloaded BrainVolumeRefinement, which seemed to have this capability for Slicer 4.10, but since installing I haven’t been able to find it in my modules. This makes me think it wasn’t updated to be compatible with 4.11.

I’ve had good luck with this one:

1 Like

@fepegar It seems that this extension is not in the extension index. Is there some issue with it, or you just have not had the time to submit it a pull request yet?

@pieper thank you. if I can get it to work this looks like it should fit the bill.

I downloaded a copy to my Desktop and added it to “Additional Module Paths” in Slicer. However, whenever I try to run a segmentation I get the below error. Is this related to @lassoan’s comment about this module not being in the extension index yet?

Importing torch…

Requirement already satisfied: light-the-torch in /Applications/Slicer.app/Contents/lib/Python/lib/python3.6/site-packages (0.3.4)

Requirement already satisfied: pip<20.3.,>=20.1. in /Applications/Slicer.app/Contents/lib/Python/lib/python3.6/site-packages (from light-the-torch) (20.2.4)

WARNING: You are using pip version 20.2.4; however, version 21.2.4 is available.

You should consider upgrading via the ‘/Applications/Slicer.app/Contents/bin/./python-real -m pip install --upgrade pip’ command.
Traceback (most recent call last):
File “/Users/Jesse/Desktop/SlicerParcellation-master/PyTorchUtils.py”, line 44, in importTorch
import torch
ModuleNotFoundError: No module named ‘torch’

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/Users/Jesse/Desktop/SlicerParcellation-master/BrainParcellation.py”, line 62, in onRunButton
super().onRunButton()
File “/Users/Jesse/Desktop/SlicerParcellation-master/InferenceUtils.py”, line 175, in onRunButton
if not self.logic.confirmDeviceOk():
File “/Users/Jesse/Desktop/SlicerParcellation-master/InferenceUtils.py”, line 257, in confirmDeviceOk
if self.torchLogic.getDevice() == ‘cpu’:
File “/Users/Jesse/Desktop/SlicerParcellation-master/PyTorchUtils.py”, line 73, in getDevice
torch = self.torch
File “/Users/Jesse/Desktop/SlicerParcellation-master/PyTorchUtils.py”, line 39, in torch
self._torch = self.importTorch()
File “/Users/Jesse/Desktop/SlicerParcellation-master/PyTorchUtils.py”, line 47, in importTorch
torch = self.installTorch()
File “/Users/Jesse/Desktop/SlicerParcellation-master/PyTorchUtils.py”, line 53, in installTorch
wheelUrl = self.getTorchUrl()
File “/Users/Jesse/Desktop/SlicerParcellation-master/PyTorchUtils.py”, line 62, in getTorchUrl
import light_the_torch as ltt
File “/Applications/Slicer.app/Contents/lib/Python/lib/python3.6/site-packages/light_the_torch/init.py”, line 3, in
from ._pip import *
File “/Applications/Slicer.app/Contents/lib/Python/lib/python3.6/site-packages/light_the_torch/_pip/init.py”, line 1, in
from .extract import *
File “/Applications/Slicer.app/Contents/lib/Python/lib/python3.6/site-packages/light_the_torch/_pip/extract.py”, line 5, in
from pip._internal.req.req_install import InstallRequirement
File “/Applications/Slicer.app/Contents/lib/Python/lib/python3.6/site-packages/pip/_internal/req/init.py”, line 10, in
from .req_install import InstallRequirement
File “/Applications/Slicer.app/Contents/lib/Python/lib/python3.6/site-packages/pip/_internal/req/req_install.py”, line 35, in
from pip._internal.utils.direct_url_helpers import direct_url_from_link
File “/Applications/Slicer.app/Contents/lib/Python/lib/python3.6/site-packages/pip/_internal/utils/direct_url_helpers.py”, line 12, in
from pip._internal.vcs import vcs
File “/Applications/Slicer.app/Contents/lib/Python/lib/python3.6/site-packages/pip/_internal/vcs/init.py”, line 9, in
import pip._internal.vcs.subversion # noqa: F401
File “/Applications/Slicer.app/Contents/lib/Python/lib/python3.6/site-packages/pip/_internal/vcs/subversion.py”, line 336, in
vcs.register(Subversion)
File “/Applications/Slicer.app/Contents/lib/Python/lib/python3.6/site-packages/pip/_internal/vcs/versioncontrol.py”, line 317, in register
self._registry[cls.name] = cls()
File “/Applications/Slicer.app/Contents/lib/Python/lib/python3.6/site-packages/pip/_internal/vcs/subversion.py”, line 191, in init
use_interactive = is_console_interactive()
File “/Applications/Slicer.app/Contents/lib/Python/lib/python3.6/site-packages/pip/_internal/utils/misc.py”, line 906, in is_console_interactive
return sys.stdin is not None and sys.stdin.isatty()
AttributeError: ‘PythonQtStdInRedirect’ object has no attribute ‘isatty’

This was fixed during Project Week, so everything should be good if you use a current nightly (not the stable release).

Can you clarify what you mean by current nightly? I re-downloaded the most current software just to be safe and I’m still getting the error. I’m using Slicer 4.11.20210226.

I mean when you go to download.slicer.org you pick the preview version with the most recent date.