Skip to content

Commit 06d97dc

Browse files
authored
Fix for dense parameter selection in the study (#17)
[skip ci]
1 parent 3f5535d commit 06d97dc

File tree

5 files changed

+34
-28
lines changed

5 files changed

+34
-28
lines changed

.github/workflows/build.yml

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,6 @@ jobs:
6666
strategy:
6767
matrix:
6868
include:
69-
- os: ubuntu-22.04
70-
python-version: "3.8"
7169
- os: ubuntu-22.04
7270
python-version: "3.9"
7371
- os: ubuntu-22.04
@@ -76,8 +74,8 @@ jobs:
7674
python-version: "3.11"
7775
- os: ubuntu-22.04
7876
python-version: "3.12"
79-
- os: ubuntu-24.04
80-
python-version: "3.8"
77+
- os: ubuntu-22.04
78+
python-version: "3.13"
8179
- os: ubuntu-24.04
8280
python-version: "3.9"
8381
- os: ubuntu-24.04
@@ -86,28 +84,28 @@ jobs:
8684
python-version: "3.11"
8785
- os: ubuntu-24.04
8886
python-version: "3.12"
89-
- os: windows-2019
90-
python-version: "3.8"
91-
- os: windows-2019
87+
- os: ubuntu-24.04
88+
python-version: "3.13"
89+
- os: windows-2022
9290
python-version: "3.9"
93-
- os: windows-2019
91+
- os: windows-2022
9492
python-version: "3.10"
95-
- os: windows-2019
93+
- os: windows-2022
9694
python-version: "3.11"
97-
- os: windows-2019
98-
python-version: "3.12"
9995
- os: windows-2022
100-
python-version: "3.8"
96+
python-version: "3.12"
10197
- os: windows-2022
98+
python-version: "3.13"
99+
- os: windows-2025
102100
python-version: "3.9"
103-
- os: windows-2022
101+
- os: windows-2025
104102
python-version: "3.10"
105-
- os: windows-2022
103+
- os: windows-2025
106104
python-version: "3.11"
107-
- os: windows-2022
105+
- os: windows-2025
108106
python-version: "3.12"
109-
- os: macos-13
110-
python-version: "3.8"
107+
- os: windows-2025
108+
python-version: "3.13"
111109
- os: macos-13
112110
python-version: "3.9"
113111
- os: macos-13
@@ -120,10 +118,18 @@ jobs:
120118
python-version: "3.10"
121119
- os: macos-14
122120
python-version: "3.11"
121+
- os: macos-14
122+
python-version: "3.12"
123+
- os: macos-14
124+
python-version: "3.13"
123125
- os: macos-15
124126
python-version: "3.10"
125127
- os: macos-15
126128
python-version: "3.11"
129+
- os: macos-15
130+
python-version: "3.12"
131+
- os: macos-15
132+
python-version: "3.13"
127133

128134
steps:
129135
- name: Set up Python ${{ matrix.python-version }}

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Segmentation validation and metrics computation backend for Raidionics related publications
22

33
[![License](https://img.shields.io/badge/License-BSD%202--Clause-orange.svg)](https://opensource.org/licenses/BSD-2-Clause)
4-
[![](https://img.shields.io/badge/python-3.8|3.9|3.10|3.11|3.12-blue.svg)](https://www.python.org/downloads/)
4+
[![](https://img.shields.io/badge/python-3.9|3.10|3.11|3.12|3.13-blue.svg)](https://www.python.org/downloads/)
55
[![Paper](https://zenodo.org/badge/DOI/10.3389/fneur.2022.932219.svg)](https://www.frontiersin.org/articles/10.3389/fneur.2022.932219/full)
66
[![codecov](https://codecov.io/gh/dbouget/validation_metrics_computation/branch/master/graph/badge.svg?token=ZSPQVR7RKX)](https://codecov.io/gh/dbouget/validation_metrics_computation)
77
[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/gist/dbouget/491b0d34e3df00e730cd7fe7a8989202/compute_validation_example.ipynb)
@@ -15,6 +15,8 @@ the only hard requirement is the expected folder structure to use as input.
1515
## [Installation](https://github.com/dbouget/validation_metrics_computation#installation)
1616

1717
```
18+
pip install raidionicsval
19+
or
1820
pip install git+https://github.com/dbouget/validation_metrics_computation.git
1921
```
2022

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "raidionicsval"
7-
version = "1.1.0"
7+
version = "1.1.1"
88
description = "Raidionics backend for running validation and metrics computation"
99
readme = "README.md"
1010
license = { text = "BSD-2-Clause" }
11-
requires-python = ">=3.8"
11+
requires-python = ">=3.9"
1212
authors = [{ name = "David Bouget", email = "david.bouget@sintef.no" }]
1313

1414
dependencies = [

raidionicsval/Studies/AbstractStudy.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ def compute_and_plot_metric_over_metric_categories(self, class_name: str, metric
379379
cat_optimal_results = total_optimal_results.loc[total_optimal_results[metric2] <= cutoff]
380380
optimal_results_per_cutoff['<=' + str(cutoff)] = cat_optimal_results
381381
else:
382-
cat_optimal_results = total_optimal_results.loc[metric2_cutoffs[c-1] < total_optimal_results[metric2] <= cutoff]
382+
cat_optimal_results = total_optimal_results.loc[(total_optimal_results[metric2] > metric2_cutoffs[c-1]) & (total_optimal_results[metric2] <= cutoff)]
383383
optimal_results_per_cutoff[']' + str(metric2_cutoffs[c-1]) + ',' + str(cutoff) + ']'] = cat_optimal_results
384384
cat_optimal_results = total_optimal_results.loc[total_optimal_results[metric2] > metric2_cutoffs[-1]]
385385
optimal_results_per_cutoff['>' + str(metric2_cutoffs[-1])] = cat_optimal_results
@@ -738,7 +738,7 @@ def compute_and_plot_metric_over_metric_cascading_categories(self, class_name: s
738738
cat_optimal_results = total_optimal_results.loc[total_optimal_results[metric2] <= cutoff]
739739
new_data_per_complete_selection[metric2 + '<=' + str(cutoff)] = cat_optimal_results
740740
else:
741-
cat_optimal_results = total_optimal_results.loc[metric2_cutoffs[c-1] < total_optimal_results[metric2] <= cutoff]
741+
cat_optimal_results = total_optimal_results.loc[(total_optimal_results[metric2] > metric2_cutoffs[c-1]) & (total_optimal_results[metric2] <= cutoff)]
742742
new_data_per_complete_selection[metric2 + ']' + str(metric2_cutoffs[c-1]) + ',' + str(cutoff) + ']'] = cat_optimal_results
743743
cat_optimal_results = total_optimal_results.loc[total_optimal_results[metric2] > metric2_cutoffs[-1]]
744744
new_data_per_complete_selection[metric2 + '>' + str(metric2_cutoffs[-1])] = cat_optimal_results
@@ -750,8 +750,7 @@ def compute_and_plot_metric_over_metric_cascading_categories(self, class_name: s
750750
cat_optimal_results = results_pool.loc[results_pool[metric2] <= cutoff]
751751
new_data_per_complete_selection[sel + ';' + metric2 + '<=' + str(cutoff)] = cat_optimal_results
752752
else:
753-
cat_optimal_results = results_pool.loc[
754-
metric2_cutoffs[c - 1] < results_pool[metric2] <= cutoff]
753+
cat_optimal_results = results_pool.loc[(results_pool[metric2] > metric2_cutoffs[c - 1]) & (results_pool[metric2] <= cutoff)]
755754
new_data_per_complete_selection[sel + ';' + metric2 +
756755
']' + str(metric2_cutoffs[c - 1]) + ',' + str(cutoff) + ']'] = cat_optimal_results
757756
cat_optimal_results = results_pool.loc[

tests/generic_tests/test_studies_pipeline.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import traceback
88

99

10-
def test_validation_pipeline_package(test_dir):
10+
def test_studies_pipeline_package(test_dir):
1111
logging.basicConfig()
1212
logging.getLogger().setLevel(logging.DEBUG)
1313
logging.info("Running standard reporting unit test.\n")
@@ -63,7 +63,7 @@ def test_validation_pipeline_package(test_dir):
6363
val_config.set('Studies', 'extra_parameters_filename', os.path.join(test_dir, 'Patient1',
6464
'Predictions',
6565
'external_patient_parameters.csv'))
66-
val_config.set('Studies', 'selections_dense', "PiW Dice,GT volume (ml),4,TP")
66+
val_config.set('Studies', 'selections_dense', "PiW Dice,GT volume (ml),2-4-8,TP")
6767
config_filename = os.path.join(output_folder, 'config.ini')
6868
with open(config_filename, 'w') as outfile:
6969
val_config.write(outfile)
@@ -83,5 +83,4 @@ def test_validation_pipeline_package(test_dir):
8383

8484
logging.info("k-fold cross-validation unit test succeeded.\n")
8585
if os.path.exists(output_folder):
86-
shutil.rmtree(output_folder)
87-
86+
shutil.rmtree(output_folder)

0 commit comments

Comments
 (0)