File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -60,7 +60,14 @@ def post_transfer_serialem(
6060 data = {
6161 "name" : transferred_file .stem ,
6262 "acquisition_uuid" : environment .acquisition_uuid ,
63- "storage_folder" : str (source ),
63+ "storage_folder" : str (
64+ _atlas_destination (
65+ environment ,
66+ source ,
67+ Path (self ._machine_config .get ("rsync_basepath" , "" )),
68+ )
69+ / "atlas"
70+ ),
6471 },
6572 )
6673
Original file line number Diff line number Diff line change @@ -164,6 +164,7 @@ def post_transfer(
164164 "name" : f"{ environment .visit } -sample-{ environment .samples [images_disc ].sample } " ,
165165 "acquisition_uuid" : environment .acquisition_uuid ,
166166 "register_grid" : True ,
167+ "tag" : dcg_tag ,
167168 },
168169 )
169170
Original file line number Diff line number Diff line change @@ -362,6 +362,7 @@ class AtlasRegistration(BaseModel):
362362 acquisition_uuid : str
363363 storage_folder : str = ""
364364 register_grid : bool = False
365+ tag : str = ""
365366
366367
367368@spa_router .post ("/sessions/{session_id}/register_atlas" )
@@ -379,14 +380,22 @@ def register_atlas(
379380 smartem_client = SmartEMAPIClient (
380381 base_url = machine_config .smartem_api_url , logger = logger
381382 )
382- possible_grids = smartem_client .get_acquisition_grids (
383- atlas_registration_data .acquisition_uuid
384- )
385383 grid_uuid = None
386- for grid in possible_grids :
387- if grid .name == atlas_registration_data .name .replace ("_atlas" , "" ):
388- grid_uuid = grid .uuid
389- break
384+ if atlas_registration_data .tag :
385+ dcg = murfey_db .exec (
386+ select (DataCollectionGroup )
387+ .where (DataCollectionGroup .session_id == session_id )
388+ .where (DataCollectionGroup .tag == atlas_registration_data .tag )
389+ ).one_or_none ()
390+ grid_uuid = dcg .smartem_grid_uuid
391+ else :
392+ possible_grids = smartem_client .get_acquisition_grids (
393+ atlas_registration_data .acquisition_uuid
394+ )
395+ for grid in possible_grids :
396+ if grid .name == atlas_registration_data .name .replace ("_atlas" , "" ):
397+ grid_uuid = grid .uuid
398+ break
390399 if grid_uuid is not None :
391400 atlas_data = AtlasData (
392401 id = atlas_registration_data .name ,
You can’t perform that action at this time.
0 commit comments