> For the complete documentation index, see [llms.txt](https://medomicslab.gitbook.io/mediml-app-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://medomicslab.gitbook.io/mediml-app-docs/soft-tissue-sarcoma-poc/2.-datamanager-radiomics-pre-checks.md).

# 2. DataManager: Radiomics pre-checks

### Purpose

As demonstrated in the first phase of the PoC, extraction settings choices affect the feature values. Therefore, before extracting radiomics features from the entire dataset, it is important to identify appropriate preprocessing settings.

The [**Radiomics Pre-Checks**](/mediml-app-docs/radiomics/data-processing/radiomics-pre-checks.md) module provides a quick overview of key image characteristics across the dataset, including:

* Voxel spacing and image resolution
* Intensity distributions within the selected tumor ROI

These observations will guide the selection of interpolation, re-segmentation, and discretization parameters used during batch radiomics extraction.

### Running the Pre-Checks

Open: **Data Manager → Radiomics Pre-Checks**

Use the following settings:

* **Dataset format:** DICOM
* **ROI definitions:** `roiNames_stsGTV.csv`
* **Dataset folder:** `DATA/STS_POC`
* **Save folder:** Save each modality's results to a separate folder `DATA/STS_POC/CT_checks`, `DATA/STS_POC/PET_checks`, etc.

{% hint style="danger" %}
**VERY IMPORTANT**: When creating a new save folder for each new result, make sure you place an empty document inside the folder for it to be selectable in MEDiml. **Empty folders are not selectable in MEDiml.**
{% endhint %}

* [x] ***Want to save some time?** You can download all the "empty" folders you will need for the checks from the zip file below; extract it inside `DATA/STS_POC` :*

{% file src="/files/AmFvJLRyJ1nDUPIXsAa4" %}

* **Check types:**
  * Voxel Checks (Dimensions)
  * Window Checks (Intensity): Optionally, you can only activate it for CT and PET imaging modalities.

{% hint style="success" %}
**To save you time:** The voxel-dimension pre-check results are the same across CT, T1, and T2FS. So you can only run the pre-check analysis for CT and PET.
{% endhint %}

Run the analysis **once per modality,** changing the custom wildcard in the Pre-checks options to:

* \*CT\*
* \*PET\*
* \*T1\*
* \*T2FS\*

<figure><img src="https://314741292-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWC0t7nEhhoOT73GRY714%2Fuploads%2FAGM7lpC4fU6ypasG950m%2FDataManager.png?alt=media&amp;token=2eda2856-f2cd-498a-9954-d535cd1b33c9" alt=""><figcaption></figcaption></figure>

### What to Look For

Select a tab based on which POC data you decided to download:

{% tabs %}
{% tab title="Light POC" %}
**Voxel Checks (CT, T1, and T2FS)**

These plots show the spatial resolution of the images across patients. Their main purpose is to help determine an appropriate **isotropic voxel size** (equal across the three dimensions) for radiomics extraction.

XY-dimensions:

<figure><img src="https://314741292-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWC0t7nEhhoOT73GRY714%2Fuploads%2FOwLV6OH3IeiJslBEeagj%2FVoxels_xy_check.png?alt=media&amp;token=cdd968ff-cb18-4eec-9f21-101f5296321d" alt=""><figcaption></figcaption></figure>

Z-dimension:

<figure><img src="https://314741292-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWC0t7nEhhoOT73GRY714%2Fuploads%2FYw3CWH0Q0dIF0S7NO54a%2FVoxels_z_check.png?alt=media&amp;token=c69437cb-5063-403d-84b6-a176ead7829a" alt=""><figcaption></figcaption></figure>

In general, the selected voxel size should be close to the modality's typical image resolution and not substantially finer than the native acquisition resolution. Upsampling requires&#x20;inference and introduces artificial information, while conversely downsampling to the largest dimension incurs information loss; hence, a good trade-off must be determined.

{% hint style="info" %}
**Based on the plots above, 2x2x2 seems a good trade-off.**
{% endhint %}

**Intensity Checks - CT**

These outputs summarize intensity values inside the tumor ROIs.

They can help identify:

* Suitable re-segmentation ranges
* Appropriate gray-level discretization settings
* Differences in intensity behavior between CT, PET, and MR images

<figure><img src="https://314741292-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWC0t7nEhhoOT73GRY714%2Fuploads%2Fcp8u7wLHG2xWuTeXfzGA%2FIntensity_range_check_bw_247.png?alt=media&amp;token=04d429d8-fa10-4100-994b-9979cbaa08f3" alt=""><figcaption></figcaption></figure>

The Hounsfield Unit (HU) Density Scale:

> Our goal is to use the pre-checks plot to exclude all HUs indicating air and bone tissue in the tumor and keep only soft tissue.

{% hint style="info" %}
The HU scale is a quantitative scale used in Computed Tomography (CT) scanning to describe radiodensity, or how easily X-rays pass through different tissues. It provides a standardized way for radiologists to identify tissues, fluids, and abnormalities based on their density.
{% endhint %}

<figure><img src="https://314741292-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWC0t7nEhhoOT73GRY714%2Fuploads%2F3ww7krj9KSfxA8z6SrJ0%2Fimage.png?alt=media&amp;token=32fc9827-8b5e-4bce-b06b-33ad63e75326" alt=""><figcaption><p>The hounsfield unit CT density scale.</p></figcaption></figure>

According to the intensity distribution analysis, 90% of the voxel intensities within the selected ROIs fall between approximately **-25 HU (5th percentile)** and **97 HU (95th percentile)**. In addition, the majority of soft tissues are typically represented by positive Hounsfield Unit values, commonly within the range of approximately **40-100 HU**. We therefore selected a conservative re-segmentation range of **0 to 100 HU**, which captures most of the observed intensity distribution while focusing on values representative of soft tissue. This range also helps reduce the influence of lower-intensity voxels that are less likely to contain clinically relevant tumor information.

{% hint style="info" %}
A **\[0, 100]** HU range is selected. Similar to Full POC results.
{% endhint %}

***

**Voxel Checks  - PET**

XY-dimensions:

<figure><img src="https://314741292-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWC0t7nEhhoOT73GRY714%2Fuploads%2F1SBXvEVZQc4EJAaP0euO%2FVoxels_xy_check.png?alt=media&amp;token=15d23426-1045-465c-ae55-18556dfdad31" alt=""><figcaption></figcaption></figure>

Z-dimensions:

<figure><img src="https://314741292-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWC0t7nEhhoOT73GRY714%2Fuploads%2Fj0ULZP1B61f8td41VPqs%2FVoxels_z_check.png?alt=media&amp;token=d09175e8-107a-4574-ad8c-43f4bfcb5f8a" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
**Based on the plots above, 4x4x4 seems a good trade-off.** Similar to Full POC results.
{% endhint %}

**Intensity Checks - PET**

*What values do PET images hold?* The images created from PET scans have bright spots and dark spots. The measurement of brightness is the SUV number. In general, **higher SUV numbers may indicate a malignancy, or cancerous growth**. [Read more](https://www.mdanderson.org/cancerwise/standardized-uptake-value--suv--numbers-on-pet-scans--what-do-they-mean.h00-159698334.html).

{% hint style="info" %}
In PET radiomics, re-segmentation is commonly used to exclude low-activity voxels that may represent background signal, noise, or non-metabolically active regions. Typical approaches involve defining either a fixed SUV interval (e.g., \[a,b]) or a minimum SUV threshold (e.g., \[a,∞\[) to focus the analysis on biologically relevant tracer uptake.
{% endhint %}

<figure><img src="https://314741292-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWC0t7nEhhoOT73GRY714%2Fuploads%2FppHxEGrR17KwOUsEY7OR%2FIntensity_range_check_bw_3.png?alt=media&amp;token=2ba9b7d4-54ca-4778-83f3-da1e4bdda672" alt=""><figcaption><p>PET images intensity distribution</p></figcaption></figure>

According to the intensity distribution analysis, 90% of the PET voxel intensities within the selected ROIs fall between approximately **0.84 SUV** and **13.93 SUV**. Since only a small proportion of voxels exhibit values below **1 SUV**, we selected a re-segmentation range of **\[1 SUV, ∞)**. This choice excludes very low-activity voxels while preserving all higher uptake values that may contain prognostic information. In addition, the lower bound of **1 SUV** provides a fixed starting point for **FBS discretization**, improving feature standardization and avoiding the use of ROI-specific minimum intensities as discretization references.

{% hint style="info" %}
A **\[1, ∞\[** SUV range is selected.
{% endhint %}
{% endtab %}

{% tab title="Full POC" %}
**Voxel Checks (CT, T1, and T2FS)**

These plots show the spatial resolution of the images across patients. Their main purpose is to help determine an appropriate **isotropic voxel size** (equal across the three dimensions) for radiomics extraction.

XY-dimensions:

<figure><img src="https://314741292-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWC0t7nEhhoOT73GRY714%2Fuploads%2FffdyOtCmoSahcaRn23TP%2FVoxels_xy_check.png?alt=media&amp;token=0ccb48e1-bb97-4036-bf46-bb9a30f22e14" alt=""><figcaption></figcaption></figure>

Z-dimension:

<figure><img src="https://314741292-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWC0t7nEhhoOT73GRY714%2Fuploads%2FFI3VjTnwY7kt552vGGqN%2FVoxels_z_check.png?alt=media&amp;token=27767bfa-d455-4250-a056-4c1fa7da790e" alt=""><figcaption></figcaption></figure>

In general, the selected voxel size should be close to the modality's typical image resolution and not substantially finer than the native acquisition resolution. Upsampling requires&#x20;inference and introduces artificial information, while conversely downsampling to the largest dimension incurs information loss; hence, a good trade-off must be determined.

{% hint style="info" %}
**Based on the plots above, 2x2x2 seems a good trade-off.**
{% endhint %}

**Intensity Checks - CT**

These outputs summarize intensity values inside the tumor ROIs.

They can help identify:

* Suitable re-segmentation ranges
* Appropriate gray-level discretization settings
* Differences in intensity behavior between CT, PET, and MR images

<figure><img src="https://314741292-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWC0t7nEhhoOT73GRY714%2Fuploads%2FXmkVBrAuw77ZJUzg8cDs%2FIntensity_range_check_bw_255.png?alt=media&amp;token=2e98bbdc-6c72-443c-9d45-5c09c078929a" alt=""><figcaption></figcaption></figure>

*The 5th and 95th percentiles are slightly different from that what was found using only 10 patients in the light PoC.*&#x20;

The Hounsfield Unit (HU) Density Scale:

> Our goal is to use the pre-checks plot to exclude all HUs indicating air and bone tissue in the tumor and keep only soft tissue.

{% hint style="info" %}
The HU scale is a quantitative scale used in Computed Tomography (CT) scanning to describe radiodensity, or how easily X-rays pass through different tissues. It provides a standardized way for radiologists to identify tissues, fluids, and abnormalities based on their density.
{% endhint %}

<figure><img src="https://314741292-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWC0t7nEhhoOT73GRY714%2Fuploads%2F3ww7krj9KSfxA8z6SrJ0%2Fimage.png?alt=media&amp;token=32fc9827-8b5e-4bce-b06b-33ad63e75326" alt=""><figcaption><p>The hounsfield unit CT density scale.</p></figcaption></figure>

According to the intensity distribution analysis, 90% of the voxel intensities within the selected ROIs fall between approximately **-85 HU (5th percentile)** and **79 HU (95th percentile)**. In addition, the majority of soft tissues are typically represented by positive Hounsfield Unit values, commonly within the range of approximately **40-100 HU**. We therefore selected a conservative re-segmentation range of **0 to 100 HU**, which captures most of the observed intensity distribution while focusing on values representative of soft tissue. This range also helps reduce the influence of lower-intensity voxels that are less likely to contain clinically relevant tumor information.

{% hint style="info" %}
A **\[0, 100]** HU range is selected.
{% endhint %}

***

**Voxel Checks  - PET**

XY-dimensions:

<figure><img src="https://314741292-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWC0t7nEhhoOT73GRY714%2Fuploads%2FfMVeaB3WTCTb5dF61pqH%2FVoxels_xy_check%201.png?alt=media&amp;token=8050ad4e-b257-4eaf-a2ce-1c2e45b6c402" alt=""><figcaption></figcaption></figure>

Z-dimensions:

<figure><img src="https://314741292-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWC0t7nEhhoOT73GRY714%2Fuploads%2FES3drGY6WDN6yESudIoP%2FVoxels_z_check%201.png?alt=media&amp;token=449de105-428f-437d-b727-a996879e34d3" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
**Based on the plots above, 4x4x4 seems a good trade-off.**
{% endhint %}

**Intensity Checks - PET**

*What values do PET images hold?* The images created from PET scans have bright spots and dark spots. The measurement of brightness is the SUV number. In general, higher SUV numbers may indicate a malignancy, or cancerous growth. [Read more](https://www.mdanderson.org/cancerwise/standardized-uptake-value--suv--numbers-on-pet-scans--what-do-they-mean.h00-159698334.html).

{% hint style="info" %}
In PET radiomics, re-segmentation is commonly used to exclude low-activity voxels that may represent background signal, noise, or non-metabolically active regions. Typical approaches involve defining either a fixed SUV interval (e.g., \[a,b]) or a minimum SUV threshold (e.g., \[a,∞\[) to focus the analysis on biologically relevant tracer uptake.
{% endhint %}

<figure><img src="https://314741292-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWC0t7nEhhoOT73GRY714%2Fuploads%2FZ1erJe6Md2CpGmB7kgRu%2FIntensity_range_check_bw_3.png?alt=media&amp;token=3ffdfaf4-cdae-46da-9308-6d576c9acba5" alt=""><figcaption><p>PET SUV values distribution</p></figcaption></figure>

According to the intensity distribution analysis, 90% of the PET voxel intensities within the selected ROIs fall between approximately **0.42 SUV** and **9.45 SUV**. Since only a small proportion of voxels exhibit values below **1 SUV**, we selected a re-segmentation range of **\[1 SUV, ∞)**. This choice excludes very low-activity voxels while preserving all higher uptake values that may contain prognostic information. In addition, the lower bound of **1 SUV** provides a fixed starting point for **FBS discretization**, improving feature standardization and avoiding the use of ROI-specific minimum intensities as discretization references.

{% hint style="info" %}
A **\[1, ∞\[** SUV range is selected.
{% endhint %}
{% endtab %}
{% endtabs %}

<details>

<summary>Additional processing for raw values</summary>

As discussed in the previous section, **T1 and T2FS MRI modalities were excluded from the voxel intensity distribution analysis used to define re-segmentation ranges**. Unlike CT and PET images, MRI intensities are expressed in arbitrary units and do not have a standardized physical meaning.

To reduce the influence of intensity outliers, we therefore apply the [*Collewet* outlier filtering method](https://doi.org/10.1016/j.mri.2003.09.001) as recommended by the [IBSI guidelines](https://arxiv.org/abs/1612.07003). This method removes voxels with intensities outside the range **μ ± 3σ**, where **μ** is the mean intensity and **σ** is the standard deviation of the voxel intensities within the ROI.

In MEDiml, this can be done by specifying ***Collewet*** as the outlier filtering method in the settings `.json` file:

```json
"reSeg": {
  "range": [],
  "outliers": "Collewet"
},
```

OR, directly in the re-segmentation node, if you are using the single-scan module:

<figure><img src="https://314741292-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWC0t7nEhhoOT73GRY714%2Fuploads%2FADai3oIpIjJaK20DAK7P%2Fimage.png?alt=media&amp;token=bd5a7026-37f5-408e-aa8f-cc634b643ac4" alt=""><figcaption><p>Selecting Collewet as the outliers filtering method in the re-segmentation node</p></figcaption></figure>

</details>

#### Summary

Here is a summary table containing the selected settings:

* Voxel size (per modality)
* Re-segmentation range (if applicable)
* Discretization method and parameters

These settings will be reused throughout the remainder of the POC to ensure a consistent radiomics workflow.

{% hint style="info" %}
Don't worry, you don't have to set these settings yourself for this POC, and we provide a downloadable ready-to-use settings file.
{% endhint %}

| Parameter                | Where is it used? | Light POC                                                                                                                                                                                                                                                 | Full POC                                                                                                                                                                                                                                                         |
| ------------------------ | ----------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Voxel size               | Interpolation     | <ul><li>CT, T1, T2FS: <strong>2x2x2</strong></li><li>PET: <strong>4x4x4</strong></li></ul>                                                                                                                                                                | <ul><li>CT, T1, T2FS: <strong>2x2x2</strong></li><li>PET: <strong>4x4x4</strong></li></ul>                                                                                                                                                                       |
| Re-segmentation range    | Re-segmentation   | <ul><li>CT: <strong>\[0, 100]</strong> HU</li><li>PET: <strong>\[1, ∞\[</strong> SUV</li><li>T1 and T2FS: <strong>Collewet outliers filtering</strong></li></ul>                                                                                          | <ul><li>CT: <strong>\[0, 100]</strong> HU</li><li>PET: <strong>\[1, ∞\[</strong> SUV</li><li>T1 and T2FS: <strong>Collewet outliers filter</strong></li></ul>                                                                                                    |
| Discretization algorithm | Discretization    | <ul><li>CT and PET: <strong>FBN</strong> & <strong>FBS</strong></li><li>T1 and T2FS: <strong>FBN</strong> only</li></ul>                                                                                                                                  | <ul><li>CT and PET: <strong>FBN</strong> & <strong>FBS</strong></li><li>T1 and T2FS: <strong>FBN</strong> only</li></ul>                                                                                                                                         |
| Discretization value     | Discretization    | <ul><li>CT and PET - FBN <strong>8, 16, 32 and 64</strong></li><li>CT - FBS: <strong>12.5, 6.25, 3.125, 1.5625</strong></li><li>PET - FBS: <strong>1.75, 0.875, 0.4375, 0.21875</strong></li><li>T1 and T2FS: <strong>8, 16, 32 and 64</strong></li></ul> | <p></p><ul><li>CT and PET - FBN <strong>8, 16, 32 and 64</strong></li><li>CT - FBS: <strong>12.5, 6.25, 3.125, 1.5625</strong></li><li>PET - FBS: <strong>3.75, 1.875, 0.9375, 0.46875</strong></li><li>T1 and T2FS: <strong>8, 16, 32 and 64</strong></li></ul> |

*We are now ready for the "most radiomic" step in this POC: feature extraction* :fire:*!*
