Commit 4274e519 authored by Julia Garriga Ferrer's avatar Julia Garriga Ferrer
Browse files

[gui][grainplot] Add export button

parent 5b945fd2
Pipeline #51523 failed with stage
in 2 minutes and 37 seconds
......@@ -40,6 +40,7 @@ from silx.utils.enum import Enum as _Enum
import darfix
from .operationThread import OperationThread
from darfix.io.utils import write_maps
class Method(_Enum):
......@@ -90,10 +91,13 @@ class GrainPlotWidget(qt.QMainWindow):
levelsLayout.addWidget(self._contoursPlot, 2, 0, 1, 3)
self._levelsWidget.setLayout(levelsLayout)
self._mosaicityPlot = Plot2D(parent=self)
self._exportButton = qt.QPushButton("Export")
self._exportButton.clicked.connect(self._saveMaps)
layout.addWidget(self._methodCB)
layout.addWidget(self._levelsWidget)
layout.addWidget(self._plotWidget)
layout.addWidget(self._mosaicityPlot)
layout.addWidget(self._exportButton)
self._plotWidget.hide()
self._mosaicityPlot.hide()
self._mosaicityPlot.getColorBarWidget().hide()
......@@ -273,3 +277,16 @@ class GrainPlotWidget(qt.QMainWindow):
img[img < Imin] = Imin
return medfilt2d(img)
def _saveMaps(self):
"""
Loads the file from a FileDialog.
"""
fileDialog = qt.QFileDialog()
fileDialog.setFileMode(fileDialog.AnyFile)
fileDialog.setAcceptMode(fileDialog.AcceptSave)
fileDialog.setOption(fileDialog.DontUseNativeDialog)
fileDialog.setDefaultSuffix(".h5")
# if fileDialog.exec_():
# write_maps(fileDialog.selectedFiles()[0], 'entry',)
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment