Skip to content

Commit

Permalink
add a stub function to normalise flow cytometer images
Browse files Browse the repository at this point in the history
  • Loading branch information
metazool committed Oct 3, 2024
1 parent 8f39f39 commit 8e9e2df
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/params.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cluster:
n_clusters: 5

collection: untagged-images-lana
collection: test-upload-alba
12 changes: 12 additions & 0 deletions src/cyto_ml/data/image.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import logging
from io import BytesIO

import numpy as np
import requests
import torch
from PIL import Image
Expand Down Expand Up @@ -40,3 +41,14 @@ def prepare_image(image: Image) -> torch.Tensor:
# Single image, add a batch dimension
tensor_image = tensor_image.unsqueeze(0)
return tensor_image


def normalise_flowlr() -> np.array:
"""Utility function to normalise flow cytometer images.
As output from the flow cytometer, they are 16 bit greyscale,
but all the values are in a low range (max value 1018 across the set)
As recommended by @Kzra, normalise all values by the maximum
Both for display, and before handing to a model.
"""
pass

0 comments on commit 8e9e2df

Please sign in to comment.