Skip to content

Commit

Permalink
Fix lesion insertion
Browse files Browse the repository at this point in the history
  • Loading branch information
malago86 committed Apr 15, 2022
1 parent fb14479 commit f901ce0
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions Victre/Pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -1381,6 +1381,21 @@ def insert_lesions(self, lesion_type=None, n=-1, lesion_file=None, lesion_size=N
cand[2],
cand_type
]))

loc = {"dm": self.get_coordinates_dm([
cand[1] + lesion.shape[1] / 2,
cand[2] + lesion.shape[2] / 2,
cand[0] + lesion.shape[0] / 2]),
"dbt": self.get_coordinates_dbt([
cand[1] + lesion.shape[1] / 2,
cand[2] + lesion.shape[2] / 2,
cand[0] + lesion.shape[0] / 2])}

self.lesion_locations["dm"].append(
list(np.round([loc["dm"][0], loc["dm"][1], cand_type]).astype(int)))

self.lesion_locations["dbt"].append(
list(np.round([loc["dbt"][0], loc["dbt"][1], loc["dbt"][2], cand_type]).astype(int)))
else:
current_seed = self.seed
np.random.seed(current_seed)
Expand Down

0 comments on commit f901ce0

Please sign in to comment.