-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCrawler_Annotation.py
More file actions
28 lines (26 loc) · 905 Bytes
/
Crawler_Annotation.py
File metadata and controls
28 lines (26 loc) · 905 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import os
from os import listdir
fileDir = "/Users/pc/Downloads/MontgomerySet/CXR_png"
listOfFiles = listdir(fileDir)
# check url https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4256233/ for datasets
def CreateFilename(indexFiles):
# We want to create a dictionary to number and list out all of our values i.e patient annotation details
returnValue = None
fileName = listOfFiles[indexFiles]
fileType = ".png"
if fileName.endswith(fileType):
returnValue = int(fileName)
return returnValue
else:
print(fileName)
print('Invalid file')
# Test for converting Xray into Dictionary for pickling
def TBclassification(indexAnnot):
fileName = listOfFiles[indexAnnot]
fileType = ".png"
if fileName.endswith(fileType):
returnValue = int(fileName[12])
return returnValue
else:
print(fileName)
print('Invalid file')