rename tile and add useful getters

This commit is contained in:
2021-07-12 18:39:19 +02:00
parent ffd7c23ca4
commit 5fc4b75b6c
2 changed files with 40 additions and 10 deletions

40
situr/image/situ_tile.py Normal file
View File

@@ -0,0 +1,40 @@
import numpy as np
from situr.image.situ_image import SituImage
class Tile:
'''
* Rounds 5
* Channels 4+1 - spot colours + nuclei
* Z 1 to 30 - focus level
* Y 2048
* X 2048
'''
def __init__(self, file_list, nucleaus_channel=4):
self.images = []
for situ_image_list in file_list:
self.images.append(
SituImage(situ_image_list, nucleaus_channel=nucleaus_channel))
def get_round(self, round_number):
"""This
Args:
round_number (integer): The round number starting with 0
Returns:
SituImage: The image corresponding to the requested round number.
"""
return self.images[id]
def to_numpy_array(self):
tmp_list = []
for image in self.images:
tmp_list.append(image.get_data())
return np.array(tmp_list)
def get_channel(self, round, channel, focus_level=0):
return self.images[round].get_channel(channel, focus_level=focus_level)

View File

@@ -1,10 +0,0 @@
class Tile:
'''
* Rounds 5
* Channels 4+1 - spot colours + nuclei
* Z 1 to 30 - focus level
* Y 2048
* X 2048
'''
def __init__(self):
pass