Skip to content

Commit

Permalink
Cleaning up
Browse files Browse the repository at this point in the history
  • Loading branch information
adbartni committed Mar 30, 2021
1 parent b7ccdd5 commit 9af04c7
Show file tree
Hide file tree
Showing 20 changed files with 19 additions and 15 deletions.
Empty file modified .gitignore
100644 → 100755
Empty file.
Empty file modified .vscode/settings.json
100644 → 100755
Empty file.
Empty file modified LICENSE
100644 → 100755
Empty file.
Empty file modified README.md
100644 → 100755
Empty file.
Empty file modified __init__.py
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion activate
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash

source /shared/studies/nonregulated/connectome/fmri/preprocessing_pipeline/venv/bin/activate
source /shared/nonrestricted/connectome/fmri/preprocessing_pipeline/venv/bin/activate
Empty file modified collect_raw_data/__init__.py
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion collect_raw_data/collect_raw_data.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def init_fmri_subject_dir(subjectID, path_fmri, path_HCP):

## Copy QSM data to fmri subject directory
strippedID = subjectID[2:]
path_QSM = os.path.join("/shared/studies/nonregulated/qsm_repo/data/", strippedID + "/recon/")
path_QSM = os.path.join("/shared/nonrestricted/qsm_repo/data/", strippedID + "/recon/")
if os.path.isdir(path_QSM) and not os.path.exists(path_fmri + subjectID + "/phase_combined.nii.gz"):
for qsm_file in ["magnitude_combined.nii.gz", "phase_combined.nii.gz"]:
copyfile(os.path.join(path_QSM, qsm_file), os.path.join(path_fmri, subjectID + "/" + qsm_file))
Expand Down
4 changes: 2 additions & 2 deletions connectome_analyses/FunctionalConnectivity.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ class FunctionalConnectome:

def __init__(self, subjectID):
self.subjectID = subjectID
self.path_fmri = "/shared/studies/nonregulated/connectome/fmri/subjects/" + subjectID + "/"
self.path_HCP = "/shared/studies/nonregulated/connectome/Subjects/" + subjectID + "/T1w/"
self.path_fmri = "/shared/nonrestricted/connectome/fmri/subjects/" + subjectID + "/"
self.path_HCP = "/shared/nonrestricted/connectome/Subjects/" + subjectID + "/T1w/"

def create_functional_connectivity_matrix(self):
""" Performs functional connectivity analysis on a subject
Expand Down
Empty file modified connectome_analyses/__init__.py
100644 → 100755
Empty file.
12 changes: 6 additions & 6 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ def pipeline(self):
try:
if self.phase == "premelodic":
init_fmri_subject_dir(subjectID,
"/shared/studies/nonregulated/connectome/fmri/subjects/",
"/shared/studies/nonregulated/connectome/Subjects/" + subjectID + "/T1w/")
"/shared/nonrestricted/connectome/fmri/subjects/",
"/shared/nonrestricted/connectome/Subjects/" + subjectID + "/T1w/")

processing = Preprocessing(subjectID)
structproc = StructuralProcessing(processing)
Expand Down Expand Up @@ -112,8 +112,8 @@ def pipeline(self):
<<< DON'T USE THIS UNTIL FIX IS WORKING >>>
"""
init_fmri_subject_dir(subjectID,
"/shared/studies/nonregulated/connectome/fmri/subjects/",
"/shared/studies/nonregulated/connectome/Subjects/" + subjectID + "/T1w/")
"/shared/nonrestricted/connectome/fmri/subjects/",
"/shared/nonrestricted/connectome/Subjects/" + subjectID + "/T1w/")

