Skip to content

Commit

Permalink
Syntax correction partial
Browse files Browse the repository at this point in the history
  • Loading branch information
snail123815 committed Jun 29, 2022
1 parent 637565b commit d939101
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
6 changes: 3 additions & 3 deletions extractPicAndMeasure.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@
except IndexError:
nextGroupStart = len(fileList)

if i != 0:
if i != 0: # Multiple position files
posDict = getPositions(sampleInfoTsvPath)
posToCrop = getPosToCrop(posDict, useCroppedImg, locFromCropped)
# Prepare cropping files
Expand All @@ -216,7 +216,7 @@
filePathList = [os.path.join(imgPath, file) for file in subFileList]
threadPool = ThreadPoolExecutor(max_workers=os.cpu_count())
futures = []
for i, file in enumerate(filePathList):
for i, file in enumerate(filePathList): # repeated "i"
future = threadPool.submit(
crop, file, posToCrop, targetPaths,
paddingPos=paddingPos,
Expand Down Expand Up @@ -265,7 +265,7 @@

if measure:

threadPool = ThreadPoolExecutor(max_workers=8)
threadPool = ThreadPoolExecutor(max_workers=1)
futures = []

for folder in sampleInfo:
Expand Down
13 changes: 11 additions & 2 deletions funcs/measureImages.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,17 @@
from funcs import determineExtension


def measureImgs(path, dictOldScanTime=None, measureType='centreDisk', polygons=[(0, 0, 1, 0, 0, 1), ], percentage=1.0, forceUseFileNumber=False, fileNumberTimeInterval=1) -> np.ndarray:
"""Measure all images in path\n
def measureImgs(
path,
dictOldScanTime=None,
measureType='centreDisk',
polygons=[(0, 0, 1, 0, 0, 1), ],
percentage=1.0,
forceUseFileNumber=False,
fileNumberTimeInterval=1
) -> tuple[str, np.ndarray]:
"""
Measure all images in path\n
Return a numpy array of shape (len(files), 2).\n
Args:\n
Expand Down

0 comments on commit d939101

Please sign in to comment.