lama/registration_pipeline/run_lama.py
def generate_staging_data(config: LamaConfig):
    """
    Generate staging data from the registration results
    """

    staging_method = config['staging']

    if staging_method == 'scaling_factor':
        logging.warn('Scaling factor not working at the moment')
        return
        logging.info('Doing stage estimation - scaling factor')
        stage_dir = get_affine_or_similarity_stage_dir(config)
        staging_metric_maker.scaling_factor_staging(stage_dir, config['output_dir'])
        return True

    elif staging_method == 'embryo_volume':
        logging.info('Doing stage estimation - whole embryo volume')

        # Get the dir name of the stage that we want to calculate organ volumes from (rigid, affine)
        stage_to_get_volumes = get_affine_or_similarity_stage_dir(config)
        if not stage_to_get_volumes:
            logging.warn('Cannot find a similarity or affine stage to generate whole embryo volume staging data.')
            return

        logging.info('Generating whole embryo volume staging data')

        propagated_mask_dir = config['inverted_stats_masks']

        staging_metric_maker.whole_volume_staging(propagated_mask_dir, config['output_dir'])
        return True

    Generate staging data from the registration results
    
Generate staging data from the registration results
Generate staging data from the registration results
def generate_staging_data(config: LamaConfig):
    staging_method = config['staging']
    if staging_method == 'scaling_factor':
        logging.warn('Scaling factor not working at the moment')
        return
        logging.info('Doing stage estimation - scaling factor')
        stage_dir = get_affine_or_similarity_stage_dir(config)
        staging_metric_maker.scaling_factor_staging(stage_dir, config['output_dir'])
        return True
    elif staging_method == 'embryo_volume':
        logging.info('Doing stage estimation - whole embryo volume')
        stage_to_get_volumes = get_affine_or_similarity_stage_dir(config)
        if not stage_to_get_volumes:
            logging.warn('Cannot find a similarity or affine stage to generate whole embryo volume staging data.')
            return
        logging.info('Generating whole embryo volume staging data')
        propagated_mask_dir = config['inverted_stats_masks']
        staging_metric_maker.whole_volume_staging(propagated_mask_dir, config['output_dir'])
        return True
def generate_staging_data ( config : LamaConfig ) : staging_method = config [ 'staging' ] if staging_method == 'scaling_factor' : logging . warn ( 'Scaling factor not working at the moment' ) return logging . info ( 'Doing stage estimation - scaling factor' ) stage_dir = get_affine_or_similarity_stage_dir ( config ) staging_metric_maker . scaling_factor_staging ( stage_dir , config [ 'output_dir' ] ) return True elif staging_method == 'embryo_volume' : logging . info ( 'Doing stage estimation - whole embryo volume' ) stage_to_get_volumes = get_affine_or_similarity_stage_dir ( config ) if not stage_to_get_volumes : logging . warn ( 'Cannot find a similarity or affine stage to generate whole embryo volume staging data.' ) return logging . info ( 'Generating whole embryo volume staging data' ) propagated_mask_dir = config [ 'inverted_stats_masks' ] staging_metric_maker . whole_volume_staging ( propagated_mask_dir , config [ 'output_dir' ] ) return True
Generate staging data from the registration results
Generate staging data from the registration results
"""
    Generate staging data from the registration results
    """ # Get the dir name of the stage that we want to calculate organ volumes from (rigid, affine)
config
LamaConfig