-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathexample_code.py
More file actions
33 lines (23 loc) · 876 Bytes
/
Copy pathexample_code.py
File metadata and controls
33 lines (23 loc) · 876 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
29
30
31
32
33
# -*- coding: utf-8 -*-
"""
Created on Tue Dec 2 11:46:45 2025
@author: nicol
"""
import sys
import json
def get_name(tck_file:str,out_file:str):
a_dict={} # create empty dictionary
a_dict['tck_file']=tck_file # Example: '/data/subjects/SUBJ001/dMRI/tractography/SUBJ001_tractogram.tck'
with open('data.json', 'w') as out_file:
json.dump(a_dict, out_file)
return
if __name__=='__main__':
# Get input and output root + subject_id
root_in = sys.argv[1]
root_out = sys.argv[2]
sub = sys.argv[3]
# Easily modify filepaths and dataset architecture
tck_filepath=root_in+'subjects/'+sub+'/dMRI/tractography/'+sub+'_tractogram.tck'
# out_filepath=root_out+'subjects/'+sub+'/mri_modality/model/'+sub+'_model_edited.nii.gz'
out_filepath=root_out+sub+'.json'
get_name(tck_filepath,out_filepath)