Skip to content

Commit 9780a0c

Browse files
committed
minor bug fixes
1 parent 394a848 commit 9780a0c

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

src/deface.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,8 @@ def reorganize_into_bids(input_bids_dir, subj_dir, sess_dir, primary_t1, defacin
101101
if dirpath.name.startswith('workdir') or dirpath.name.endswith('QC'):
102102
shutil.move(dirpath, intermediate_files_dir)
103103

104-
# if not no_clean:
105-
# shutil.rmtree(intermediate_files_dir)
104+
if not no_clean:
105+
shutil.rmtree(intermediate_files_dir)
106106

107107

108108
def run_afni_refacer(primary_t1, others, subj_input_dir, sess_dir, output_dir):

src/dsst_defacing_wf.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def generate_3d_renders(defaced_img, render_outdir):
6161
for idx, rot in enumerate(rotations):
6262
yaw, pitch, roll = rot[0], rot[1], rot[2]
6363
outfile = render_outdir.joinpath('defaced_render_' + str(idx) + '.png')
64-
fsleyes_render_cmd = f"fsleyes render --scene 3d -rot {yaw} {pitch} {roll} --outfile {outfile} {defaced_img} -dr 20 250 -in spline -bf 0.3 -r 100 -ns 500"
64+
fsleyes_render_cmd = f"export TMP_DISPLAY=`echo $DISPLAY`; unset DISPLAY; module unload fsl; fsleyes render --scene 3d -rot {yaw} {pitch} {roll} --outfile {outfile} {defaced_img} -dr 20 250 -in spline -bf 0.3 -r 100 -ns 500; export DISPLAY=`echo $TMP_DISPLAY`"
6565
print(fsleyes_render_cmd)
6666
run_command(fsleyes_render_cmd)
6767
print(f"Has the render been created? {outfile.exists()}")
@@ -135,7 +135,7 @@ def main():
135135
f.write('\n'.join(afni_refacer_failures)) # TODO Not very useful when running the pipeline in parallel
136136

137137
# unload fsl module and use fsleyes installed on conda env
138-
run_command(f"export TMP_DISPLAY=`echo $DISPLAY`; unset DISPLAY; module unload fsl")
138+
# os.environ['TMP_DISPLAY'] =
139139

140140
# prep for visual inspection using visualqc deface
141141
print(f"Preparing for QC by visual inspection...\n")
@@ -144,7 +144,6 @@ def main():
144144
print(f"Run the following command to start a VisualQC Deface session:\n\t{vqcdeface_cmd}\n")
145145
with open(output / 'QC_prep' / 'defacing_qc_cmd', 'w') as f:
146146
f.write(vqcdeface_cmd + '\n')
147-
run_command(f"export DISPLAY=`echo $TMP_DISPLAY`")
148147

149148

150149
if __name__ == "__main__":

0 commit comments

Comments
 (0)