<commit_before>import os
import numpy as np
import PIL

import histomicstk as htk

# Read Input Image
OAinputImage = np.array(PIL.Image.open(inputImageFile))

# Perform color deconvolution
W = np.array([[0.650, 0.072, 0], [0.704, 0.990, 0], [0.286, 0.105, 0]])
res = htk.ColorDeconvolution(inputImage, W)

# write stain images to output
outFileSuffix = os.path.split(inputImageFile)[1]

outputStainImageFile_1 = os.path.join(_tempdir, 'stain_1_' + outFileSuffix)
PIL.Image.fromarray(res.Stains[:, :, 0]).save(outputStainImageFile_1)

outputStainImageFile_2 = os.path.join(_tempdir, 'stain_2_' + outFileSuffix)
PIL.Image.fromarray(res.Stains[:, :, 1]).save(outputStainImageFile_2)

outputStainImageFile_3 = os.path.join(_tempdir, 'stain_3_' + outFileSuffix)
PIL.Image.fromarray(res.Stains[:, :, 2]).save(outputStainImageFile_3)
 <commit_msg>Fixed a bug<commit_after>import os
import numpy as np
import PIL

import histomicstk as htk

# Read Input Image
inputImage = np.array(PIL.Image.open(inputImageFile))

# Perform color deconvolution
W = np.array([[0.650, 0.072, 0], [0.704, 0.990, 0], [0.286, 0.105, 0]])
res = htk.ColorDeconvolution(inputImage, W)

# write stain images to output
outFileSuffix = os.path.split(inputImageFile)[1]

outputStainImageFile_1 = os.path.join(_tempdir, 'stain_1_' + outFileSuffix)
PIL.Image.fromarray(res.Stains[:, :, 0]).save(outputStainImageFile_1)

outputStainImageFile_2 = os.path.join(_tempdir, 'stain_2_' + outFileSuffix)
PIL.Image.fromarray(res.Stains[:, :, 1]).save(outputStainImageFile_2)

outputStainImageFile_3 = os.path.join(_tempdir, 'stain_3_' + outFileSuffix)
PIL.Image.fromarray(res.Stains[:, :, 2]).save(outputStainImageFile_3)
 
{'fraction_non_alphanumeric': 0.14439140811455847, 'fraction_numerical': 0.0477326968973747, 'mean_word_length': 6.323144104803493, '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': '2308359', 'n_tokens_mistral': 700, 'n_tokens_neox': 663, 'n_words': 118}