Commit cf8c5f3c authored by Andrei Roibu's avatar Andrei Roibu
Browse files

added a counter to keep track of progress

parent c0326e33
......@@ -55,9 +55,8 @@ def tractSum(folder_path):
subDirectoryList = dirReader(folder_path)
# test_file = open('./files.txt', 'r')
# for subDirectory in subDirectoryList():
viableSubDirectories = len(subDirectoryList)
counter = 0
if not os.path.exists('/well/win/users/hsv459/functionmapper/datasets/dMRI'):
if not os.path.exists('/well/win/users/hsv459/functionmapper/datasets'):
......@@ -69,6 +68,8 @@ def tractSum(folder_path):
sum_flag = False # This is a flat showing us if this is the first tracted to be summed
print("Summing the tract number: {}/{}".format(counter, viableSubDirectories))
for tract in os.listdir(tractedMapsPath):
if os.path.isdir(os.path.join(tractedMapsPath, tract)):
tractedMapPath = os.path.join(tractedMapsPath, tract, tractMapName)
......@@ -91,9 +92,11 @@ def tractSum(folder_path):
tractedMapSumImg = nib.Nifti1Image(tractedMapSum, tractedMapAffine)
nib.save(tractedMapSumImg, os.path.join(tractedMapSumPath, tractsSumName))
counter +=1
return None
if __name__ == "__main__":
folder_location = '/well/win-biobank/projects/imaging/data/data3/subjectsAll/'
tractSum(folder_location)
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment