SlicerRadiomics Tutorial

1,012 views
Skip to first unread message

mse...@vt.edu

unread,
Apr 15, 2018, 6:29:57 PM4/15/18
to pyradiomics
I am looking for user guidelines for the Radiomics extension on 3D slicer. 

I have downloaded the latest build (4.9.0-2018-04-14 r27149) and the Radiomics extension. The studies have been segmented using the Segment Editor module and saved as .nrrd and mrb files. However, I have not been able to load the files correctly. There is an "Input Label Map" drop down which is not used in Segment Editor. Is there a workaround for this feature or do I have to resegment the DICOMs? 

Is there a tutorial or user guidelines available? Any assistance would be greatly appreciated!

Thanks for your help, MC


Joost van Griethuysen

unread,
Apr 16, 2018, 6:40:20 AM4/16/18
to pyradiomics
Hello MC,

Indeed, we need to expand a "usage" section for SlicerRadiomics! We will look into this.

For now, in terms of image/segmentation, there are 3 input selectors in SlicerRadiomics. The first is Input Image Volume, and is always required to be set to a valid 3D volume node (if your image is loaded correctly in slicer you should be able to select it here).
The second and third are Input LabelMap and Input Segmentation, here only one is required, although both may be specified. In your case, as you used segment editor, your result is a segmentation node and should be loaded via the Input Segmentation selector.

SlicerRadiomics will then extract features, using PyRadiomics, for each segment in the segmentation node you specified.

As to customizing the extraction, some customization is implemented as GUI elements and can be used by selecting "manual customization". However, SlicerRadiomics also accepts PyRadiomics customization files, allowing you to use the full flexibility of PyRadiomics.
More info on the customization file can be found here (this is part of the section that also includes documentation on what you can customize and how).

Cheers,

Joost

Op maandag 16 april 2018 00:29:57 UTC+2 schreef mse...@vt.edu:

mse...@vt.edu

unread,
Apr 16, 2018, 7:07:26 PM4/16/18
to pyradiomics
Hi Joost,
Thank you for the information. I loaded the mrml scene and nrrd segmentation files and retried the data extraction but ran into similar errors, hopefully it is something simple that I may not be doing correctly. Unfortunately I am not a programmer so its not clear to by the error messages what might be going wrong. Do I need to have MatLab installed before this module will work? Below are the messages in the error window. Thank you again for your help.

Session start time .......: 2018-04-16 19:02:07

Slicer version ...........: 4.9.0-2018-04-14 (revision 27149) macosx-amd64 - installed release

Operating system .........: Mac OS X / 10.12.6 / 16G29 - 64-bit

Memory ...................: 8192 MB physical, 2048 MB virtual

CPU ......................: GenuineIntel Intel(R) Core(TM) i5-4690 CPU @ 3.50GHz, 4 cores, 4 logical processors

VTK configuration ........: OpenGL2 rendering, Sequential threading

Developer mode enabled ...: no

Prefer executable CLI ....: yes

Additional module paths ..: /Applications/Slicer.app/Contents/Extensions-27149/SlicerRadiomics/lib/Slicer-4.9/cli-modules, /Applications/Slicer.app/Contents/Extensions-27149/SlicerRadiomics/lib/Slicer-4.9/qt-scripted-modules, /Applications/Slicer.app/Contents/Extensions-27149/MatlabBridge/lib/Slicer-4.9/cli-modules, /Applications/Slicer.app/Contents/Extensions-27149/MatlabBridge/lib/Slicer-4.9/qt-loadable-modules, /Applications/Slicer.app/Contents/Extensions-27149/SlicerOpenIGTLink/lib/Slicer-4.9/qt-loadable-modules, /Applications/Slicer.app/Contents/Extensions-27149/SlicerOpenIGTLink/lib/Slicer-4.9/qt-scripted-modules, /Applications/Slicer.app/Contents/Extensions-27149/SlicerDevelopmentToolbox/lib/Slicer-4.9/qt-scripted-modules, /Applications/Slicer.app/Contents/Extensions-27149/QuantitativeReporting/lib/Slicer-4.9/qt-scripted-modules, /Applications/Slicer.app/Contents/Extensions-27149/PETDICOMExtension/lib/Slicer-4.9/cli-modules, /Applications/Slicer.app/Contents/Extensions-27149/PETDICOMExtension/lib/Slicer-4.9/qt-scripted-modules, /Applications/Slicer.app/Contents/Extensions-27149/DCMQI/lib/Slicer-4.9/cli-modules, /Applications/Slicer.app/Contents/Extensions-27149/MatlabModules

QObject::connect: No such slot qSlicerSettingsUserInformationPanel::updateFromUserInformation(vtkObject*)

