Skip to content

Commit

Permalink
Merge pull request #7 from bamf-health/aimi2
Browse files Browse the repository at this point in the history
Aimi2-kidney-ct
  • Loading branch information
GowthamMurugesanBAMF authored Aug 20, 2024
2 parents 462b998 + f7ca2a3 commit 7c5f0fc
Show file tree
Hide file tree
Showing 5 changed files with 885 additions and 673 deletions.
31 changes: 15 additions & 16 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,27 +1,26 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.6.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
exclude_types: [jupyter, csv]
- id: check-yaml
- id: check-merge-conflict
- id: debug-statements
- repo: https://github.com/PyCQA/isort
rev: 5.12.0
hooks:
- id: isort
args: ["--profile", "black", "--filter-files"]
additional_dependencies: [toml]
- repo: https://github.com/psf/black
rev: 23.9.1
hooks:
- id: black-jupyter
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.5.1
rev: v1.11.1
hooks:
- id: mypy
args: ["--implicit-optional"]
additional_dependencies:
[numpy, pydicom, SimpleITK, types-requests, segmentationmetrics]
args: [--implicit-optional]
additional_dependencies: [pydicom, SimpleITK, types-requests]
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.5.6
hooks:
# Run the linter.
- id: ruff
types_or: [python, pyi, jupyter]
args: [--select, I, --fix]
# Run the formatter.
- id: ruff-format
types_or: [python, pyi, jupyter]
24 changes: 13 additions & 11 deletions model_performance.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -38,22 +38,24 @@
"\n",
"warnings.filterwarnings(\"ignore\")\n",
"\n",
"from pathlib import Path\n",
"import requests\n",
"import zipfile\n",
"import io\n",
"import zipfile\n",
"from pathlib import Path\n",
"\n",
"import matplotlib.pyplot as plt\n",
"import numpy as np\n",
"import pandas as pd\n",
"import skimage.measure\n",
"import scipy.stats as stats\n",
"import pydicom\n",
"import pydicom_seg\n",
"import SimpleITK as sitk\n",
"import requests\n",
"import scipy.stats as stats\n",
"import seaborn as sns\n",
"import segmentationmetrics as sm\n",
"import SimpleITK as sitk\n",
"import skimage.measure\n",
"from segmentationmetrics.surface_distance import compute_surface_dice_at_tolerance\n",
"\n",
"from kits_metrics import compute_metrics_for_case\n",
"import matplotlib.pyplot as plt\n",
"import seaborn as sns\n",
"\n",
"sns.set_theme(style=\"whitegrid\")\n",
"%matplotlib inline"
Expand Down Expand Up @@ -101,9 +103,9 @@
"outputs": [],
"source": [
"def download_inference(\n",
" extract_dir=\"qa-results\",record='13244892',filename = 'kidney-ct.zip'\n",
" extract_dir=\"qa-results\", record=\"13244892\", filename=\"kidney-ct.zip\"\n",
"):\n",
" url=f\"https://zenodo.org/record/{record}/files/{filename}\"\n",
" url = f\"https://zenodo.org/record/{record}/files/{filename}\"\n",
" # download the zip file and extract it\n",
" r = requests.get(url)\n",
" z = zipfile.ZipFile(io.BytesIO(r.content))\n",
Expand Down Expand Up @@ -1160,7 +1162,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.4"
"version": "3.11.9"
}
},
"nbformat": 4,
Expand Down
Loading

0 comments on commit 7c5f0fc

Please sign in to comment.