<commit_before><commit_msg>Push initial build. Success!<commit_after>#!/usr/bin/env python

import sys
from os import listdir
from os.path import isfile, join
import dicom
import pylab

str_targetDir 	= sys.argv[1]
fileIndex 		= int(sys.argv[2])

print("The Directory you indicated was: %s" % str_targetDir)
print("The file in that directory that I will read is index: %d" % fileIndex)

l_files = [f for f in listdir(str_targetDir) if isfile(join(str_targetDir, f))]

str_targetFile = l_files[fileIndex]

print("The target DICOM I will load is: %s" % str_targetFile)
str_dicomFile = '%s/%s' % (str_targetDir, str_targetFile)
ds = dicom.read_file(str_dicomFile)

pylab.imshow(ds.pixel_array, cmap=pylab.cm.bone)
pylab.savefig('out.jpg')

htmlPage = """
<!DOCTYPE html>
<html>
<head>
  <title>DICOM MetaData</title>
</head>
<body>

<img src="out.jpg" >


<pre>%s</pre>

</body>
</html>
""" % (ds)

text_file = open("index.html", "w")
text_file.write("%s" % htmlPage)
text_file.close()

print("index.html generated!!")
{'fraction_non_alphanumeric': 0.15566502463054188, 'fraction_numerical': 0.0019704433497536944, 'mean_word_length': 5.471337579617835, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, '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': '2672776', 'n_tokens_mistral': 402, 'n_tokens_neox': 398, 'n_words': 96}