Skip to content

Commit

Permalink
add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
wasserth committed Jun 18, 2024
1 parent e648b08 commit 0dc2b85
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions totalsegmentator/preview.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from totalsegmentator.map_to_binary import class_map


np.random.seed(1234)
np.random.seed(1234) # only set for numpy, not for random, because this would lead to same tmp directories for xvfb
random_colors = np.random.rand(100, 4)

roi_groups = {
Expand Down Expand Up @@ -217,6 +217,6 @@ def plot_subject(ct_img, output_path, df=None, roi_data=None, smoothing=20,

def generate_preview(ct_in, file_out, roi_data, smoothing, task_name):
from xvfbwrapper import Xvfb
# do not set random seed, otherwise can not call xvfb in parallel, because all generate same tmp dir
# do not set random seed, otherwise can not call xvfb in parallel, because all generate same tmp dir (numpy random seed is ok)
with Xvfb() as xvfb:
plot_subject(ct_in, file_out, None, roi_data, smoothing, task_name)

0 comments on commit 0dc2b85

Please sign in to comment.