Commit 5af37db9 authored by Andrei-Claudiu Roibu's avatar Andrei-Claudiu Roibu 🖥
Browse files

modified directory reader to eliminate space after each directory

parent 5c60c7c3
......@@ -42,9 +42,10 @@ def directory_reader(folder_location, write_txt=False):
if os.path.isdir(os.path.join(folder_location, directory)):
filename = folder_location+directory
if os.access(filename, os.R_OK):
string = directory+'\n'
string = directory
if write_txt == True:
out_file.write(string)
out_file.write("\n")
subDirectoryList.append(directory)
return subDirectoryList
......@@ -92,6 +93,8 @@ def update_shuffling_flag(file_name):
def tract_sum_generator(folder_path):
"""Sums the tracts of different dMRI files
TODO: CHANGE FUNCTION TO GENERATE DOWNSAMPLED DATA!
THIS FUNCTION IS NOT DEPRECATED: SummedTractMaps generated remotely
When performing subject-specific probabilistic diffusion tractography using standard-space protocols, 27 tracts are created.
......@@ -397,4 +400,6 @@ def load_and_preprocess_evaluation(file_path, orientation, min_max=True):
if __name__ == "__main__":
folder_location = "../well/win-biobank/projects/imaging/data/data3/subjectsAll/"
data_test_train_validation_split(folder_location, 90, 5)
# data_test_train_validation_split(folder_location, 90, 5)
subDirectoryList = directory_reader(folder_location, write_txt=True)
print(subDirectoryList)
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