processing = Preprocessing(subjectID)
structproc = StructuralProcessing(processing)
Expand Down Expand Up @@ -173,10 +173,10 @@ def starting_files_present(subjectID):
before beginning processing
"""

path_conntectome = "/shared/studies/nonregulated/connectome/"
path_conntectome = "/shared/nonrestricted/connectome/"
functional_data = path_conntectome + "fmri/subjects/" + subjectID + "/rawfunc.nii.gz"
structural_data = path_conntectome + "Subjects/" + subjectID + "/T1w/T1w_acpc_dc_restore_brain.nii.gz"
QSM_path = "/shared/studies/nonregulated/qsm_repo/data/" + subjectID.replace("EX","") + "/recon/"
QSM_path = "/shared/nonrestricted/qsm_repo/data/" + subjectID.replace("EX","") + "/recon/"

if (not os.path.exists(functional_data)
or not os.path.exists(structural_data)
Expand Down
1 change: 1 addition & 0 deletions match_function_by_name.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,4 @@ def match(subjectID, function):
if __name__ == "__main__":
function = match("EX54589", "epi_distortion_correction")
print(function)

2 changes: 1 addition & 1 deletion preprocessing/Melodic.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def init_melodic_directory(self):
copyfile(self.path_fmri + cp_file,
self.path_fmri + "denoise.ica/" + cp_file)
if not os.path.exists(self.path_fmri + "denoise.ica/design.fsf"):
copyfile("/shared/studies/nonregulated/connectome/fmri/subjects/design.fsf",
copyfile("/shared/nonrestricted/connectome/fmri/subjects/design.fsf",
self.path_fmri + "denoise.ica/design.fsf")

for cp_dir in dirs:
Expand Down
Empty file modified preprocessing/PostMelodicProcessing.py
100644 → 100755
Empty file.
4 changes: 2 additions & 2 deletions preprocessing/PreMelodicProcessing.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ class Preprocessing:

def __init__(self, subjectID):
self.subjectID = subjectID
self.path_fmri = "/shared/studies/nonregulated/connectome/fmri/subjects/" + subjectID + "/"
self.path_HCP = "/shared/studies/nonregulated/connectome/Subjects/" + subjectID + "/T1w/"
self.path_fmri = "/shared/nonrestricted/connectome/fmri/subjects/" + subjectID + "/"
self.path_HCP = "/shared/nonrestricted/connectome/Subjects/" + subjectID + "/T1w/"
self.mc_path = "/shared/software/vendor/freesurfer/freesurfer-5.3.0_x86_64/bin/"
self.ants_path = "/usr/lib/ants/"

Expand Down
Empty file modified preprocessing/StructuralProcessing.py
100644 → 100755
Empty file.
Empty file modified preprocessing/__init__.py
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion quality_control/init_reports_directory.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
with open(subject_list_file) as infile:
subject_list = infile.read().splitlines()

path_fmri = '/shared/studies/nonregulated/connectome/fmri/subjects/'
path_fmri = '/shared/nonrestricted/connectome/fmri/subjects/'

if not os.path.isdir('reports'):
os.mkdir('reports')
Expand Down
5 changes: 4 additions & 1 deletion quality_control/registration_report.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@
import os


# Creates a string of all the filenames of T1 and registered functional images
# to feed into ImageMagick
subjects_as_string = ""
for subjectID in subject_list:

reg_func_file = path_fmri + subjectID + "/ants/epi2braints.nii.gz"
t1_file = "/shared/studies/nonregulated/connectome/Subjects/" + subjectID + \
t1_file = "/shared/nonrestricted/connectome/Subjects/" + subjectID + \
"/T1w/T1w_acpc_dc_restore_brain_2.00.nii.gz"
if os.path.exists(reg_func_file) and os.path.exists(t1_file):

Expand All @@ -33,5 +35,6 @@

#break

# Creates a pdf of functional images overlaid on T1 for all subjects
os.system("convert " + subjects_as_string + " reports/missing_subs_epi2struct.pdf")

Empty file modified requirements.in
100644 → 100755
Empty file.

0 comments on commit 9af04c7

Please sign in to comment.