Skip to content
Snippets Groups Projects

Updates for TREC pipelines

Merged Christopher Randolph Rhodes requested to merge int_trec into staging
2 files
+ 16
0
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -3,6 +3,7 @@ import os
from pathlib import Path
import numpy as np
import pandas as pd
from skimage.io import imread, imsave
import czifile
@@ -491,6 +492,18 @@ class PatchStack(InMemoryDataAccessor):
def shape_dict(self):
return dict(zip(('P', 'Y', 'X', 'C', 'Z'), self.data.shape))
@property
def df(self):
df = pd.DataFrame([
{
'label': i,
'area': (self.iat(i).data > 0).sum(),
'sum': self.iat(i).data.sum()
} for i in range(0, self.count)
])
df['intensity_mean'] = df['sum'] / df['area']
return df
def make_patch_stack_from_file(fpath): # interpret t-dimension as patch position
if not Path(fpath).exists():
Loading