5757 SPARelionParameters ,
5858 Tilt ,
5959 TiltSeries ,
60- TomographyPreprocessingParameters ,
6160 TomographyProcessingParameters ,
6261)
6362from murfey .util .models import (
7069 GainReference ,
7170 GridSquareParameters ,
7271 PostInfo ,
73- PreprocessingParametersTomo ,
7472 ProcessingJobParameters ,
7573 ProcessingParametersSPA ,
7674 ProcessingParametersTomo ,
@@ -476,9 +474,9 @@ def register_spa_proc_params(
476474 db .commit ()
477475
478476
479- @router .post ("/sessions/{session_id}/tomography_preprocessing_parameters " )
480- def register_tomo_preproc_params (
481- session_id : MurfeySessionID , proc_params : PreprocessingParametersTomo , db = murfey_db
477+ @router .post ("/sessions/{session_id}/tomography_processing_parameters " )
478+ def register_tomo_proc_params (
479+ session_id : MurfeySessionID , proc_params : ProcessingParametersTomo , db = murfey_db
482480):
483481 log .info (
484482 f"Registering tomography preprocessing parameters { sanitise (proc_params .tag )} , { sanitise (proc_params .tilt_series_tag )} "
@@ -499,68 +497,19 @@ def register_tomo_preproc_params(
499497 .where (ProcessingJob .recipe == "em-tomo-preprocess" )
500498 ).one ()
501499 if not db .exec (
502- select (func .count (TomographyPreprocessingParameters .dcg_id )).where (
503- TomographyPreprocessingParameters .dcg_id == collected_ids [0 ].id
500+ select (func .count (TomographyProcessingParameters .dcg_id )).where (
501+ TomographyProcessingParameters .dcg_id == collected_ids [0 ].id
504502 )
505503 ).one ():
506- params = TomographyPreprocessingParameters (
504+ params = TomographyProcessingParameters (
507505 dcg_id = collected_ids [0 ].id ,
508506 pixel_size = proc_params .pixel_size_on_image ,
509507 dose_per_frame = proc_params .dose_per_frame ,
510508 gain_ref = proc_params .gain_ref ,
511509 motion_corr_binning = proc_params .motion_corr_binning ,
512510 voltage = proc_params .voltage ,
513- # manual_tilt_offset=proc_params.manual_tilt_offset,
514511 )
515512 db .add (params )
516- if not db .exec (
517- select (func .count (TomographyProcessingParameters .pj_id )).where (
518- TomographyProcessingParameters .pj_id == collected_ids [2 ].id
519- )
520- ).one ():
521- tomogram_params = TomographyProcessingParameters (
522- pj_id = collected_ids [2 ].id , manual_tilt_offset = proc_params .manual_tilt_offset
523- )
524- db .add (tomogram_params )
525- db .commit ()
526- db .close ()
527-
528-
529- @router .post ("/clients/{client_id}/tomography_processing_parameters" )
530- def register_tomo_proc_params (
531- client_id : int , proc_params : ProcessingParametersTomo , db = murfey_db
532- ):
533- client = db .exec (
534- select (ClientEnvironment ).where (ClientEnvironment .client_id == client_id )
535- ).one ()
536- session_id = client .session_id
537- log .info (
538- f"Registering tomography processing parameters { sanitise (proc_params .tag )} , { sanitise (proc_params .tilt_series_tag )} , { session_id } "
539- )
540- collected_ids = db .exec (
541- select (
542- DataCollectionGroup ,
543- DataCollection ,
544- ProcessingJob ,
545- AutoProcProgram ,
546- )
547- .where (DataCollectionGroup .session_id == session_id )
548- .where (DataCollectionGroup .tag == proc_params .tag )
549- .where (DataCollection .tag == proc_params .tilt_series_tag )
550- .where (DataCollection .dcg_id == DataCollectionGroup .id )
551- .where (ProcessingJob .dc_id == DataCollection .id )
552- .where (AutoProcProgram .pj_id == ProcessingJob .id )
553- .where (ProcessingJob .recipe == "em-tomo-preprocess" )
554- ).one ()
555- if not db .exec (
556- select (func .count (TomographyProcessingParameters .pj_id )).where (
557- TomographyProcessingParameters .pj_id == collected_ids [2 ].id
558- )
559- ).one ():
560- tomogram_params = TomographyProcessingParameters (
561- pj_id = collected_ids [2 ].id , manual_tilt_offset = proc_params .manual_tilt_offset
562- )
563- db .add (tomogram_params )
564513 db .commit ()
565514 db .close ()
566515
0 commit comments