mirror of
https://github.com/13hannes11/situr.git
synced 2024-09-03 20:50:58 +02:00
add tile registration, however no all methods are implemented yet
This commit is contained in:
@@ -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]
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
29
situr/registration/tile_registration.py
Normal file
29
situr/registration/tile_registration.py
Normal 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()
|
||||||
Reference in New Issue
Block a user