/*********************************************************************** save_gen_files.c ********************************************************************** Description: Contains the RTP specific reformatting and saving routines required for patient data tape exchange. Contrary to popular belief, it is impossible to write a generic read program for the RTOG patient data exchange which can be used on any particular RTP system. ALL OF THE MODULES IN THIS FILE MUST BE WRITTEN BY AN EXPERT ON THE TARGET (HOST) RTP SYSTEM TO ENSURE THAT THE DATA IS FORMATTED FOR THE TARGETED RTP SYSTEM. It is highly likely that a significant amount of support code will need to be developed to support these high level 'save' routines. It is possible to build executable code for this program with non- functioning versions of these routines to check syntax of formatted data. However, without the ability to inspect the results of conversion to the host RTP system it is impossible to KNOW that the data is correct. A analogy be that of a 'C' compiler. The compiler can inform the writer that the syntax of the program file is correct or not, but it cannot determine if the program will work the way it was intended. This requires inspection of the results. Modules Included: save_comment() Convert exchange comment data to RTP format and save save_ct() Convert exchange CT file data to RTP format and save save_mrus() Convert exchange MR or US file data to RTP format and save save_structures() Convert exchange structure file data to RTP format and save save_beam() Convert exchange beam file data to RTP format and save save_seed() Convert exchange seed file data to RTP format and save save_film() Convert exchange film file data to RTP format and save save_doses() Convert exchange TELE dose file data to RTP format and save save_seed_dose() Convert exchange SEED dose file data to RTP format and save save_dvh() Convert exchange DVH file data to RTP format and save ******************************* Revision History: $Log: save_gen_files.c,v $ * Revision 1.3 2000/01/26 21:54:54 jwm * Make message INFO level and return SUCCESS so that * parsing errors and warnings will stand out better * * Revision 1.2 2000/01/20 20:04:42 jwm * Remove save_seed_dose from generic code * * Revision 1.1 2000/01/17 21:10:12 jwm * Initial revision * **********************************************************************/ /* Include Files */ #include #include #include #include #include #include #include #include #include #include #include "sitedata.h" /* INCLUDE A FLAG TO INDICATE TO THE FOLLOWING DATA EXCHANGE SPECIFIC HEADER FILES THAT THIS IS NOT THE MAIN ROUTINE */ #define NOT_MAIN #include "exchkeys.h" #include "patexchange.h" /* */ /***************************************************************************** save_comment() **************************************************************************** Functional Description: Reformats the comment data from tape exchange format to the target RTP system format and saves the file. ***************************************************************************/ int save_comment ( case_t *p_case, /* PATIENT CASE */ exch_file_t *file /* TAPE FILE NODE TO BE SAVED */ ) { /* REPORT THAT THIS ROUTINE MUST YET BE WRITTEN */ sprintf( aapm_log_string, "'save_comment' must be written" ); aapm_status( eAAPM_INFO, aapm_log_string ); /* RETURN SUCCESS SO THAT PARSING ERRORS STAND OUT */ return( SUCCESS ); } /************************** End of save_comment() *************************/ /* */ /***************************************************************************** save_ct() **************************************************************************** Functional Description: Reformats the CT data read in tape exchange format and writes out the corresponding data file in the target RTP system's format. ***************************************************************************/ int save_ct ( case_t *p_case, /* PATIENT CASE */ exch_file_t *file /* TAPE FILE NODE TO BE SAVED */ ) { /* REPORT THAT THIS ROUTINE MUST YET BE WRITTEN */ sprintf( aapm_log_string, "'save_ct' must be written" ); aapm_status( eAAPM_INFO, aapm_log_string ); /* RETURN SUCCESS SO THAT PARSING ERRORS STAND OUT */ return( SUCCESS ); } /************************** End of save_ct() ******************************/ /* */ /***************************************************************************** save_structures() **************************************************************************** Functional Description: Writes all contour files out in the target RTP system format. This may also call routines to check for 'legitimate' contours (i.e. more than three points so that it encompasses area, no figure-eight's which are ambiguous contours, etc.). Processing the same data multiple times should prevent multiple (indistinguishable) copies of this data. ***************************************************************************/ int save_structures ( case_t *p_case, /* patient case */ exch_file_t *file /* file node containing a structure */ ) { /* REPORT THAT THIS ROUTINE MUST YET BE WRITTEN */ sprintf( aapm_log_string, "'save_structures' must be written" ); aapm_status( eAAPM_INFO, aapm_log_string ); /* RETURN SUCCESS SO THAT PARSING ERRORS STAND OUT */ return( SUCCESS ); } /************************** End of save_structures() **********************/ /* */ /***************************************************************************** save_beam() **************************************************************************** Functional Description: Saves beam information into a plan on the target RTP system if such a plan already exists, or creates a new plan and writes the beam to it. This routine will need to get a plan ID from the user for an existing or new plan based on the target RTP system's requirements. ***************************************************************************/ int save_beam ( case_t *p_case, /* PATIENT CASE */ exch_file_t *file /* FILE NODE CONTAINING A STRUCTURE */ ) { /* REPORT THAT THIS ROUTINE MUST YET BE WRITTEN */ sprintf( aapm_log_string, "'save_beam' must be written" ); aapm_status( eAAPM_INFO, aapm_log_string ); /* RETURN SUCCESS SO THAT PARSING ERRORS STAND OUT */ return( SUCCESS ); } /************************** End of save_beam() **************************/ /* */ /***************************************************************************** save_film() **************************************************************************** Functional Description: Saves digital film information in target RTP system's format. This routine must distinguish between DRRs and other types of digital film images as the constraints are different for each. There may be a need to get a plan ID from the user. ***************************************************************************/ int save_film ( case_t *p_case, /* PATIENT CASE */ exch_file_t *file /* FILE NODE CONTAINING A STRUCTURE */ ) { /* REPORT THAT THIS ROUTINE MUST YET BE WRITTEN */ sprintf( aapm_log_string, "'save_film' must be written" ); aapm_status( eAAPM_INFO, aapm_log_string ); /* RETURN SUCCESS SO THAT PARSING ERRORS STAND OUT */ return( SUCCESS ); } /************************** End of save_film() **************************/ /* */ /***************************************************************************** save_doses() **************************************************************************** Functional Description: Saves a dose file in the target RTP system's format. This may require resampling to meet matrix spacing requirements, scaling to the appropriate internal units, etc. This may need a plan ID from the user. It should be noted that doses may be independent of beams. ***************************************************************************/ int save_doses ( case_t *p_case, /* PATIENT CASE */ exch_file_t *file /* FILE NODE CONTAINING A STRUCTURE */ ) { /* REPORT THAT THIS ROUTINE MUST YET BE WRITTEN */ sprintf( aapm_log_string, "'save_doses' must be written" ); aapm_status( eAAPM_INFO, aapm_log_string ); /* RETURN SUCCESS SO THAT PARSING ERRORS STAND OUT */ return( SUCCESS ); } /************************** End of save_doses() **************************/ /* */ /***************************************************************************** save_dvh() **************************************************************************** Functional Description: Saves DVH information from this file (for a single structure) in target RTP system's format. ***************************************************************************/ int save_dvh ( case_t *p_case, /* PATIENT CASE */ exch_file_t *file /* FILE NODE CONTAINING A STRUCTURE */ ) { /* REPORT THAT THIS ROUTINE MUST YET BE WRITTEN */ sprintf( aapm_log_string, "'save_dvh' must be written" ); aapm_status( eAAPM_INFO, aapm_log_string ); /* RETURN SUCCESS SO THAT PARSING ERRORS STAND OUT */ return( SUCCESS ); } /************************** End of save_dvh() **************************/ /* */ /*********************************************************************** save_seed() ********************************************************************** Functional Description: Saves seed plan information from this file in target RTP system's format. *********************************************************************/ int save_seed ( case_t *p_case, /* PATIENT CASE */ exch_file_t *file /* FILE NODE CONTAINING A STRUCTURE */ ) { /* REPORT THAT THIS ROUTINE MUST YET BE WRITTEN */ sprintf( aapm_log_string, "'save_seed' must be written " ); aapm_status( eAAPM_INFO, aapm_log_string ); /* RETURN SUCCESS SO THAT PARSING ERRORS STAND OUT */ return( SUCCESS ); } /************************ End of save_seed() **************************/ /* */ /*********************************************************************** save_mrus() ********************************************************************** Functional Description: Saves MR or US scan information from this file in target RTP system's format. *********************************************************************/ int save_mrus ( case_t *p_case, /* PATIENT CASE */ exch_file_t *file /* FILE NODE CONTAINING A STRUCTURE */ ) { /* REPORT THAT THIS ROUTINE MUST YET BE WRITTEN */ sprintf( aapm_log_string, "'save_mrus' must be written " ); aapm_status( eAAPM_INFO, aapm_log_string ); /* RETURN SUCCESS SO THAT PARSING ERRORS STAND OUT */ return( SUCCESS ); } /************************ End of save_mrus() **************************/ /*************************** End of save_files.c **********************/