1111
1212from murfey .util .processing_db import (
1313 CTF ,
14- Atlas ,
1514 MotionCorrection ,
16- Movie as ProcessingMovie ,
1715 ParticleClassificationGroup ,
1816 ParticlePicker ,
1917 RelativeIceThickness ,
18+ TiltImageAlignment ,
2019 Tomogram ,
2120)
2221
@@ -440,7 +439,14 @@ class DataCollectionGroup(SQLModel, table=True): # type: ignore
440439 sa_relationship_kwargs = {"cascade" : "delete" },
441440 )
442441 )
443- Atlas : List ["Atlas" ] = Relationship (back_populates = "DataCollectionGroup" )
442+ grid_squares : List ["GridSquare" ] = Relationship (
443+ back_populates = "data_collection_group" ,
444+ sa_relationship_kwargs = {"cascade" : "delete" },
445+ )
446+ search_maps : List ["SearchMap" ] = Relationship (
447+ back_populates = "data_collection_group" ,
448+ sa_relationship_kwargs = {"cascade" : "delete" },
449+ )
444450
445451
446452class NotificationParameter (SQLModel , table = True ): # type: ignore
@@ -480,7 +486,9 @@ class DataCollection(SQLModel, table=True): # type: ignore
480486 processing_jobs : List ["ProcessingJob" ] = Relationship (
481487 back_populates = "data_collection" , sa_relationship_kwargs = {"cascade" : "delete" }
482488 )
483- Movie : List ["ProcessingMovie" ] = Relationship (back_populates = "DataCollection" )
489+ movies : List ["Movie" ] = Relationship (
490+ back_populates = "data_collection" , sa_relationship_kwargs = {"cascade" : "delete" }
491+ )
484492 MotionCorrection : List ["MotionCorrection" ] = Relationship (
485493 back_populates = "DataCollection"
486494 )
@@ -639,6 +647,7 @@ class MurfeyLedger(SQLModel, table=True): # type: ignore
639647class GridSquare (SQLModel , table = True ): # type: ignore
640648 id : Optional [int ] = Field (primary_key = True , default = None )
641649 session_id : int = Field (foreign_key = "session.id" )
650+ atlas_id : Optional [int ] = Field (foreign_key = "data_collection_group.id" )
642651 name : int
643652 tag : str
644653 x_location : Optional [float ]
@@ -650,6 +659,13 @@ class GridSquare(SQLModel, table=True): # type: ignore
650659 thumbnail_size_x : Optional [int ]
651660 thumbnail_size_y : Optional [int ]
652661 pixel_size : Optional [float ] = None
662+ scaled_pixel_size : Optional [float ] = None
663+ pixel_location_x : Optional [int ] = None
664+ pixel_location_y : Optional [int ] = None
665+ height : Optional [int ] = None
666+ width : Optional [int ] = None
667+ angle : Optional [float ] = None
668+ quality_indicator : Optional [float ] = None
653669 image : str = ""
654670 session : Optional [Session ] = Relationship (back_populates = "grid_squares" )
655671 clem_image_series : List ["CLEMImageSeries" ] = Relationship (
@@ -658,6 +674,9 @@ class GridSquare(SQLModel, table=True): # type: ignore
658674 foil_holes : List ["FoilHole" ] = Relationship (
659675 back_populates = "grid_square" , sa_relationship_kwargs = {"cascade" : "delete" }
660676 )
677+ data_collection_group : Optional ["DataCollectionGroup" ] = Relationship (
678+ back_populates = "grid_squares"
679+ )
661680
662681
663682class FoilHole (SQLModel , table = True ): # type: ignore
@@ -674,6 +693,11 @@ class FoilHole(SQLModel, table=True): # type: ignore
674693 thumbnail_size_x : Optional [int ]
675694 thumbnail_size_y : Optional [int ]
676695 pixel_size : Optional [float ] = None
696+ scaled_pixel_size : Optional [float ] = None
697+ pixel_location_x : Optional [int ] = None
698+ pixel_location_y : Optional [int ] = None
699+ diameter : Optional [int ] = None
700+ quality_indicator : Optional [float ] = None
677701 image : str = ""
678702 grid_square : Optional [GridSquare ] = Relationship (back_populates = "foil_holes" )
679703 session : Optional [Session ] = Relationship (back_populates = "foil_holes" )
@@ -688,13 +712,21 @@ class FoilHole(SQLModel, table=True): # type: ignore
688712class SearchMap (SQLModel , table = True ): # type: ignore
689713 id : Optional [int ] = Field (primary_key = True , default = None )
690714 session_id : int = Field (foreign_key = "session.id" )
715+ atlasId : Optional [int ] = Field (foreign_key = "data_collection_group.id" )
691716 name : str
692717 tag : str
693718 x_location : Optional [float ] = None
694719 y_location : Optional [float ] = None
695720 x_stage_position : Optional [float ] = None
696721 y_stage_position : Optional [float ] = None
697722 pixel_size : Optional [float ] = None
723+ scaled_pixel_size : Optional [float ] = None
724+ pixel_location_x : Optional [int ] = None
725+ pixel_location_y : Optional [int ] = None
726+ scaled_height : Optional [int ] = None
727+ scaled_width : Optional [int ] = None
728+ angle : Optional [float ] = None
729+ quality_indicator : Optional [float ] = None
698730 image : str = ""
699731 binning : Optional [float ] = None
700732 reference_matrix_m11 : Optional [float ] = None
@@ -715,17 +747,29 @@ class SearchMap(SQLModel, table=True): # type: ignore
715747 tilt_series : List ["TiltSeries" ] = Relationship (
716748 back_populates = "search_map" , sa_relationship_kwargs = {"cascade" : "delete" }
717749 )
750+ data_collection_group : Optional ["DataCollectionGroup" ] = Relationship (
751+ back_populates = "search_maps"
752+ )
753+ Tomogram : List ["Tomogram" ] = Relationship (back_populates = "SearchMap" )
718754
719755
720756class Movie (SQLModel , table = True ): # type: ignore
721757 murfey_id : int = Field (primary_key = True , foreign_key = "murfeyledger.id" )
722758 foil_hole_id : int = Field (foreign_key = "foilhole.id" , nullable = True , default = None )
759+ data_collection_id : Optional [int ] = Field (foreign_key = "datacollection.id" )
723760 path : str
724761 image_number : int
725762 tag : str
726763 preprocessed : bool = False
764+ createdTimeStamp : Optional [datetime ] = None
765+ movie_full_path : Optional [str ] = None
727766 murfey_ledger : Optional [MurfeyLedger ] = Relationship (back_populates = "movies" )
728767 foil_hole : Optional [FoilHole ] = Relationship (back_populates = "movies" )
768+ data_collection : Optional ["DataCollection" ] = Relationship (back_populates = "movies" )
769+ MotionCorrection : List ["MotionCorrection" ] = Relationship (back_populates = "Movie" )
770+ TiltImageAlignment : List ["TiltImageAlignment" ] = Relationship (
771+ back_populates = "Movie"
772+ )
729773
730774
731775class CtfParameters (SQLModel , table = True ): # type: ignore
0 commit comments