Skip to content

Commit

Permalink
add Sponsors/SignPath to readme.md
Browse files Browse the repository at this point in the history
  • Loading branch information
mdevans committed Nov 12, 2024
1 parent 2324431 commit f9a0366
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 10 deletions.
Binary file removed assets/ocr/model/craft_mlt_25k.pth
Binary file not shown.
Binary file removed assets/ocr/model/latin_g2.pth
Binary file not shown.
7 changes: 7 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ Select the correct binary download for your platform from the available [release
5. Logs will be written to `~/Logs/Anonymizer/anonymizer.log`
## Documentation
[Help files](https://rsna.github.io/anonymizer)
## Sponsors

<div style="display: flex; align-items: center;">
<img src="src/assets/icons/signpath_logo.svg" alt="SignPath Logo" style="max-height: 40px; margin-right: 10px;">
<p style="margin: 0;">Free code signing on Windows provided by <a href="https://about.signpath.io/">SignPath.io</a>, certificate by <a href="https://signpath.org/">SignPath Foundation</a></p>
</div>

## Development
### Setup
1. Setup python enviroment (>3.10) which includes Tkinter, recommend using pyenv with MacOS & Linux
Expand Down
26 changes: 26 additions & 0 deletions src/assets/icons/signpath_logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 10 additions & 10 deletions src/view/contact_sheet.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
from pathlib import Path
import logging
import pydicom
from pydicom import dcmread
from pydicom.pixel_data_handlers.util import apply_voi_lut, apply_modality_lut
import numpy as np
from PIL import Image
from cv2 import normalize, NORM_MINMAX, equalizeHist
from cv2 import normalize, NORM_MINMAX, CV_8U
import customtkinter as ctk
from utils.storage import get_dcm_files
from utils.translate import _
from io import BytesIO
import tempfile


logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -50,7 +49,7 @@ def _load_patient_image_frames(self, patient_ids):
# Loop through all dicom files for these patient(s):
for dcm_path in dcm_paths:

ds = pydicom.dcmread(dcm_path)
ds = dcmread(dcm_path)

pixels = ds.pixel_array
pi = ds.get("PhotometricInterpretation", None)
Expand Down Expand Up @@ -93,7 +92,6 @@ def _load_kaleidoscopes(self, patient_ids):

total_thumbnails = 0

# Process patients sequentially & display each series belonging to patient as a kaleidoscope:
for patient_id in patient_ids:

patient_path = Path(self._base_dir / patient_id)
Expand All @@ -109,7 +107,7 @@ def _load_kaleidoscopes(self, patient_ids):
all_pixels = []

for dcm_path in dcm_paths:
ds = pydicom.dcmread(dcm_path)
ds = dcmread(dcm_path)
pixels = ds.pixel_array
pi = ds.get("PhotometricInterpretation", None)
if pi is None:
Expand All @@ -123,7 +121,7 @@ def _load_kaleidoscopes(self, patient_ids):
alpha=0,
beta=255,
norm_type=NORM_MINMAX,
dtype=-1,
dtype=CV_8U,
mask=None,
)
pixels = pixels.astype(np.uint8)
Expand All @@ -132,10 +130,12 @@ def _load_kaleidoscopes(self, patient_ids):

no_of_frames = ds.get("NumberOfFrames", 1)
if no_of_frames == 1:
all_pixels.append(pixels)
all_pixels.append(pixels[..., np.newaxis] if pixels.ndim == 2 else pixels)
else:
for frame in range(no_of_frames):
all_pixels.append(pixels[frame])
all_pixels.append(
pixels[frame][..., np.newaxis] if pixels.ndim == 2 else pixels[frame]
)

# Create low, mid, and high contrast images
if all_pixels:
Expand Down

0 comments on commit f9a0366

Please sign in to comment.