Skip to content

Commit

Permalink
fixed bugs that causes test failure
Browse files Browse the repository at this point in the history
  • Loading branch information
Reza Eghbali committed Mar 2, 2024
1 parent 1321a8d commit dcd9ee7
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
- name: Install package
run: |
pip install -e .
pip install -e ".[ants]"
- name: Download models
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:

- name: Install package
run: |
pip install .
pip install -e ".[ants]"
- name: Install test dependencies
run: |
Expand Down
2 changes: 1 addition & 1 deletion pyalfe/tasks/quantification.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ def get_lesion_stats(
np.mean(modality_image[lesion_indices]) / mean_signal
)
if modality_name in [Modality.ADC, Modality.CBF]:
stats[f'relative_min_{modality_name.lower()}_signal'] = (
stats[f'relative_min_{modality_name}_signal'] = (
np.min(modality_image[lesion_indices]) / mean_signal
)
stats[f'min_{modality_name}_signal'] = np.min(
Expand Down
10 changes: 5 additions & 5 deletions tests/unit/test_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -562,9 +562,9 @@ def test_get_lesion_stats_with_label(self):
self.assertEqual(0.5, lesion_stats['relative_T1_signal'])
self.assertEqual(0.75, lesion_stats['relative_T2_signal'])
self.assertEqual(1.25, lesion_stats['relative_ADC_signal'])
self.assertEqual(5.0, lesion_stats['mean_adc_signal'])
self.assertEqual(4.0, lesion_stats['min_adc_signal'])
self.assertEqual(5.0, lesion_stats['median_adc_signal'])
self.assertEqual(5.0, lesion_stats['mean_ADC_signal'])
self.assertEqual(4.0, lesion_stats['min_ADC_signal'])
self.assertEqual(5.0, lesion_stats['median_ADC_signal'])
self.assertEqual(1.5, lesion_stats['relative_T1Post_signal'])
self.assertEqual(1.0, lesion_stats['relative_FLAIR_signal'])
self.assertEqual(1.5, lesion_stats['enhancement'])
Expand Down Expand Up @@ -839,9 +839,9 @@ def test_run(self):
self.assertEqual(3.75, lesion_stats['mean_adc_signal'])
self.assertEqual(0.0, lesion_stats['min_adc_signal'])
self.assertEqual(4.5, lesion_stats['median_adc_signal'])
np.testing.assert_almost_equal(0.6, lesion_stats['five_percentile_adc_signal'])
np.testing.assert_almost_equal(0.6, lesion_stats['five_percentile_ADC_signal'])
np.testing.assert_almost_equal(
lesion_stats['ninety_five_percentile_adc_signal'], 5.85
lesion_stats['ninety_five_percentile_ADC_signal'], 5.85
)
self.assertEqual(1.375, lesion_stats['relative_T1Post_signal'])
self.assertEqual(0.875, lesion_stats['relative_FLAIR_signal'])
Expand Down

0 comments on commit dcd9ee7

Please sign in to comment.