# Feature: Custom library to extract radiomic features at specific angle

**URL:** <https://discourse.slicer.org/t/feature-custom-library-to-extract-radiomic-features-at-specific-angle/32819>\
**Category:** Radiomics\
**Tags:** python\
**Created:** [November 14, 2023, 8:20pm UTC](https://discourse.slicer.org/t/feature-custom-library-to-extract-radiomic-features-at-specific-angle/32819 "2023-11-14T20:20:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mohanad\_Arafe](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/mohanad_arafe/32/68306_2.png) [@Mohanad\_Arafe](https://discourse.slicer.org/u/Mohanad_Arafe)\
**Post date:** [November 14, 2023, 8:20pm UTC](https://discourse.slicer.org/t/feature-custom-library-to-extract-radiomic-features-at-specific-angle/32819/1 "2023-11-14T20:20:49Z")

</div>

Hello everyone,

In my research, I am using PyRadiomics to extract radiomic features at specific angles (2D for now) & distance. Therefore, I implemented a small library that helps you do so. Here is an example of how to use it:

```auto
from RadiomicsHelper import RadiomicsHelper
import SimpleITK as sitk

helper = RadiomicsHelper(image, mask, binCount=32, distance=[1])

# Get index of all 2D angles
angles = helper.getAngleIndex()
print(angles)
>> {135: 1, 90: 4, 45: 7, 0: 10}

# Get contrast value at 45 degrees
helper.getContrastFeatureValue(angles[45])
>> 23.42705042892648

# Get correlation value at 135 degrees
helper.getCorrelationFeatureValue(angles[135])
>> 0.543999809502995

```

If this seems something of interest or worthy of a PR, please do let me know and we can discuss.

Thank you,  
Mohanad

Github: mohanadarafe
