File tree Expand file tree Collapse file tree 1 file changed +5
-53
lines changed Expand file tree Collapse file tree 1 file changed +5
-53
lines changed Original file line number Diff line number Diff line change @@ -180,9 +180,11 @@ def get_list_data(file_list, dtype=np.float32):
180
180
----------
181
181
file_list : str
182
182
A list of file paths to 3D NIFTI images.
183
- Returns
184
- --------
185
- Nibabel image object
183
+
184
+ Returns
185
+ --------
186
+ Nibabel image object
187
+
186
188
Examples
187
189
--------
188
190
>>> os.chdir(tmpdir)
@@ -290,56 +292,6 @@ def save_4d_to_3d(in_file):
290
292
return out_files
291
293
292
294
293
- def prune_b0s_from_dwis (in_files , b0_ixs ):
294
- """
295
- Remove *b0* volume files from a complete list of DWI volume files.
296
-
297
- Parameters
298
- ----------
299
- in_files : list
300
- A list of NIfTI file paths corresponding to each 3D volume of a
301
- DWI image (i.e. including B0's).
302
- b0_ixs : list
303
- List of B0 indices.
304
-
305
- Returns
306
- -------
307
- out_files : list
308
- A list of file paths to 3d NIFTI images.
309
-
310
- Examples
311
- --------
312
- >>> os.chdir(tmpdir)
313
- >>> b0_ixs = np.where(np.loadtxt(str(dipy_datadir / "HARDI193.bval")) <= 50)[0].tolist()[:2]
314
- >>> in_file = str(dipy_datadir / "HARDI193.nii.gz")
315
- >>> threeD_files = save_4d_to_3d(in_file)
316
- >>> out_files = prune_b0s_from_dwis(threeD_files, b0_ixs)
317
- >>> assert sum([os.path.isfile(i) for i in out_files]) == len(out_files)
318
- >>> assert len(out_files) == len(threeD_files) - len(b0_ixs)
319
- """
320
- if in_files [0 ].endswith ("_warped.nii.gz" ):
321
- out_files = [
322
- i
323
- for j , i in enumerate (
324
- sorted (
325
- in_files , key = lambda x : int (x .split ("_" )[- 2 ].split (".nii.gz" )[0 ])
326
- )
327
- )
328
- if j not in b0_ixs
329
- ]
330
- else :
331
- out_files = [
332
- i
333
- for j , i in enumerate (
334
- sorted (
335
- in_files , key = lambda x : int (x .split ("_" )[- 1 ].split (".nii.gz" )[0 ])
336
- )
337
- )
338
- if j not in b0_ixs
339
- ]
340
- return out_files
341
-
342
-
343
295
def save_3d_to_4d (in_files ):
344
296
"""
345
297
Concatenate a list of 3D volumes into a 4D output.
You can’t perform that action at this time.
0 commit comments