QObject::connect: (receiver name: 'qSlicerSettingsUserInformationPanel')

Popen(%s, cwd=%s, universal_newlines=%s, shell=%s)

Enabling C extensions

Using yaml library: /Applications/Slicer.app/Contents/Extensions-27149/SlicerRadiomics/lib/python2.7/site-packages/yaml/__init__.pyc

Traceback (most recent call last):

File "<string>", line 1, in <module>

File "/Applications/Slicer.app/Contents/lib/Slicer-4.9/qt-scripted-modules/ExtensionWizard.py", line 7, in <module>

import SlicerWizard.ExtensionDescription

File "/Applications/Slicer.app/Contents/bin/Python/SlicerWizard/__init__.py", line 42, in <module>

from .ExtensionDescription import ExtensionDescription

File "/Applications/Slicer.app/Contents/bin/Python/SlicerWizard/ExtensionDescription.py", line 6, in <module>

from .ExtensionProject import ExtensionProject

File "/Applications/Slicer.app/Contents/bin/Python/SlicerWizard/ExtensionProject.py", line 6, in <module>

from .Utilities import detectEncoding

File "/Applications/Slicer.app/Contents/bin/Python/SlicerWizard/Utilities.py", line 10, in <module>

import git

File "/Applications/Slicer.app/Contents/lib/Python/lib/python2.7/site-packages/git/__init__.py", line 82, in <module>

refresh()

File "/Applications/Slicer.app/Contents/lib/Python/lib/python2.7/site-packages/git/__init__.py", line 73, in refresh

if not Git.refresh(path=path):

File "/Applications/Slicer.app/Contents/lib/Python/lib/python2.7/site-packages/git/cmd.py", line 230, in refresh

cls().version()

File "/Applications/Slicer.app/Contents/lib/Python/lib/python2.7/site-packages/git/cmd.py", line 551, in <lambda>

return lambda *args, **kwargs: self._call_process(name, *args, **kwargs)

File "/Applications/Slicer.app/Contents/lib/Python/lib/python2.7/site-packages/git/cmd.py", line 1010, in _call_process

return self.execute(call, **exec_kwargs)

File "/Applications/Slicer.app/Contents/lib/Python/lib/python2.7/site-packages/git/cmd.py", line 821, in execute

raise GitCommandError(command, status, stderr_value, stdout_value)

git.exc.GitCommandError: Cmd('git') failed due to: exit code(69)

cmdline: git version

stderr: '


Agreeing to the Xcode/iOS license requires admin privileges, please run “sudo xcodebuild -license†and then retry this command.


'

loadSourceAsModule - Failed to load file "/Applications/Slicer.app/Contents/lib/Slicer-4.9/qt-scripted-modules/ExtensionWizard.py" as module "ExtensionWizard" !

Fail to instantiate module "ExtensionWizard"

libpng warning: iCCP: known incorrect sRGB profile

Enabling C extensions

Scripted subject hierarchy plugin registered: Annotations

MatlabExecutablePath not found, default path used: /Applications/MATLAB_XXXXX.app/bin/matlab

Scripted subject hierarchy plugin registered: SegmentEditor

Scripted subject hierarchy plugin registered: SegmentStatistics

Switch to module: "Welcome"

Loaded volume from file: /Users/mcseward/Documents/SlicerDICOMDatabase/BentleyQ/8 AX T1 SEC.nrrd. Dimensions: 256x256x26. Number of components: 1. Pixel type: short.



CreateVTKTransformFromITK - SetVTKLinearTransformFromITK conversionSuccess:0

Loaded volume from file: /Users/mcseward/Documents/SlicerDICOMDatabase/BentleyQ/6 AX T2 FSE.nrrd. Dimensions: 512x512x26. Number of components: 1. Pixel type: short.



CreateVTKTransformFromITK - SetVTKLinearTransformFromITK conversionSuccess:0

Loaded volume from file: /Users/mcseward/Documents/SlicerDICOMDatabase/BentleyQ/3 AX FLAIR.nrrd. Dimensions: 256x256x28. Number of components: 1. Pixel type: short.



CreateVTKTransformFromITK - SetVTKLinearTransformFromITK conversionSuccess:0

Loaded volume from file: /Users/mcseward/Documents/SlicerDICOMDatabase/BentleyQ/5 AX T1 SE.nrrd. Dimensions: 256x256x26. Number of components: 1. Pixel type: short.



CreateVTKTransformFromITK - SetVTKLinearTransformFromITK conversionSuccess:0

"MRML Scene" Reader has successfully read the file "/Users/mcseward/Documents/SlicerDICOMDatabase/BentleyQ/QBentley2018-02-26-Scene.mrml" "[0.40s]"

