// file: $USFS/class/image_analysis/v6.0/imaga_rle_18.cc
//

// isip include files
//
#include "image_analysis.h"
#include "image_analysis_constants.h"

// method: rle_train_cc
//
// arguments:
//  char_1* image_fname: (input) the image file name
//  char_1* seg_fname: (input) the segmentation file name
//
// return:
//  a logical_1 value indicating status
//
// this method computes the compression ratio on a prescribed region in the
// training mode
//
logical_1 Image_analysis::rle_train_cc(char_1* image_fname_a,
				       char_1* seg_fname_a) {
  
  // compute the compression ratio
  //
  if (rle_compute_cc(image_fname_a, seg_fname_a) == ISIP_FALSE) {
    error_handler_cc((char_1*)"rle_train_cc",
		     (char_1*)"error while computing the compression ratio");
    return ISIP_FALSE;
  }

  // provide some debugging information
  //
  if (debug_level_d > ISIP_DEBUG_BRIEF) {
    fprintf(stdout, "<%s> %s = %ld\n", "Image_analysis::rle_compute_cc",
	    "rle_npxls", rle_r_npxls_d);
    fprintf(stdout, "<%s> %s = %ld\n", "Image_analysis::rle_compute_cc",
	    "rle_r_nimages_d", rle_r_nimages_d);
  }
  
  // exit gracefully
  //
  return ISIP_TRUE;
}
