AIM-Harvard / pyradiomics

Open-source python package for the extraction of Radiomics features from 2D and 3D images and binary masks. Support: https://discourse.slicer.org/c/community/radiomics
http://pyradiomics.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
1.16k stars 499 forks source link

How should I set /examples/exampleSettings/Params.yaml to use all filters? #367

Closed guangzhaohui closed 6 years ago

guangzhaohui commented 6 years ago

Hi everyone! Since I am about to begin a radiomic study ex novo, I just wanted to extract images with all filters.
Now How should I set /examples/exampleSettings/Params.yaml?

Settings to use, possible settings are listed in the documentation (section "Customizing the extraction").

setting: binWidth: 25 label: 1 interpolator: 'sitkBSpline' # This is an enumerated value, here None is not allowed resampledPixelSpacing: # This disables resampling, as it is interpreted as None, to enable it, specify spacing in x, y, z as [x, y , z] weightingNorm: # If no value is specified, it is interpreted as None

Image types to use: "Original" for unfiltered image, for possible filters, see documentation.

imageType: Original: {} # for dictionaries / mappings, None values are not allowed, '{}' is interpreted as an empty dictionary LoG: {'sigma' : [1.0,2.0,3.0,4.0,5.0]} Wavelet: Square: SquareRoot: Logarithm: Exponential:

Thank you very much in advance, Guangzhaohui

JoostJM commented 6 years ago

There is no way to specify "all filters", but the are all listed in the documentation and you can enable them all by specifying the in your parameter file as follows:

imageType:
  Original: {}  # no custom settings
  LoG: {sigma: (0.5, 1.0, 2.0)}  # custom settings defined in-line
  Wavelet: {}
  LBP3D:
    binWidth: 1.0  # Customized settings defined in tree-structure
  # (...) add the other filters here

The name (case-sensitive) of the filter is specified by the function name implementing that filter: get<Filter>Image(), e.g. getLoGImage is enabled by specifying LoG. All filters are implemented here.

N.B. For local binary pattern there are separate implementations for 2D and 3D, so ensure you have the one that matches you extraction type.

guangzhaohui commented 6 years ago

How kind are you! Could you add the other filters here:

guangzhaohui commented 6 years ago

imageType: Original: {} # no custom settings LoG: {sigma: (0.5, 1.0, 2.0)} # custom settings defined in-line Wavelet: {} LBP3D: binWidth: 1.0 # Customized settings defined in tree-structure Square: SquareRoot: Logarithm: Exponential: Thank you very much!!!

JoostJM commented 6 years ago

looks good, but mind the meaningfull white-space (i.e. your indentation). Also Don't forget the empty dictionary ({}), as otherwise the value is interpreted as None, which currently breaks the validation

imageType:
  Original: {} # no custom settings
  LoG: {sigma: (0.5, 1.0, 2.0)} # custom settings defined in-line
  Wavelet: {}
  LBP3D:
    binWidth: 1.0 # Customized settings defined in tree-structure
  Square: {}
  SquareRoot: {}
  Logarithm: {}
  Exponential: {}
guangzhaohui commented 6 years ago

LoG: 、Wavelet: have examples. How cloud i run : LBP3D: binWidth: 1.0 # Customized settings defined in tree-structure Square: {} SquareRoot: {} Logarithm: {} Exponential: {} Could you give examples? Thank you very much!!!

JoostJM commented 6 years ago

@guangzhaohui, see the example above, or the examples in the repository (examples/exampleSettings) Customized settings defined in the tree structure means that for that specific filter, those settings override the default or global defined settings. (The sigma setting in LoG is can also be set globally)

guangzhaohui commented 6 years ago

yeah,i have solved it! Thank you very much!!! But, LBP3D: i can set it as above examples,it can not work.

AttributeError: module 'radiomics.imageoperations' has no attribute 'getLBP3DImage'

guangzhaohui commented 6 years ago

But, LBP3D: i can set it as above examples,it can not work.

AttributeError: module 'radiomics.imageoperations' has no attribute 'getLBP3DImage'

How can i set it?
Thank you.

JoostJM commented 6 years ago

Which version of PyRadiomics are you using?

If you look up your image operations module (from radiomics import imageoperations; print(imageoperations.__file__)), are you able to find the getLBP3DImage function?

guangzhaohui commented 6 years ago

Sorry !I don't hnow Which version of PyRadiomics I get this: D:\PYTHON\Lib\site-packages\pyradiomics-master\pyradiomics-master\radiomics\imageoperations.py

JoostJM commented 6 years ago

You can get the version by running (in cmd): pyradiomics --version

guangzhaohui commented 6 years ago

Could you please give me an example for LBP3D? I really cant do it for many times。 Thanks very much!

guangzhaohui commented 6 years ago

python version 3.5.4

guangzhaohui commented 6 years ago

radiomics 0.1

guangzhaohui commented 6 years ago

and How can i upgrade most newer pyradiomic?

guangzhaohui commented 6 years ago

qq 20180513094100

JoostJM commented 6 years ago

Currently, PyRadiomics is not yet on pypi (#335), but has to be installed from source. You can install using pip with the following command:"

pip install git+https://github.com/Radiomics/pyradiomics (it is possible that this requires git to be installed on your pc)

guangzhaohui commented 6 years ago

Thank you for your time! I have install as above. and get it below in D:\PYTHON\Scripts but, i open jupyter notebook it remain older one, why? image

JoostJM commented 6 years ago

you mean that you have both pyradiomics.exe and pyradiomicsbatch.exe? It is still the new one, pyradiomicsbatch is in there for backwards compatibility and will display a deprecation warning if used.

guangzhaohui commented 6 years ago

yes it both in D:\PYTHON\Scripts

guangzhaohui commented 6 years ago

usage : pyradiomics image:batch [mask] [Options] pyradiomics: error:the followingarguments are required:< Image.Batch>FILE

JoostJM commented 6 years ago

@guangzhaohui that's the new one yes

JoostJM commented 6 years ago

run pyradiomics -h to get the help message detailing the usage.

guangzhaohui commented 6 years ago

oh,let me try. thank you very much!

guangzhaohui commented 6 years ago

How can i run pyradiomics.exe by jupyter notebook?

guangzhaohui commented 6 years ago

i open jupyter notebook it was the older one

JoostJM commented 6 years ago

See this section in the documentation on interactive usage