<commit_before>#! /usr/bin/python
# -*- coding: utf-8 -*-
"""
Evaluation of liver volume error inspired by Sliver07.
"""

# import funkcí z jiného adresáře
import sys
import os.path

path_to_script = os.path.dirname(os.path.abspath(__file__))
sys.path.append(os.path.join(path_to_script, "../src/"))
sys.path.append(os.path.join(path_to_script, "../extern/pyseg_base/src"))
sys.path.append(os.path.join(path_to_script,
                             "../extern/py3DSeedEditor/"))
#sys.path.append(os.path.join(path_to_script, "../extern/"))
#import featurevector

import logging
logger = logging.getLogger(__name__)


#import apdb
#  apdb.set_trace();
#import scipy.io
import numpy as np
import scipy
#from scipy import sparse
#import traceback

# ----------------- my scripts --------
import py3DSeedEditor
#import dcmreaddata1 as dcmr
#import dcmreaddata as dcmr
#import pycut
import argparse
#import py3DSeedEditor

#import segmentation
import qmisc
import misc
#import organ_segmentation
#import experiments
import datareader

# okraj v pixelech využitý pro snížení výpočetní náročnosti během vyhodnocování
# AvgD
CROP_MARGIN = [20]


def generate_input_yaml(sliver_dir, pklz_dir,
                        sliver_ext='*g0*.mhd', pklz_ext='*0*.pklz',
                        yaml_filename=None,
                        return_dir_lists=False
                        ):
    """
    Function pair files from different directory by numer in format g0XX.
    It is ok for seg001 and orig001 too.
    If there is given some yaml_filename, it is created.
    """
    import glob
    import re

    onlyfiles1 = glob.glob(os.path.join(sliver_dir, sliver_ext))
    onlyfiles2 = glob.glob(os.path.join(pklz_dir, pklz_ext))<commit_msg>fix bad mask for sliver data orig and seg came thru<commit_after>#! /usr/bin/python
# -*- coding: utf-8 -*-
"""
Evaluation of liver volume error inspired by Sliver07.
"""

# import funkcí z jiného adresáře
import sys
import os.path

path_to_script = os.path.dirname(os.path.abspath(__file__))
sys.path.append(os.path.join(path_to_script, "../src/"))
sys.path.append(os.path.join(path_to_script, "../extern/pyseg_base/src"))
sys.path.append(os.path.join(path_to_script,
                             "../extern/py3DSeedEditor/"))
#sys.path.append(os.path.join(path_to_script, "../extern/"))
#import featurevector

import logging
logger = logging.getLogger(__name__)


#import apdb
#  apdb.set_trace();
#import scipy.io
import numpy as np
import scipy
#from scipy import sparse
#import traceback

# ----------------- my scripts --------
import py3DSeedEditor
#import dcmreaddata1 as dcmr
#import dcmreaddata as dcmr
#import pycut
import argparse
#import py3DSeedEditor

#import segmentation
import qmisc
import misc
#import organ_segmentation
#import experiments
import datareader

# okraj v pixelech využitý pro snížení výpočetní náročnosti během vyhodnocování
# AvgD
CROP_MARGIN = [20]


def generate_input_yaml(sliver_dir, pklz_dir,
                        sliver_ext='*seg0*.mhd', pklz_ext='*0*.pklz',
                        yaml_filename=None,
                        return_dir_lists=False
                        ):
    """
    Function pair files from different directory by numer in format g0XX.
    It is ok for seg001 and orig001 too.
    If there is given some yaml_filename, it is created.
    """
    import glob
    import re

    onlyfiles1 = glob.glob(os.path.join(sliver_dir, sliver_ext))
    onlyfiles2 = glob.glob(os.path.join(pklz_dir, pklz_ext))
{'fraction_non_alphanumeric': 0.1151862464183381, 'fraction_numerical': 0.011461318051575931, 'mean_word_length': 3.0926143024618993, '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': '4993189', 'n_tokens_mistral': 1223, 'n_tokens_neox': 1183, 'n_words': 293}