Commit 2b0c0c4f authored by Julia Garriga Ferrer's avatar Julia Garriga Ferrer
Browse files

[gui][grainplot] Define dictionary of maps and write maps to file

parent 83d54ce4
Pipeline #51996 passed with stage
in 2 minutes and 16 seconds
......@@ -282,11 +282,22 @@ class GrainPlotWidget(qt.QMainWindow):
"""
Loads the file from a FileDialog.
"""
list_of_maps = {}
for axis, dim in self.dataset.dims:
list_of_maps[dim.name] = {
Method.COM.name: self._moments[axis][0],
Method.FWHM.name: self._moments[axis][1],
Method.SKEWNESS.name: self._moments[axis][2],
Method.KURTOSIS.name: self._moments[axis][3]
}
list_of_maps[Method.MOSAICITY.name] = hsv_to_rgb(self._computeMosaicity())
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
if fileDialog.exec_():
write_maps(fileDialog.selectedFiles()[0], list_of_maps, Method.MOSAICITY.name, 'entry', 1)
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