<commit_before>function addImage(imagingStudy, series, instance) {
    if(config.imageRenderMode === 'client') {
        addImageClient(imagingStudy, series, instance);
    } else if(config.imageRenderMode === 'server') {
        addImageServer(imagingStudy, series, instance);
    }
}

function displayImagingStudy(imagingStudy) {
    // TODO: get the full metadata via WADO-RS Retreive Metadata so we can figure out how to display this
    // study properly

    // create a thumbnail for each display set
    imagingStudy.series.forEach(function(series) {
        // Skip over PR, KO and SR (for now)
        if(series.modality === 'PR' || series.modality == 'KO' || series.modalty == 'SR') {
            return;
        }
        // TODO: Sort images by instance number so its not random
        var firstImage = series.instance[0];
        addImage(imagingStudy, series, firstImage);<commit_msg>use server side rendering for large images (MR, CR)<commit_after>function addImage(imagingStudy, series, instance) {
    var client = config.imageRenderMode === 'client';
    // user server side rendering for large images
    if(series.modality === 'MG' || series.modality === 'CR')
    {
        client = false;
    }

    if(client) {
        addImageClient(imagingStudy, series, instance);
    } else {
        addImageServer(imagingStudy, series, instance);
    }
}

function displayImagingStudy(imagingStudy) {
    // TODO: get the full metadata via WADO-RS Retreive Metadata so we can figure out how to display this
    // study properly

    // create a thumbnail for each display set
    imagingStudy.series.forEach(function(series) {
        // Skip over PR, KO and SR (for now)
        if(series.modality === 'PR' || series.modality == 'KO' || series.modalty == 'SR') {
            return;
        }
        // TODO: Sort images by instance number so its not random
        var firstImage = series.instance[0];
        addImage(imagingStudy, series, firstImage);
{'fraction_non_alphanumeric': 0.11004056795131846, 'fraction_numerical': 0.0010141987829614604, 'mean_word_length': 2.8838582677165356, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6693369', 'n_tokens_mistral': 570, 'n_tokens_neox': 535, 'n_words': 173}