Skip to content

Commit

Permalink
Merge pull request #38 from DCBIA-OrthoLab/36-refactor-load_suggested…
Browse files Browse the repository at this point in the history
…_landmarks

ENH: Refactor logic to allow direct use of load_suggested_landmarks function
  • Loading branch information
jcfr authored Jun 10, 2020
2 parents 4452401 + 2dbf1a0 commit 57875e0
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions Q3DC/Q3DC.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ def setup(self):
self.ui.surfaceDeplacementCheckBox.connect('stateChanged(int)', self.onSurfaceDeplacementStateChanged)

# --------------- anatomical legend --------------
self.suggested_landmarks = self.logic.load_suggested_landmarks()
self.suggested_landmarks = self.logic.load_suggested_landmarks(
self.resourcePath('Data/base_fiducial_legend.csv'))
self.anatomical_legend_space = self.ui.landmarkModifLayout
self.anatomical_radio_buttons_layout = qt.QHBoxLayout()
self.anatomical_legend_space.addLayout(self.anatomical_radio_buttons_layout)
Expand Down Expand Up @@ -654,11 +655,9 @@ def __init__(self, interface):
self.comboboxdict = dict()

@staticmethod
def load_suggested_landmarks():
def load_suggested_landmarks(filepath):
suggested_landmarks = defaultdict(list)
suggestions_path = \
Path(__file__).parent / 'Resources' / 'Data' / 'base_fiducial_legend.csv'
with suggestions_path.open(newline='') as suggestions_file:
with open(filepath, newline='') as suggestions_file:
reader = csv.DictReader(suggestions_file)
for row in reader:
region = row['Region'].title()
Expand Down

0 comments on commit 57875e0

Please sign in to comment.