/*********************************************************************** key_check.c ********************************************************************** Description: These routines review the flags tied to required keywords by either the specification (or RTOG 3-D QA Center requirements). Contains the following routines: key_check_ct() ensure required keywords in ct directory key_check_mrus() ensure required keywords in MR/US directory key_check_anat() ensure required keywords in structure directory key_check_beam() ensure required keywords in beam directory key_check_film() ensure required keywords in film directory key_check_dose() ensure required keywords in dose directory key_check_dvh() ensure required keywords in dvh directory ************************ Revision History: $Log: key_check.c,v $ * Revision 1.1 2000/01/14 22:51:17 jwm * Remove comments originating in other development trees * * Revision 1.0 2000/01/14 22:28:20 jwm * Initial revision =====================================================================*/ /* Include Files */ #include #include #include #include #include #include #include #include #include "sitedata.h" #define NOT_MAIN #include "exchkeys.h" #include "patexchange.h" /***************************************************************************** key_check_ct() **************************************************************************** Functional Description: Reviews all defined key flags to verify that all required directory entries have been provided. If any are missing, an error message is printed for each one and FAILURE is returned. Returns SUCCESS or FAILURE on an error. ***************************************************************************/ int key_check_ct ( ctscan_t *ct /* CT SCAN DATA STRUCTURE */ ) { int retval; /* RETURN VALUE (SUCCESS | FAILURE) */ /* INIIALIZE TO SUCCESS */ retval = SUCCESS; /* CHECK ALL FLAGS */ if ( ct->ct_flags.scan_f != 1 ) { sprintf( aapm_log_string, "[CT IMAGE] Scan type entry missing" ); aapm_status( eAAPM_ERROR, aapm_log_string ); retval = FAILURE; } if ( ct->ct_flags.offset_f != 1 ) { sprintf( aapm_log_string, "[CT IMAGE] CT offset entry missing" ); aapm_status( eAAPM_ERROR, aapm_log_string ); retval = FAILURE; } if ( ct->ct_flags.grid1_f != 1 ) { sprintf( aapm_log_string, "[CT IMAGE] Grid units 1 entry missing" ); aapm_status( eAAPM_ERROR, aapm_log_string ); retval = FAILURE; } if ( ct->ct_flags.grid2_f != 1 ) { sprintf( aapm_log_string, "[CT IMAGE] Grid units 2 entry missing" ); aapm_status( eAAPM_ERROR, aapm_log_string ); retval = FAILURE; } if ( ct->ct_flags.number_f != 1 ) { sprintf( aapm_log_string, "[CT IMAGE] Number representation entry missing" ); aapm_status( eAAPM_ERROR, aapm_log_string ); retval = FAILURE; } if ( ct->ct_flags.bytes_f != 1 ) { sprintf( aapm_log_string, "[CT IMAGE] Bytes per pixel entry missing" ); aapm_status( eAAPM_ERROR, aapm_log_string ); retval = FAILURE; } if ( ct->ct_flags.num_dim_f != 1 ) { sprintf( aapm_log_string, "[CT IMAGE] Number of dimensions entry missing" ); aapm_status( eAAPM_ERROR, aapm_log_string ); retval = FAILURE; } if ( ct->ct_flags.siz_dim1_f != 1 ) { sprintf( aapm_log_string, "[CT IMAGE] Size of dimension 1 entry missing" ); aapm_status( eAAPM_ERROR, aapm_log_string ); retval = FAILURE; } if ( ct->ct_flags.siz_dim2_f != 1 ) { sprintf( aapm_log_string, "[CT IMAGE] Size of dimension 2 entry missing" ); aapm_status( eAAPM_ERROR, aapm_log_string ); retval = FAILURE; } if ( ct->ct_flags.z_value_f != 1 ) { sprintf( aapm_log_string, "[CT IMAGE] Z value entry missing" ); aapm_status( eAAPM_ERROR, aapm_log_string ); retval = FAILURE; } if ( ct->ct_flags.x_offset_f != 1 ) { sprintf( aapm_log_string, "[CT IMAGE] X offset entry missing" ); aapm_status( eAAPM_ERROR, aapm_log_string ); retval = FAILURE; } if ( ct->ct_flags.y_offset_f != 1 ) { sprintf( aapm_log_string, "[CT IMAGE] Y offset entry missing" ); aapm_status( eAAPM_ERROR, aapm_log_string ); retval = FAILURE; } if ( ct->image_source != eSECONDARYCAPTURE ) { if ( ct->ct_flags.ct_air_f != 1 ) { sprintf( aapm_log_string, "[CT IMAGE] CT air entry missing" ); aapm_status( eAAPM_ERROR, aapm_log_string ); retval = FAILURE; } if ( ct->ct_flags.ct_water_f != 1 ) { sprintf( aapm_log_string, "[CT IMAGE] CT water entry missing" ); aapm_status( eAAPM_ERROR, aapm_log_string ); retval = FAILURE; } if ( ct->pixel_length != ct->pixel_width ) { sprintf( aapm_log_string, "CT pixels not square" ); aapm_status( eAAPM_ERROR, aapm_log_string ); return( FAILURE ); } } /* ANY RTOG SPECIFIC FLAGS SHOULD BE CHECK HERE */ #ifdef RTOG #endif /* RETURN THE APPROPRIATE VALUE */ return( retval ); } /***************************************************************************** key_check_mrus() **************************************************************************** Functional Description: Reviews all defined key flags to verify that all required directory entries have been provided. If any are missing, an error message is printed for each one and FAILURE is returned. Returns SUCCESS or FAILURE on an error. ***************************************************************************/ int key_check_mrus ( mrusscan_t *mrus /* CT SCAN DATA STRUCTURE */ ) { int retval; /* RETURN VALUE (SUCCESS | FAILURE) */ /* INIIALIZE TO SUCCESS */ retval = SUCCESS; /* CHECK ALL FLAGS */ if ( mrus->mrus_flags.scan_f != 1 ) { sprintf( aapm_log_string, "[MR/US IMAGE] Scan type entry missing" ); aapm_status( eAAPM_ERROR, aapm_log_string ); retval = FAILURE; } if ( mrus->mrus_flags.offset_f != 1 ) { sprintf( aapm_log_string, "[MR/US IMAGE] pixel offset entry missing" ); aapm_status( eAAPM_ERROR, aapm_log_string ); retval = FAILURE; } if ( mrus->mrus_flags.grid1_f != 1 ) { sprintf( aapm_log_string, "[MR/US IMAGE] Grid units 1 entry missing" ); aapm_status( eAAPM_ERROR, aapm_log_string ); retval = FAILURE; } if ( mrus->mrus_flags.grid2_f != 1 ) { sprintf( aapm_log_string, "[MR/US IMAGE] Grid units 2 entry missing" ); aapm_status( eAAPM_ERROR, aapm_log_string ); retval = FAILURE; } if ( mrus->mrus_flags.number_f != 1 ) { sprintf( aapm_log_string, "[MR/US IMAGE] Number representation entry missing" ); aapm_status( eAAPM_ERROR, aapm_log_string ); retval = FAILURE; } if ( mrus->mrus_flags.bytes_f != 1 ) { sprintf( aapm_log_string, "[MR/US IMAGE] Bytes per pixel entry missing" ); aapm_status( eAAPM_ERROR, aapm_log_string ); retval = FAILURE; } if ( mrus->mrus_flags.num_dim_f != 1 ) { sprintf( aapm_log_string, "[MR/US IMAGE] Number of dimensions entry missing" ); aapm_status( eAAPM_ERROR, aapm_log_string ); retval = FAILURE; } if ( mrus->mrus_flags.siz_dim1_f != 1 ) { sprintf( aapm_log_string, "[MR/US IMAGE] Size of dimension 1 entry missing" ); aapm_status( eAAPM_ERROR, aapm_log_string ); retval = FAILURE; } if ( mrus->mrus_flags.siz_dim2_f != 1 ) { sprintf( aapm_log_string, "[MR/US IMAGE] Size of dimension 2 entry missing" ); aapm_status( eAAPM_ERROR, aapm_log_string ); retval = FAILURE; } if ( mrus->mrus_flags.z_value_f != 1 ) { sprintf( aapm_log_string, "[MR/US IMAGE] Z value entry missing" ); aapm_status( eAAPM_ERROR, aapm_log_string ); retval = FAILURE; } if ( mrus->mrus_flags.x_offset_f != 1 ) { sprintf( aapm_log_string, "[MR/US IMAGE] X offset entry missing" ); aapm_status( eAAPM_ERROR, aapm_log_string ); retval = FAILURE; } if ( mrus->mrus_flags.y_offset_f != 1 ) { sprintf( aapm_log_string, "[MR/US IMAGE] Y offset entry missing" ); aapm_status( eAAPM_ERROR, aapm_log_string ); retval = FAILURE; } if ( mrus->image_source != eSECONDARYCAPTURE ) { if ( mrus->pixel_length != mrus->pixel_width ) { sprintf( aapm_log_string, "MR/US pixels not square" ); aapm_status( eAAPM_ERROR, aapm_log_string ); return( FAILURE ); } } /* ANY RTOG SPECIFIC FLAGS SHOULD BE CHECK HERE */ #ifdef RTOG #endif /* RETURN THE APPROPRIATE VALUE */ return( retval ); } /***************************************************************************** key_check_anat() **************************************************************************** Functional Description: Reviews all defined key flags to verify that all required directory entries have been provided. If any are missing, an error message is printed for each one and FAILURE is returned. Returns SUCCESS or FAILURE on an error. ***************************************************************************/ int key_check_anat ( structure_t *structure /* ANATOMIC STRUCTURE DATA STRUCTURE */ ) { int retval; /* RETURN VALUE (SUCCESS | FAILURE) */ /* INIIALIZE TO SUCCESS */ retval = SUCCESS; /* CHECK ALL FLAGS */ if ( structure->struct_flags.struct_name_f != 1 ) { sprintf( aapm_log_string, "[STRUCTURE] Name entry missing" ); aapm_status( eAAPM_ERROR, aapm_log_string ); retval = FAILURE; } if ( structure->struct_flags.number_f != 1 ) { sprintf( aapm_log_string, "[STRUCTURE] Number represenation entry missing" ); aapm_status( eAAPM_ERROR, aapm_log_string ); retval = FAILURE; } if ( structure->struct_flags.base_f != 1 ) { sprintf( aapm_log_string, "[STRUCTURE] Format entry missing" ); aapm_status( eAAPM_ERROR, aapm_log_string ); retval = FAILURE; } if ( structure->struct_flags.n_scans_f != 1 ) { sprintf( aapm_log_string, "[STRUCTURE] Number of scans entry missing" ); aapm_status( eAAPM_ERROR, aapm_log_string ); retval = FAILURE; } if ( structure->struct_flags.max_scans_f != 1 ) { sprintf( aapm_log_string, "[STRUCTURE] Maximum number of scans entry missing" ); aapm_status( eAAPM_ERROR, aapm_log_string ); retval = FAILURE; } if ( structure->struct_flags.max_pts_f != 1 ) { sprintf( aapm_log_string, "[STRUCTURE] Maximum # of points entry missing" ); aapm_status( eAAPM_ERROR, aapm_log_string ); retval = FAILURE; } if ( structure->struct_flags.max_seg_f != 1 ) { sprintf( aapm_log_string, "[STRUCTURE] Maximum # of segments entry missing" ); aapm_status( eAAPM_ERROR, aapm_log_string ); retval = FAILURE; } /* ANY RTOG SPECIFIC FLAGS SHOULD BE CHECK HERE */ #ifdef RTOG #endif /* RETURN THE APPROPRIATE VALUE */ return( retval ); } /***************************************************************************** key_check_beam() **************************************************************************** Functional Description: Reviews all defined key flags to verify that all required directory entries have been provided. If any are missing, an error message is printed for each one and FAILURE is returned. Returns SUCCESS or FAILURE on an error. ***************************************************************************/ int key_check_beam ( beamgeom_t *beam /* BEAM DATA STRUCTURE */ ) { int retval; /* RETURN VALUE (SUCCESS | FAILURE) */ /* INIIALIZE TO SUCCESS */ retval = SUCCESS; /* CHECK ALL FLAGS */ if ( beam->beam_flags.beam_num_f != 1 ) { sprintf( aapm_log_string, "[BEAM] Number entry missing" ); aapm_status( eAAPM_ERROR, aapm_log_string ); retval = FAILURE; } if ( beam->beam_flags.modality_f != 1 ) { sprintf( aapm_log_string, "[BEAM] Modality entry missing" ); aapm_status( eAAPM_ERROR, aapm_log_string ); retval = FAILURE; } if ( beam->beam_flags.energy_f != 1 ) { sprintf( aapm_log_string, "[BEAM] Energy entry missing" ); aapm_status( eAAPM_ERROR, aapm_log_string ); retval = FAILURE; } if ( beam->beam_flags.beam_des_f != 1 ) { sprintf( aapm_log_string, "[BEAM] Description entry missing" ); aapm_status( eAAPM_ERROR, aapm_log_string ); retval = FAILURE; } if ( beam->beam_flags.dose_p_tx_f != 1 ) { sprintf( aapm_log_string, "[BEAM] Dose per tx (Gy) entry missing" ); aapm_status( eAAPM_ERROR, aapm_log_string ); retval = FAILURE; } if ( beam->beam_flags.number_tx_f != 1 ) { sprintf( aapm_log_string, "[BEAM] Number of tx entry missing" ); aapm_status( eAAPM_ERROR, aapm_log_string ); retval = FAILURE; } if ( beam->beam_flags.fraction_id_f != 1 ) { sprintf( aapm_log_string, "[BEAM] Fraction group ID entry missing" ); aapm_status( eAAPM_ERROR, aapm_log_string ); retval = FAILURE; } if ( beam->beam_flags.beamtype_f != 1 ) { sprintf( aapm_log_string, "[BEAM] Beam type entry missing" ); aapm_status( eAAPM_ERROR, aapm_log_string ); retval = FAILURE; } if ( beam->beam_flags.coll_typ_f != 1 ) { sprintf( aapm_log_string, "[BEAM] Collimator type entry missing" ); aapm_status( eAAPM_ERROR, aapm_log_string ); retval = FAILURE; } if ( beam->beam_flags.aper_typ_f != 1 ) { sprintf( aapm_log_string, "[BEAM] Aperture type entry missing" ); aapm_status( eAAPM_ERROR, aapm_log_string ); retval = FAILURE; } /* DISABLE FOR VERSION 3.21 if ( beam->beam_flags.plan_id_f != 1 ) { sprintf( aapm_log_string, "[BEAM] Plan id entry missing" ); aapm_status( eAAPM_ERROR, aapm_log_string ); retval = FAILURE; } if ( beam->beam_flags.aper_des_f != 1 ) { sprintf( aapm_log_string, "[BEAM] Aperture description entry missing" ); aapm_status( eAAPM_ERROR, aapm_log_string ); retval = FAILURE; } */ if ( beam->beam_flags.coll_ang_f != 1 ) { sprintf( aapm_log_string, "[BEAM] Collimator angle entry missing" ); aapm_status( eAAPM_ERROR, aapm_log_string ); retval = FAILURE; } if ( beam->beam_flags.gantry_ang_f != 1 ) { sprintf( aapm_log_string, "[BEAM] Gantry angle entry missing" ); aapm_status( eAAPM_ERROR, aapm_log_string ); retval = FAILURE; } if ( beam->beam_flags.couch_ang_f != 1 ) { sprintf( aapm_log_string, "[BEAM] Couch angle entry missing" ); aapm_status( eAAPM_ERROR, aapm_log_string ); retval = FAILURE; } if ( beam->beam_flags.iso_dist_f != 1 ) { sprintf( aapm_log_string, "[BEAM] Isocenter distance entry missing" ); aapm_status( eAAPM_ERROR, aapm_log_string ); retval = FAILURE; } if ( beam->beam_flags.number_f != 1 ) { sprintf( aapm_log_string, "[BEAM] Number representation entry missing" ); aapm_status( eAAPM_ERROR, aapm_log_string ); retval = FAILURE; } /* CHECK ON ARC */ if ( beam->beamtype == eARC && beam->arc_angle == 0.0 ) { sprintf( aapm_log_string, "No arc angle specified for arc beam" ); aapm_status( eAAPM_ERROR, aapm_log_string ); retval = FAILURE; } /* ANY RTOG SPECIFIC FLAGS SHOULD BE CHECK HERE */ #ifdef RTOG #endif /* RETURN THE APPROPRIATE VALUE */ return( retval ); } /*********************************************************************** key_check_seed() ********************************************************************** Functional Description: Reviews all defined key flags to verify that all required directory entries have been provided. If any are missing, an error message is printed for each one and FAILURE is returned. Returns SUCCESS or FAILURE on an error. *********************************************************************/ int key_check_seed ( seeddata_t *seedgeom /* SEED GEOMETRY DATA STRUCTURE */ ) { int retval; /* RETURN VALUE (SUCCESS | FAILURE) */ /* INIIALIZE TO SUCCESS */ retval = SUCCESS; if ( seedgeom->seed_flags.model_f != 1 ) { sprintf( aapm_log_string, "Seed model entry missing" ); aapm_status( eAAPM_ERROR, aapm_log_string ); retval = FAILURE; } if ( seedgeom->seed_flags.isotope_f != 1 ) { sprintf( aapm_log_string, "Seed isotope entry missing" ); aapm_status( eAAPM_ERROR, aapm_log_string ); retval = FAILURE; } if ( seedgeom->seed_flags.strength_f != 1 ) { sprintf( aapm_log_string, "Seed strength entry missing" ); aapm_status( eAAPM_ERROR, aapm_log_string ); retval = FAILURE; } if ( seedgeom->seed_flags.units_f != 1 ) { sprintf( aapm_log_string, "Seed strength units entry missing" ); aapm_status( eAAPM_ERROR, aapm_log_string ); retval = FAILURE; } if ( seedgeom->seed_flags.date_f != 1 ) { sprintf( aapm_log_string, "Date of implant entry missing" ); aapm_status( eAAPM_ERROR, aapm_log_string ); retval = FAILURE; } if ( seedgeom->seed_flags.nseeds_f != 1 ) { sprintf( aapm_log_string, "# of seeds in implant entry missing" ); aapm_status( eAAPM_ERROR, aapm_log_string ); retval = FAILURE; } if ( seedgeom->seed_flags.number_f != 1 ) { sprintf( aapm_log_string, "[SEED] Number representation entry missing" ); aapm_status( eAAPM_ERROR, aapm_log_string ); retval = FAILURE; } if ( seedgeom->seed_flags.plan_id_f != 1 ) { sprintf( aapm_log_string, "[SEED] Plan id entry missing" ); aapm_status( eAAPM_ERROR, aapm_log_string ); retval = FAILURE; } /* ANY RTOG SPECIFIC FLAGS SHOULD BE CHECK HERE */ #ifdef RTOG #endif /* RETURN THE APPROPRIATE VALUE */ return( retval ); } /***************************************************************************** key_check_film() **************************************************************************** Functional Description: Reviews all defined key flags to verify that all required directory entries have been provided. If any are missing, an error message is printed for each one and FAILURE is returned. Returns SUCCESS or FAILURE on an error. ***************************************************************************/ int key_check_film ( film_t *film /* FILM DATA STRUCTURE */ ) { int retval; /* RETURN VALUE (SUCCESS | FAILURE) */ /* INIIALIZE TO SUCCESS */ retval = SUCCESS; /* CHECK ALL FLAGS */ if ( film->film_flags.beam_num_f != 1 || film->film_flags.beam_des_f != 1 ) { if ( film->film_flags.filmdesc_f != 1 ) { sprintf( aapm_log_string, "[FILM] Beam number or description entry missing" ); aapm_status( eAAPM_ERROR, aapm_log_string ); retval = FAILURE; } } if ( film->film_flags.film_num_f != 1 ) { sprintf( aapm_log_string, "[FILM] Film number entry missing" ); aapm_status( eAAPM_ERROR, aapm_log_string ); retval = FAILURE; } if ( film->film_flags.film_date_f != 1 ) { sprintf( aapm_log_string, "[FILM] Film date entry missing" ); aapm_status( eAAPM_ERROR, aapm_log_string ); retval = FAILURE; } if ( film->film_flags.film_type_f != 1 ) { sprintf( aapm_log_string, "[FILM] Film type entry missing" ); aapm_status( eAAPM_ERROR, aapm_log_string ); retval = FAILURE; } if ( film->film_flags.num_dim_f != 1 ) { sprintf( aapm_log_string, "[FILM] Number of dimensions entry missing" ); aapm_status( eAAPM_ERROR, aapm_log_string ); retval = FAILURE; } if ( film->film_flags.siz_dim1_f != 1 ) { sprintf( aapm_log_string, "[FILM] Size of dimension 1 entry missing" ); aapm_status( eAAPM_ERROR, aapm_log_string ); retval = FAILURE; } if ( film->film_flags.siz_dim2_f != 1 ) { sprintf( aapm_log_string, "[FILM] Size of dimension 2 entry missing" ); aapm_status( eAAPM_ERROR, aapm_log_string ); retval = FAILURE; } if ( film->film_flags.grid1_f != 1 && film->type == eDRR ) { sprintf( aapm_log_string, "[FILM] Grid 1 units entry missing" ); aapm_status( eAAPM_ERROR, aapm_log_string ); retval = FAILURE; } if ( film->film_flags.grid2_f != 1 && film->type == eDRR ) { sprintf( aapm_log_string, "[FILM] Grid 2 units entry missing" ); aapm_status( eAAPM_ERROR, aapm_log_string ); retval = FAILURE; } if ( film->film_flags.src_img_dis_f != 1 && film->type == eDRR ) { sprintf( aapm_log_string, "[FILM] Source image distance entry missing" ); aapm_status( eAAPM_ERROR, aapm_log_string ); retval = FAILURE; } if ( film->film_flags.number_f != 1 ) { sprintf( aapm_log_string, "[FILM] Number representation entry missing" ); aapm_status( eAAPM_ERROR, aapm_log_string ); retval = FAILURE; } if ( film->film_flags.bytes_f != 1 ) { sprintf( aapm_log_string, "[FILM] Bytes per pixel entry missing" ); aapm_status( eAAPM_ERROR, aapm_log_string ); retval = FAILURE; } /* ANY RTOG SPECIFIC FLAGS SHOULD BE CHECK HERE */ #ifdef RTOG #endif /* RETURN THE APPROPRIATE VALUE */ return( retval ); } /***************************************************************************** key_check_dose() **************************************************************************** Functional Description: Reviews all defined key flags to verify that all required directory entries have been provided. If any are missing, an error message is printed for each one and FAILURE is returned. Returns SUCCESS or FAILURE on an error. ***************************************************************************/ int key_check_dose ( dosedist_t *dose /* DOSE DATA STRUCTURE */ ) { int retval; /* RETURN VALUE (SUCCESS | FAILURE) */ /* INIIALIZE TO SUCCESS */ retval = SUCCESS; /* CHECK ALL FLAGS */ if ( dose->dose_flags.dose_num_f != 1 ) { sprintf( aapm_log_string, "[DOSE] Dose number entry missing" ); aapm_status( eAAPM_ERROR, aapm_log_string ); retval = FAILURE; } if ( dose->dose_flags.dose_type_f != 1 ) { sprintf( aapm_log_string, "[DOSE] Dose type entry missing" ); aapm_status( eAAPM_ERROR, aapm_log_string ); retval = FAILURE; } if ( dose->dose_flags.dose_unit_f != 1 ) { sprintf( aapm_log_string, "[DOSE] Dose units entry missing" ); aapm_status( eAAPM_ERROR, aapm_log_string ); retval = FAILURE; } if ( dose->dose_flags.orientat_f != 1 ) { sprintf( aapm_log_string, "[DOSE] Dose orientation entry missing" ); aapm_status( eAAPM_ERROR, aapm_log_string ); retval = FAILURE; } if ( dose->dose_flags.number_f != 1 ) { sprintf( aapm_log_string, "[DOSE] Number representation entry missing" ); aapm_status( eAAPM_ERROR, aapm_log_string ); retval = FAILURE; } if ( dose->dose_flags.num_dim_f != 1 ) { sprintf( aapm_log_string, "[DOSE] Number of dimensions entry missing" ); aapm_status( eAAPM_ERROR, aapm_log_string ); retval = FAILURE; } if ( dose->dose_flags.siz_dim1_f != 1 ) { sprintf( aapm_log_string, "[DOSE] Size of dimension 1 entry missing" ); aapm_status( eAAPM_ERROR, aapm_log_string ); retval = FAILURE; } if ( dose->dose_flags.siz_dim2_f != 1 ) { sprintf( aapm_log_string, "[DOSE] Size of dimension 2 entry missing" ); aapm_status( eAAPM_ERROR, aapm_log_string ); retval = FAILURE; } if ( dose->dose_flags.siz_dim3_f != 1 ) { sprintf( aapm_log_string, "[DOSE] Size of dimension 3 entry missing" ); aapm_status( eAAPM_ERROR, aapm_log_string ); retval = FAILURE; } if ( dose->dose_flags.coord1_f != 1 ) { sprintf( aapm_log_string, "[DOSE] Coord 1 of 1st point entry missing" ); aapm_status( eAAPM_ERROR, aapm_log_string ); retval = FAILURE; } if ( dose->dose_flags.coord2_f != 1 ) { sprintf( aapm_log_string, "[DOSE] Coord 2 of 1st point entry missing" ); aapm_status( eAAPM_ERROR, aapm_log_string ); retval = FAILURE; } if ( dose->dose_flags.horiz_f != 1 ) { sprintf( aapm_log_string, "[DOSE] Horizontal size entry missing" ); aapm_status( eAAPM_ERROR, aapm_log_string ); retval = FAILURE; } if ( dose->dose_flags.vert_f != 1 ) { sprintf( aapm_log_string, "[DOSE] Vertical size entry missing" ); aapm_status( eAAPM_ERROR, aapm_log_string ); retval = FAILURE; } /* ANY RTOG SPECIFIC FLAGS SHOULD BE CHECKED HERE */ #ifdef RTOG if ( dose->dose_flags.num_tx_f != 1 ) { sprintf( aapm_log_string, "[DOSE.RTOG] Number of treatments entry missing" ); aapm_status( eAAPM_ERROR, aapm_log_string ); retval = FAILURE; } if ( dose->dose_flags.fraction_id_f != 1 ) { sprintf( aapm_log_string, "[DOSE.RTOG] Fraction group ID entry missing" ); aapm_status( eAAPM_ERROR, aapm_log_string ); retval = FAILURE; } #endif /* RETURN THE APPROPRIATE VALUE */ return( retval ); } /***************************************************************************** key_check_dvh() **************************************************************************** Functional Description: Reviews all defined key flags to verify that all required directory entries have been provided. If any are missing, an error message is printed for each one and FAILURE is returned. Returns SUCCESS or FAILURE on an error. ***************************************************************************/ int key_check_dvh ( dvh_t *dvh /* DVH DATA STRUCTURE */ ) { int retval; /* RETURN VALUE (SUCCESS | FAILURE) */ /* INIIALIZE TO SUCCESS */ retval = SUCCESS; /* CHECK ALL FLAGS */ if ( dvh->dvh_flags.name_f != 1 ) { sprintf( aapm_log_string, "[DVH] Structure name entry missing" ); aapm_status( eAAPM_ERROR, aapm_log_string ); retval = FAILURE; } if ( dvh->dvh_flags.plan_id_f != 1 ) { sprintf( aapm_log_string, "[DVH] Plan id of origin entry missing" ); aapm_status( eAAPM_ERROR, aapm_log_string ); retval = FAILURE; } if ( dvh->dvh_flags.dose_unit_f != 1 ) { sprintf( aapm_log_string, "[DVH] Dose units entry missing" ); aapm_status( eAAPM_ERROR, aapm_log_string ); retval = FAILURE; } if ( dvh->dvh_flags.dose_flav_f != 1 ) { sprintf( aapm_log_string, "[DVH] Dose type entry missing" ); aapm_status( eAAPM_ERROR, aapm_log_string ); retval = FAILURE; } if ( dvh->dvh_flags.vol_flav_f != 1 ) { sprintf( aapm_log_string, "[DVH] Volume type entry missing" ); aapm_status( eAAPM_ERROR, aapm_log_string ); retval = FAILURE; } if ( dvh->dvh_flags.num_pairs_f != 1 ) { sprintf( aapm_log_string, "[DVH] Number of pairs entry missing" ); aapm_status( eAAPM_ERROR, aapm_log_string ); retval = FAILURE; } if ( dvh->dvh_flags.max_pairs_f != 1 ) { sprintf( aapm_log_string, "[DVH] Maximum # of pairs entry missing" ); aapm_status( eAAPM_ERROR, aapm_log_string ); retval = FAILURE; } if ( dvh->dvh_flags.number_f != 1 ) { sprintf( aapm_log_string, "[DVH] Number representation entry missing." ); aapm_status( eAAPM_ERROR, aapm_log_string ); /* ASSUME THAT DEFAULTING TO CHARACTER IS OK */ sprintf( aapm_log_string, "[DVH] Defaulting to CHARACTER" ); aapm_status( eAAPM_ERROR, aapm_log_string ); dvh->number_type = eCHARACTER; /*retval = FAILURE;*/ } /* CHECK FOR NOT SO REQUIRED KEYWORDS (SCALE) */ if ( dvh->dose_flavor != eABSOLUTE && dvh->dvh_flags.dose_scale_f != 1 ) { sprintf( aapm_log_string, "[DVH] Dose values are percent/relative with no dose scale" ); aapm_status( eAAPM_ERROR, aapm_log_string ); retval = FAILURE; } if ( dvh->volume_flavor != eABSOLUTE && dvh->dvh_flags.vol_scale_f != 1 ) { sprintf( aapm_log_string, "[DVH] Volume values are percent/relative with no dose scale" ); aapm_status( eAAPM_ERROR, aapm_log_string ); retval = FAILURE; } /* ANY RTOG SPECIFIC FLAGS SHOULD BE CHECK HERE */ #ifdef RTOG #endif /* RETURN THE APPROPRIATE VALUE */ return( retval ); }