Commit 3204bbda authored by Christoph Sahle's avatar Christoph Sahle
Browse files

small bugs

parent fe2f4d03
......@@ -10,11 +10,7 @@ from . import ui
import PyMca5.PyMcaIO.specfile as specfile
def filter_dialog(fn):
if isinstance(fn, tuple):
return fn[0]
else:
return fn
# this will use the ui module to load
......@@ -35,8 +31,7 @@ class localfilesdialog(Qt.QDialog):
self.FileName_lineEdit.setText( user_input["fn"] )
def __onBrowseSpec(self):
filename = filter_dialog( Qt.QFileDialog.getOpenFileName())
filename = Qt.QFileDialog.getOpenFileName()
self.SpecFileName_lineEdit.setText(filename)
def __onChangeSpec(self):
......@@ -66,7 +61,7 @@ class localfilesdialog(Qt.QDialog):
def __onBrowseFile(self):
filename = filter_dialog(Qt.QFileDialog.getOpenFileName())
filename = Qt.QFileDialog.getOpenFileName()
self.FileName_lineEdit.setText(filename)
......
......@@ -8,7 +8,7 @@ from silx.gui import qt as QtCore
import numpy
import string
# from PyMca5.PyMcaGraph.Plot import Plot
from PyMca5.PyMcaGraph.Plot import Plot
from six.moves import range
# from PyMca5.PyMcaGraph.backends.OpenGLBackend import OpenGLBackend
......@@ -81,7 +81,7 @@ class MaskImageWidget(sole_MaskImageWidget.MaskImageWidget):
if Ct:
print( str(e.mimeData().text()))
Cc = ( str(e.mimeData().text())).atoi()
Cc = int( str(e.mimeData().text()))
# bytearray = e.mimeData().data('application/x-qabstractitemmodeldatalist')
# data = decode_data(bytearray)
# print data
......
......@@ -81,7 +81,7 @@ class MaskImageWidget(sole_MaskImageWidget.MaskImageWidget):
if Ct:
print( str(e.mimeData().text()))
Cc = ( str(e.mimeData().text())).atoi()
Cc = int( str(e.mimeData().text()))
# bytearray = e.mimeData().data('application/x-qabstractitemmodeldatalist')
# data = decode_data(bytearray)
# print data
......
......@@ -40,14 +40,6 @@ def h5_assign_force(h5group, name, item):
del h5group[name]
h5group[name] = item
def filter_dialog(fn):
if isinstance(fn, tuple):
return fn[0]
else:
return fn
@ui.UILoadable
class spotdetectioncontrol(Qt.QDockWidget):
......@@ -342,7 +334,7 @@ class mainwindow(Qt.QMainWindow):
def write_maskDict_to_hdf5(self):
filename = str(filter_dialog(Qt.QFileDialog.getSaveFileName()))
filename = str(Qt.QFileDialog.getSaveFileName())
self.load_user_input ["roi"]= filename+":/roi_from_selector/"
......@@ -426,7 +418,7 @@ class mainwindow(Qt.QMainWindow):
def write_mask_on_file(self):
filename = filter_dialog(Qt.QFileDialog.getSaveFileName())
filename = Qt.QFileDialog.getSaveFileName()
print( filename)
if filename is not None:
filename=str(filename)
......@@ -436,7 +428,7 @@ class mainwindow(Qt.QMainWindow):
ef.WriteImage( {}, globalMask )
def write_masksDict_on_file(self):
filename = filter_dialog(Qt.QFileDialog.getSaveFileName())
filename = Qt.QFileDialog.getSaveFileName()
print( filename)
if filename is not None:
filename=str(filename)
......@@ -447,7 +439,7 @@ class mainwindow(Qt.QMainWindow):
f.close()
def load_masksDict_from_file(self):
filename = filter_dialog(Qt.QFileDialog.getOpenFileName())
filename = Qt.QFileDialog.getOpenFileName()
print( filename)
if filename is not None:
filename=str(filename)
......@@ -468,7 +460,7 @@ class mainwindow(Qt.QMainWindow):
def read_mask_from_file(self):
filename = filter_dialog(Qt.QFileDialog.getOpenFileName())
filename = Qt.QFileDialog.getOpenFileName()
if filename is not None:
filename=str(filename)
ef = edf.EdfFile( filename, "r")
......@@ -1010,7 +1002,7 @@ class mainwindow(Qt.QMainWindow):
def load_maskDict_from_hdf5(self):
filename = filter_dialog(Qt.QFileDialog.getOpenFileName(None,'Open hdf5 file with rois',filter="hdf5 (*h5)\nall files ( * )" ))
filename = Qt.QFileDialog.getOpenFileName(None,'Open hdf5 file with rois',filter="hdf5 (*h5)\nall files ( * )" )
filename=str(filename)
print( filename)
if len(filename):
......@@ -1069,7 +1061,7 @@ class mainwindow(Qt.QMainWindow):
def load_image_from_hdf5(self):
print( " load " )
filename = filter_dialog(Qt.QFileDialog.getOpenFileName())
filename = Qt.QFileDialog.getOpenFileName()
print( " OK " )
filename=str(filename)
print( filename)
......
......@@ -36,7 +36,7 @@ def mygradient(img):
def v_project(v,weight ):
norms = np.minimum( weight, np.sqrt( v[0]*v[0] + v[1]*v[1] ))
return v/ norms
def my_denoise_tv_chambolle_positive(image, weight=0.1, n_iter_max):
def my_denoise_tv_chambolle_positive(image, weight=0.1, n_iter_max=200):
ndim = image.ndim
g = np.zeros_like(p)
x = np.zeros_like(image)
......
Supports Markdown
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