Skip to content

Commit

Permalink
Merge pull request #7 from nanthony21/dev
Browse files Browse the repository at this point in the history
fixing two minor bugs with ERCreator
  • Loading branch information
nanthony21 authored Oct 13, 2021
2 parents 53f855b + ee3f5b9 commit 22d9c22
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/pwspy_gui/ExtraReflectanceCreator/ERWorkFlow.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,10 +180,9 @@ def plot(self, includeSettings: t_.List[str], binning: int, parallelProcessing:
matCombos = er.generateMaterialCombos(materials)

print("Select an ROI")
verts = cubes['cube'].sample(n=1).iloc[0].selectLassoROI() # Select an ROI to analyze
mask = Roi.fromVerts(verts, cubes['cube'].sample(n=1).iloc[0].data.shape[:-1])
roi = cubes['cube'].sample(n=1).iloc[0].selectLassoROI() # Select an ROI to analyze
cubeDict = cubes.groupby('setting').apply(lambda df: df.groupby('material')['cube'].apply(list).to_dict()).to_dict() # Transform data frame to a dict of dicts of lists for input to `plot`
self.figs.extend(er.plotExtraReflection(cubeDict, theoryR, matCombos, numericalAperture, mask))
self.figs.extend(er.plotExtraReflection(cubeDict, theoryR, matCombos, numericalAperture, roi))
if saveToPdf:
with PdfPages(os.path.join(saveDir, f"fig_{datetime.strftime(datetime.now(), '%d-%m-%Y %HH%MM%SS')}.pdf")) as pp:
for i in plt.get_fignums():
Expand Down

0 comments on commit 22d9c22

Please sign in to comment.