# Resampling for Radiomics

**URL:** <https://discourse.slicer.org/t/resampling-for-radiomics/7712>\
**Category:** Support\
**Tags:** radiomics\
**Created:** [July 22, 2019, 10:07pm UTC](https://discourse.slicer.org/t/resampling-for-radiomics/7712 "2019-07-22T22:07:13Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![J\_C](https://avatars.discourse-cdn.com/v4/letter/j/c0e974/32.png) [@J\_C](https://discourse.slicer.org/u/J_C)\
**Post date:** [July 22, 2019, 10:07pm UTC](https://discourse.slicer.org/t/resampling-for-radiomics/7712/1 "2019-07-22T22:07:13Z")

</div>

Hello there, I’ve been trying Radiomics module for a little bit. I’m trying to analize T2 weighted images, but unfortunately they are not equally spaced. So I was thinking, it would be best to resample the entire scan before (or maybe after segmentation) and then extract features, or it would be better to just extract features from the segmentation as it is and use the resampling built in the module? And what parameters would be best to set?  
Hope that wasn’t too confusing, I’m not sure I’m getting it all right.

---

<div class="post-metadata">

**Author:** ![fedorov](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/fedorov/32/14_2.png) [@fedorov](https://discourse.slicer.org/u/fedorov)\
**Post date:** [July 24, 2019, 1:57pm UTC](https://discourse.slicer.org/t/resampling-for-radiomics/7712/2 "2019-07-24T13:57:22Z")

</div>

@J_C there is no one simple answer to what is the best way to configure extraction of features for your data. I suggest you read the studies done for similar applications in the literature to learn about best practices.

To your question about resampling and sample parameter settings, please consider reading this post: [Do we need to create an isotropic image in radiomics study?](https://discourse.slicer.org/t/do-we-need-to-create-an-isotropic-image-in-radiomics-study/1779).

---

<div class="post-metadata">

**Author:** ![J\_C](https://avatars.discourse-cdn.com/v4/letter/j/c0e974/32.png) [@J\_C](https://discourse.slicer.org/u/J_C)\
**Post date:** [July 25, 2019, 10:53pm UTC](https://discourse.slicer.org/t/resampling-for-radiomics/7712/3 "2019-07-25T22:53:06Z")

</div>

I read some works, however often it’s not stated if they resampled and how. Moreover it is harder to understand if resampling was made with the resample module, in this case I suppose it’s not necessary to resample with the Radiomics module feature extractor, or if it was made as part of the feature extraction procedure.  
In the post you suggest it’s not so specific… Maybe I could force a 2d extraction (I would easily have a bidimensional isotropy), but can’t figure how to force it.

---

<div class="post-metadata">

**Author:** ![fedorov](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/fedorov/32/14_2.png) [@fedorov](https://discourse.slicer.org/u/fedorov)\
**Post date:** [July 26, 2019, 12:37am UTC](https://discourse.slicer.org/t/resampling-for-radiomics/7712/4 "2019-07-26T00:37:08Z")

</div>

> [@J\_C](#):
>
> however often it’s not stated if they resampled and how

Yes, this is unfortunately often true.

> [@J\_C](#):
>
> In the post you suggest it’s not so specific… Maybe I could force a 2d extraction (I would easily have a bidimensional isotropy), but can’t figure how to force it.

You can use `force2D` setting in the configuration file, which you can supply to the Radiomics module. See example settings here: [pyradiomics/examples/exampleSettings/exampleMR\_NoResampling.yaml at master · AIM-Harvard/pyradiomics · GitHub](https://github.com/Radiomics/pyradiomics/blob/master/examples/exampleSettings/exampleMR_NoResampling.yaml#L68-L72).

---

<div class="post-metadata">

**Author:** ![J\_C](https://avatars.discourse-cdn.com/v4/letter/j/c0e974/32.png) [@J\_C](https://discourse.slicer.org/u/J_C)\
**Post date:** [July 29, 2019, 3:14pm UTC](https://discourse.slicer.org/t/resampling-for-radiomics/7712/5 "2019-07-29T15:14:44Z")

</div>

Thank you for the link, pretty useful; there’s even an example for normalization, though I assume you can either get adjusting binwidth in radiomics module, right?  
Gonna try this evening.

Just a question: let’s assume that my axial slices are not pure but slightly oblique, should I (and how) reformat so that slicer goes parallale to them? Don’t know if I’m clear.

---

<div class="post-metadata">

**Author:** ![fedorov](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/fedorov/32/14_2.png) [@fedorov](https://discourse.slicer.org/u/fedorov)\
**Post date:** [July 29, 2019, 3:32pm UTC](https://discourse.slicer.org/t/resampling-for-radiomics/7712/6 "2019-07-29T15:32:39Z")

</div>

Yes, you can definitely adjust binwidth in the user interface. You should use settings file only if there are settings that are not exposed in the interface.

> [@J\_C](#):
>
> Just a question: let’s assume that my axial slices are not pure but slightly oblique, should I (and how) reformat so that slicer goes parallale to them?

You can use the Reformat button in the slice viewer menu to rotate the view to the slice plane. Is this what you were looking for?

![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/c/c/cc2cae12a3d54e65461a3379af4b37876d6e9726.png)

---

<div class="post-metadata">

**Author:** ![J\_C](https://avatars.discourse-cdn.com/v4/letter/j/c0e974/32.png) [@J\_C](https://discourse.slicer.org/u/J_C)\
**Post date:** [July 29, 2019, 3:38pm UTC](https://discourse.slicer.org/t/resampling-for-radiomics/7712/7 "2019-07-29T15:38:31Z")

</div>

Yeah… was that easy?  
I didn’t found that button and was trying with reformat and transformation module

---

<div class="post-metadata">

**Author:** ![fedorov](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/fedorov/32/14_2.png) [@fedorov](https://discourse.slicer.org/u/fedorov)\
**Post date:** [July 29, 2019, 3:45pm UTC](https://discourse.slicer.org/t/resampling-for-radiomics/7712/8 "2019-07-29T15:45:32Z")

</div>

You might want to go over the GUI overview here, may save you time down the road: [https://www.slicer.org/wiki/Documentation/Nightly/SlicerApplication/MainApplicationGUI](https://www.slicer.org/wiki/Documentation/Nightly/SlicerApplication/MainApplicationGUI)

---

<div class="post-metadata">

**Author:** ![J\_C](https://avatars.discourse-cdn.com/v4/letter/j/c0e974/32.png) [@J\_C](https://discourse.slicer.org/u/J_C)\
**Post date:** [July 29, 2019, 4:41pm UTC](https://discourse.slicer.org/t/resampling-for-radiomics/7712/9 "2019-07-29T16:41:03Z")

</div>

Ok, thanks.  
Let’s assume that I’d like to normalize gray level, should I only set the Binwidth or should force normalization along with 2D extraction (there’s normalization too in the script).

---

<div class="post-metadata">

**Author:** ![fedorov](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/fedorov/32/14_2.png) [@fedorov](https://discourse.slicer.org/u/fedorov)\
**Post date:** [July 30, 2019, 2:07pm UTC](https://discourse.slicer.org/t/resampling-for-radiomics/7712/10 "2019-07-30T14:07:57Z")

</div>

> [@J\_C](#):
>
> Let’s assume that I’d like to normalize gray level, should I only set the Binwidth or should force normalization along with 2D extraction (there’s normalization too in the script).

I am afraid I don’t have the answer here. Indeed, normalization of gray level and binning are interrelated, but I don’t think there is a clear recommendation in the community. In this recent paper below we explored a variety of normalizations to better understand MR feature repeatability in the prostate:

Schwier, M., van Griethuysen, J., Vangel, M. G., Pieper, S., Peled, S., Tempany, C., Hugo J W, Kikinis, R., Fennessy, F. M. & Fedorov, A. Repeatability of Multiparametric Prostate MRI Radiomics Features. _Sci. Rep._ **9,** 9441 (2019). [Repeatability of Multiparametric Prostate MRI Radiomics Features | Scientific Reports](https://www.nature.com/articles/s41598-019-45766-z)

If you have a similar test-retest dataset for your application, experimentation with achieving improved repeatability could be one approach to fine-tuning feature extraction parameters.
