Skip to content

Commit 489f656

Browse files
committed
fix: set slice_times as seconds outside workflow generating function
1 parent 7b18731 commit 489f656

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

examples/rsfmri_preprocessing.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ def create_workflow(files,
278278
# Run Nipy joint slice timing and realignment algorithm
279279
realign = Node(nipy.SpaceTimeRealigner(), name='realign')
280280
realign.inputs.tr = TR
281-
realign.inputs.slice_times = (np.array(slice_times)/1000.).tolist()
281+
realign.inputs.slice_times = slice_times
282282
realign.inputs.slice_info = 2
283283

284284
if despike:
@@ -679,6 +679,7 @@ def create_resting_workflow(args):
679679
slice_thickness = None
680680
if args.dicom_file:
681681
TR, slice_times, slice_thickness = get_info(args.dicom_file)
682+
slice_times = (np.array(slice_times)/1000.).tolist()
682683

683684
if slice_thickness is None:
684685
from nibabel import load
@@ -719,9 +720,9 @@ def create_resting_workflow(args):
719720
parser.add_argument("--despike", dest="despike", default=False,
720721
action="store_true", help="Use despiked data")
721722
parser.add_argument("--TR", dest="TR", default=None,
722-
help="TR if dicom not provided")
723+
help="TR if dicom not provided in seconds")
723724
parser.add_argument("--slice_times", dest="slice_times", nargs="+",
724-
help="Slice times")
725+
type=float, help="Slice times in seconds")
725726
parser.add_argument("-l", "--lowpass_freq", dest="lowpass_freq",
726727
default=-1, help="Low pass frequency (Hz)")
727728
parser.add_argument("-u", "--highpass_freq", dest="highpass_freq",

0 commit comments

Comments
 (0)