Skip to content

Commit

Permalink
Fix Python 3 issue. See SlicerProstate#358.
Browse files Browse the repository at this point in the history
  • Loading branch information
tokjun committed Oct 10, 2020
1 parent e9da7e8 commit 543b9ee
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions SliceTracker/SliceTrackerUtils/steps/plugins/charts.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def isTargetDisplacementChartDisplayable(self, selectedSeries):
approvedResults = sorted([r for r in self.session.data.registrationResults.values() if r.approved],
key=lambda result: result.seriesNumber)
nonSelectedApprovedResults = filter(lambda x: x.seriesNumber != selectedSeriesNumber, approvedResults)
if len(nonSelectedApprovedResults) == 0 or self.session.currentResult is None:
if len(list(nonSelectedApprovedResults)) == 0 or self.session.currentResult is None:
return False
return True

Expand Down Expand Up @@ -244,4 +244,4 @@ def createPlot(self, color, plotNumber):
plotSeriesNode.SetMarkerSize(3 * plotSeriesNode.GetLineWidth())

self._plotSeriesNodes.append(plotSeriesNode)
self._plotChartNode.AddAndObservePlotSeriesNodeID(plotSeriesNode.GetID())
self._plotChartNode.AddAndObservePlotSeriesNodeID(plotSeriesNode.GetID())
2 changes: 1 addition & 1 deletion SliceTracker/SliceTrackerUtils/steps/zFrameRegistration.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def loadTemplateConfigFile(self):

defaultTemplateFile = os.path.join(self.resourcesPath, "zframe", self.ZFRAME_TEMPLATE_CONFIG_FILE_NAME)

reader = csv.reader(open(defaultTemplateFile, 'rb'))
reader = csv.reader(open(defaultTemplateFile, newline=''))
try:
next(reader)
for row in reader:
Expand Down

0 comments on commit 543b9ee

Please sign in to comment.