add tile registration, however no all methods are implemented yet

This commit is contained in:
2021-07-14 11:03:16 +02:00
parent 1d0385e2f3
commit 193dc059a5
3 changed files with 41 additions and 1 deletions

View File

@@ -21,10 +21,18 @@ class Tile:
SituImage(situ_image_list, nucleaus_channel=nucleaus_channel)) SituImage(situ_image_list, nucleaus_channel=nucleaus_channel))
self.round_transformations.append(IdentityRoundTransform()) self.round_transformations.append(IdentityRoundTransform())
def apply_transformations(): def apply_transformations(self):
# TODO: implement (first apply channel transformations then round transformations) # TODO: implement (first apply channel transformations then round transformations)
pass pass
def apply_channel_transformations(self):
# TODO: implement
pass
def apply_round_transformations(self):
# TODO: implement
pass
def get_image_round(self, round): def get_image_round(self, round):
return self.images[round] return self.images[round]

View File

@@ -1 +1,4 @@
from .registration import Registration, RegistrationFunction, FilterregRegistrationFunction from .registration import Registration, RegistrationFunction, FilterregRegistrationFunction
from .channel_registration import ChannelRegistration
from .round_registration import RoundRegistration
from .tile_registration import TileRegistration

View File

@@ -0,0 +1,29 @@
from situr.image.situ_tile import Tile
from situr.registration import RoundRegistration, ChannelRegistration, round_registration
class CombinedRegistration:
def __init__(self, round_registration: RoundRegistration = RoundRegistration(), channel_registration: ChannelRegistration = ChannelRegistration(), reference_channel=0) -> None:
self.round_registration = round_registration
self.channel_registration = channel_registration
def do_registration_and_transform(self, tile: Tile):
""" This function applies the registration in the following order:
1. Register the channels for each round of each tile.
2. Apply transformations
3. Register the rounds
4. Apply transformation
Args:
tile (Tile): The tile that the registration and transformations are to be performed on.
"""
# Do channel registration
for round in range(tile.get_roundcount()):
img = tile.get_image_round(round)
self.channel_registration
tile.apply_channel_transformations()
round_registration.do_round_registration(tile)
tile.apply_round_transformations()