Skip to content
This repository was archived by the owner on Dec 27, 2022. It is now read-only.

Commit f2180cc

Browse files
committed
fix: moved nipype imports into function. moved matplotlib.use agg under
1 parent 08fa933 commit f2180cc

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

preafq/qc.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
import matplotlib
2+
matplotlib.use('agg')
3+
24
import nibabel as nib
35

46
import matplotlib.pyplot as plt
@@ -9,7 +11,7 @@
911
from nipype.utils.filemanip import save_json
1012
import base64
1113

12-
matplotlib.use('agg')
14+
1315

1416

1517
def reorient_array(data, aff):

preafq/run_1.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,22 @@
11
import os.path as op
22
from shutil import copyfile
33

4-
import nipype.interfaces.freesurfer as fs
5-
import nipype.interfaces.fsl as fsl
6-
import nipype.interfaces.io as nio
7-
import nipype.interfaces.utility as niu
8-
import nipype.pipeline.engine as pe
9-
from nipype.interfaces.dipy import DTI
10-
from nipype.workflows.dmri.fsl.artifacts import all_fsl_pipeline
11-
124

135
def run_preAFQ(dwi_file, dwi_file_AP, dwi_file_PA, bvec_file, bval_file,
146
subjects_dir, working_dir, out_dir):
157
"""This is for HBN diffusion data
168
179
Assuming phase-encode direction is AP/PA for topup
1810
"""
11+
12+
import nipype.interfaces.freesurfer as fs
13+
import nipype.interfaces.fsl as fsl
14+
import nipype.interfaces.io as nio
15+
import nipype.interfaces.utility as niu
16+
import nipype.pipeline.engine as pe
17+
from nipype.interfaces.dipy import DTI
18+
from nipype.workflows.dmri.fsl.artifacts import all_fsl_pipeline
19+
1920
# some bookkeeping (getting the filename, gettings the BIDS subject name)
2021
dwi_fname = op.split(dwi_file)[1].split(".nii.gz")[0]
2122
bids_sub_name = dwi_fname.split("_")[0]

0 commit comments

Comments
 (0)