Skip to content

Commit 132194e

Browse files
committed
fixing mid sagittal
1 parent 0c21621 commit 132194e

File tree

2 files changed

+10
-11
lines changed

2 files changed

+10
-11
lines changed

R/mid_sagittal_align.R

+9-10
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,13 @@ mid_sagittal_align = function(
5454
flipped = flip_lr(img)
5555

5656
omat = tempfile(fileext = ".mat")
57-
tfile = tempfile(fileext = ".nii.gz")
5857
flirt(infile = img,
5958
reffile = flipped,
60-
omat = omat, dof = 6,
59+
omat = omat,
60+
dof = 6,
6161
opts = opts,
6262
retimg = FALSE,
63-
outfile = tfile,
63+
outfile = outfile,
6464
verbose = verbose)
6565

6666
parsed = fsl_avscale(file = omat, parsed = TRUE)
@@ -84,14 +84,14 @@ mid_sagittal_align = function(
8484
initmat = new_omat,
8585
verbose = verbose,
8686
retimg = FALSE,
87-
outfile = tfile)
87+
outfile = outfile)
8888
if (force_rpi) {
8989
centered = reverse_rpi_orient_file(
90-
file = tfile,
90+
file = outfile,
9191
orientation = rp$orientation,
9292
convention = rp$convention)
9393
} else {
94-
centered = tfile
94+
centered = outfile
9595
}
9696
if (retimg) {
9797
centered = readnii(centered)
@@ -132,22 +132,21 @@ apply_mid_sagittal_align = function(
132132

133133
flipped = flip_lr(img)
134134

135-
tfile = tempfile(fileext = ".nii.gz")
136135
flirt_apply(
137136
infile = img,
138137
reffile = flipped,
139138
initmat = file_mat,
140139
verbose = verbose,
141140
opts = apply_opts,
142141
retimg = FALSE,
143-
outfile = tfile)
142+
outfile = outfile)
144143
if (force_rpi) {
145144
centered = reverse_rpi_orient_file(
146-
file = tfile,
145+
file = outfile,
147146
orientation = rp$orientation,
148147
convention = rp$convention)
149148
} else {
150-
centered = tfile
149+
centered = outfile
151150
}
152151
if (retimg) {
153152
centered = readnii(centered)

man/mid_sagittal_align.Rd

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)