@@ -89,7 +89,7 @@ def gather_fixels(index_file, directions_file):
8989 path to a Nifti2 directions file
9090 """
9191
92- index_img , index_data = mif_to_nifti2 (index_file )
92+ _index_img , index_data = mif_to_nifti2 (index_file )
9393 count_vol = index_data [..., 0 ].astype (
9494 np .uint32
9595 ) # number of fixels in each voxel; by index.mif definition
@@ -123,23 +123,23 @@ def gather_fixels(index_file, directions_file):
123123 sorted_coords = voxel_coords [id_sort ]
124124
125125 voxel_table = pd .DataFrame (
126- dict (
127- voxel_id = np .arange (voxel_coords .shape [0 ]),
128- i = sorted_coords [:, 0 ],
129- j = sorted_coords [:, 1 ],
130- k = sorted_coords [:, 2 ],
131- )
126+ {
127+ ' voxel_id' : np .arange (voxel_coords .shape [0 ]),
128+ 'i' : sorted_coords [:, 0 ],
129+ 'j' : sorted_coords [:, 1 ],
130+ 'k' : sorted_coords [:, 2 ],
131+ }
132132 )
133133
134- directions_img , directions_data = mif_to_nifti2 (directions_file )
134+ _directions_img , directions_data = mif_to_nifti2 (directions_file )
135135 fixel_table = pd .DataFrame (
136- dict (
137- fixel_id = fixel_ids ,
138- voxel_id = fixel_voxel_ids ,
139- x = directions_data [:, 0 ],
140- y = directions_data [:, 1 ],
141- z = directions_data [:, 2 ],
142- )
136+ {
137+ ' fixel_id' : fixel_ids ,
138+ ' voxel_id' : fixel_voxel_ids ,
139+ 'x' : directions_data [:, 0 ],
140+ 'y' : directions_data [:, 1 ],
141+ 'z' : directions_data [:, 2 ],
142+ }
143143 )
144144
145145 return fixel_table , voxel_table
@@ -192,11 +192,11 @@ def write_storage(
192192 scalars = defaultdict (list )
193193 sources_lists = defaultdict (list )
194194 print ('Extracting .mif data...' )
195- for ix , row in tqdm (
195+ for _ix , row in tqdm (
196196 cohort_df .iterrows (), total = cohort_df .shape [0 ]
197197 ): # ix: index of row (start from 0); row: one row of data
198198 scalar_file = op .join (relative_root , row ['source_file' ])
199- scalar_img , scalar_data = mif_to_nifti2 (scalar_file )
199+ _scalar_img , scalar_data = mif_to_nifti2 (scalar_file )
200200 scalars [row ['scalar_name' ]].append (scalar_data ) # append to specific scalar_name
201201 sources_lists [row ['scalar_name' ]].append (
202202 row ['source_file' ]
0 commit comments