Switch to module: "SlicerRadiomics"

Generating customization file

Feature extraction started

Initializing output table

Starting RadiomicsCLI for %s

Generating customization file

Feature extraction started

Initializing output table

Starting RadiomicsCLI for Segmentation_segment_Necrosis

Found CommandLine Module, target is /Applications/Slicer.app/Contents/Extensions-27149/SlicerRadiomics/lib/Slicer-4.9/cli-modules/SlicerRadiomicsCLI

ModuleType: CommandLineModule

RadiomicsCLI command line:


/Applications/Slicer.app/Contents/Extensions-27149/SlicerRadiomics/lib/Slicer-4.9/cli-modules/SlicerRadiomicsCLI --param /var/folders/gq/qfvxsly52l52ksshdczw9r4r0000gn/T/Slicer-mcseward/RadiomicsLogicParams.json --label 1 /var/folders/gq/qfvxsly52l52ksshdczw9r4r0000gn/T/Slicer-mcseward/HHEE_vtkMRMLScalarVolumeNodeB.nrrd /var/folders/gq/qfvxsly52l52ksshdczw9r4r0000gn/T/Slicer-mcseward/HHEE_vtkMRMLLabelMapVolumeNodeB.nrrd


RadiomicsCLI standard error:


Traceback (most recent call last):

File "/Applications/Slicer.app/Contents/Extensions-27149/SlicerRadiomics/lib/Slicer-4.9/cli-modules/SlicerRadiomicsCLIScript", line 6, in <module>

from radiomics.scripts import parse_args

File "/Applications/Slicer.app/Contents/Extensions-27149/SlicerRadiomics/lib/python2.7/site-packages/radiomics/__init__.py", line 4, in <module>

import collections # noqa: F401

File "/Applications/Slicer.app/Contents/lib/Python/lib/python2.7/collections.py", line 20, in <module>

from _collections import deque, defaultdict

ImportError: No module named _collections


RadiomicsCLI completed with errors

Joost van Griethuysen

unread,
Apr 17, 2018, 4:00:05 AM4/17/18
to pyradiomics
Hello MC,

This is not an error caused by you or how you use SlicerRadiomics. From what I can see from your log, you're doing everything correctly. However, sadly there currently is an error on macOS for this extension, see here and here for the relevant threads.
I'll also take a look if I can provide you with a sort of non-programmer quick fix.

Cheers,

Joost

Op maandag 16 april 2018 00:29:57 UTC+2 schreef mse...@vt.edu:
I am looking for user guidelines for the Radiomics extension on 3D slicer. 

Andrey Fedorov

unread,
Apr 17, 2018, 11:09:48 AM4/17/18
to pyradiomics
I think the underlying issue was supposed to be resolved by this PR, which is now merged: https://github.com/Slicer/Slicer/pull/894

But there is another problem with the nightly build today, and I am unable to confirm if the pyradiomics problem was solved or not.


On Tuesday, April 17, 2018 at 4:00:05 AM UTC-4, Joost van Griethuysen wrote:
Hello MC,

This is not an error caused by you or how you use SlicerRadiomics. From what I can see from your log, you're doing everything correctly. However, sadly there currently is an error on macOS for this extension, see here and here for the relevant threads.
I'll also take a look if I can provide you with a sort of non-programmer quick fix.

Cheers,

Joost

Op maandag 16 april 2018 00:29:57 UTC+2 schreef:

mse...@vt.edu

unread,
Apr 17, 2018, 3:49:52 PM4/17/18
to pyradiomics
Hi Joost,
Thanks a million for all your help. I appreciate any work arounds you can think of.

Regards,
MC


On Tuesday, April 17, 2018 at 4:00:05 AM UTC-4, Joost van Griethuysen wrote:

Michael Moran

unread,
Jul 26, 2019, 8:38:01 AM7/26/19
to pyradiomics
Hi Joost,

I was just reading the thread and just wondering it is ok to use the input label volume to extract features from? I have no input segmentation drop down box in my 3D slicer only an  Input Image Volume and Input LabelMap drop-down box. 

Joost van Griethuysen

unread,
Aug 12, 2019, 4:42:19 AM8/12/19
to pyradiomics
That's certainly possible, although it is kind of odd you don't have the input segmentation box. Which version of Slicer are you using? It's possible you are using a quite old version of Slicer/SlicerRadiomics.
Furthermore, you can check the version of PyRadiomics that Slicer uses by entering the following in the Slicer Python interactor:

import radiomics
radiomics.__version__

Regards,

Joost

Op vrijdag 26 juli 2019 14:38:01 UTC+2 schreef Michael Moran:
Reply all
Reply to author
Forward
0 new messages