Commit 6b1c29cf authored by Damien Naudet's avatar Damien Naudet

Added the shift

parent 935eddd9
......@@ -193,7 +193,8 @@ class XsocsGui(Qt.QMainWindow):
imageBinning=None,
roi=event.roi,
entries=event.entries,
parent=self.sender())
parent=self.sender(),
shiftH5File=event.shiftFile)
widget.exec_()
if widget.status == QSpaceWidget.StatusCompleted:
qspaceF = widget.qspaceH5
......
......@@ -29,6 +29,10 @@ __authors__ = ["D. Naudet"]
__license__ = "MIT"
__date__ = "15/09/2016"
import numpy as np
from silx.gui import qt as Qt
from ...io.XsocsH5 import XsocsH5
......@@ -50,11 +54,17 @@ class ConversionParamsWidget(Qt.QWidget):
- qspace dimensions
- image binning size
"""
def __init__(self, **kwargs):
def __init__(self,
imgBinning=None,
medfiltDims=None,
**kwargs):
super(ConversionParamsWidget, self).__init__(**kwargs)
layout = Qt.QGridLayout(self)
layout.setContentsMargins(0, 0, 0, 0)
# imgBinning = np.array(imgBinning, ndmin=1)
# medfiltDims = np.array(medfiltDims, ndmin=1)
# ===========
# Image pre processing
# ===========
......@@ -69,6 +79,7 @@ class ConversionParamsWidget(Qt.QWidget):
# Binnning
imgBinCBox = Qt.QCheckBox('1. Binning')
self.__imgBinCBox = imgBinCBox
inputBase = Qt.QWidget()
inputBase.setContentsMargins(0, 0, 0, 0)
......@@ -80,18 +91,18 @@ class ConversionParamsWidget(Qt.QWidget):
imgBinCBox.toggled.connect(inputBase.setEnabled)
imgBinCBox.setIconSize(Qt.QSize(size, size))
imgBinCBox.setChecked(False)
imgBinCBox.setChecked(True)
imgBinCBox.setChecked(False)
imgBinHEdit = StyledLineEdit(nChar=5)
imgBinHEdit.setValidator(Qt.QIntValidator(imgBinHEdit))
imgBinHEdit.setAlignment(Qt.Qt.AlignRight)
imgBinHEdit.setText(str(_DEFAULT_IMG_BIN[0]))
# imgBinHEdit.setText(str(imgBinning[0]))
imgBinVEdit = StyledLineEdit(nChar=5)
imgBinVEdit.setValidator(Qt.QIntValidator(imgBinVEdit))
imgBinVEdit.setAlignment(Qt.Qt.AlignRight)
imgBinVEdit.setText(str(_DEFAULT_IMG_BIN[1]))
# imgBinVEdit.setText(str(imgBinning[1]))
imgBinLayout.addWidget(Qt.QLabel('w='))
imgBinLayout.addWidget(imgBinHEdit)
......@@ -103,6 +114,7 @@ class ConversionParamsWidget(Qt.QWidget):
# Median filter
medfiltCBox = Qt.QCheckBox('2. Median filter')
self.__medfiltCBox = medfiltCBox
inputBase = Qt.QWidget()
inputBase.setContentsMargins(0, 0, 0, 0)
......@@ -120,12 +132,12 @@ class ConversionParamsWidget(Qt.QWidget):
medfiltHEdit = StyledLineEdit(nChar=5)
medfiltHEdit.setValidator(Qt.QIntValidator(medfiltHEdit))
medfiltHEdit.setAlignment(Qt.Qt.AlignRight)
medfiltHEdit.setText(str(_DEFAULT_MEDFILT[0]))
# medfiltHEdit.setText(str(medfiltDims[0]))
medfiltVEdit = StyledLineEdit(nChar=5)
medfiltVEdit.setValidator(Qt.QIntValidator(medfiltVEdit))
medfiltVEdit.setAlignment(Qt.Qt.AlignRight)
medfiltVEdit.setText(str(_DEFAULT_MEDFILT[1]))
# medfiltVEdit.setText(str(medfiltDims[1]))
medfiltLayout.addWidget(Qt.QLabel('w='))
medfiltLayout.addWidget(medfiltHEdit)
......@@ -176,6 +188,9 @@ class ConversionParamsWidget(Qt.QWidget):
layout.addWidget(qspaceGbox)
self.setImageBinning(imgBinning)
self.setMedfiltDims(medfiltDims)
# ===========
# size constraints
# ===========
......@@ -184,9 +199,14 @@ class ConversionParamsWidget(Qt.QWidget):
def getMedfiltDims(self):
"""
Returns the median filter dimensions, a 2 integers array.
Returns the median filter dimensions, a 2 integers array, or None if
the median filter is not enabled.
:return:
"""
if not self.__medfiltCBox.isChecked():
return None
hMedfilt = self.__medfiltHEdit.text()
if len(hMedfilt) == 0:
hMedfilt = None
......@@ -208,14 +228,21 @@ class ConversionParamsWidget(Qt.QWidget):
"""
if medfiltDims is None:
medfiltDims = (1, 1)
medfiltDims = np.array(medfiltDims, ndmin=1)
equal = np.array_equal(medfiltDims, [1, 1])
self.__medfiltHEdit.setText(str(medfiltDims[0]))
self.__medfiltVEdit.setText(str(medfiltDims[1]))
self.__medfiltCBox.setChecked(not equal)
def getImageBinning(self):
"""
Returns the image binning dimensions, a 2 integers array.
Returns the image binning dimensions, a 2 integers array, or None if
the image binning is not enabled.
:return:
"""
if not self.__imgBinCBox.isChecked():
return None
h_bin = self.__imgBinHEdit.text()
if len(h_bin) == 0:
h_bin = None
......@@ -236,8 +263,11 @@ class ConversionParamsWidget(Qt.QWidget):
"""
if imageBinning is None:
imageBinning = (1, 1)
imgBinning = np.array(imageBinning, ndmin=1)
equal = np.array_equal(imgBinning, [1, 1])
self.__imgBinHEdit.setText(str(imageBinning[0]))
self.__imgBinVEdit.setText(str(imageBinning[1]))
self.__imgBinCBox.setChecked(not equal)
def getQspaceDims(self):
"""
......@@ -290,6 +320,7 @@ class QSpaceWidget(Qt.QDialog):
medfiltDims=None,
roi=None,
entries=None,
shiftH5File=None,
**kwargs):
"""
Widgets displaying informations about data to be converted to QSpace,
......@@ -305,6 +336,7 @@ class QSpaceWidget(Qt.QDialog):
:param roi: Roi in sample coordinates (xMin, xMax, yMin, yMax)
:param entries: a list of entry names to convert to qspace. If None,
all entries found in the xsocsH5File will be used.
:param shiftH5File: name of a ShiftH5 file to use.
:param kwargs:
"""
super(QSpaceWidget, self).__init__(**kwargs)
......@@ -325,6 +357,15 @@ class QSpaceWidget(Qt.QDialog):
'the input file :\n - {0}'
''.format('\n -'.join(diff)))
self.__converter = QSpaceConverter(xsocH5File,
output_f=outQSpaceH5,
qspace_dims=qspaceDims,
img_binning=imageBinning,
medfilt_dims=medfiltDims,
roi=roi,
entries=entries,
shiftH5_f=shiftH5File)
self.__params = {'roi': roi,
'xsocsH5_f': xsocH5File,
'qspaceH5_f': outQSpaceH5}
......@@ -367,8 +408,28 @@ class QSpaceWidget(Qt.QDialog):
grpLayout = Qt.QVBoxLayout(scansGbx)
infoLayout = Qt.QGridLayout()
grpLayout.addLayout(infoLayout)
#
line = 0
style = Qt.qApp.style()
shiftLayout = Qt.QHBoxLayout()
if shiftH5File is not None:
shiftText = 'Shift applied.'
icon = Qt.QStyle.SP_MessageBoxWarning
else:
shiftText = 'No shift applied.'
icon = Qt.QStyle.SP_MessageBoxInformation
shiftLabel = Qt.QLabel(shiftText)
size = style.pixelMetric(Qt.QStyle.PM_ButtonIconSize)
shiftIcon = Qt.QLabel()
icon = style.standardIcon(icon)
shiftIcon.setPixmap(icon.pixmap(size))
shiftLayout.addWidget(shiftIcon)
shiftLayout.addWidget(shiftLabel)
infoLayout.addLayout(shiftLayout, line, 0)
line = 1
label = Qt.QLabel('# Roi :')
self.__roiXMinEdit = xMinText = StyledLineEdit(nChar=5, readOnly=True)
self.__roiXMaxEdit = xMaxText = StyledLineEdit(nChar=5, readOnly=True)
......@@ -411,9 +472,10 @@ class QSpaceWidget(Qt.QDialog):
grpLayout = Qt.QVBoxLayout(convGbx)
topLayout.addWidget(convGbx, 1, 0, alignment=Qt.Qt.AlignTop)
self.__paramsWid = paramsWid = ConversionParamsWidget()
paramsWid.setImageBinning(imageBinning)
paramsWid.setMedfiltDims(medfiltDims)
imgBinning = self.__converter.image_binning
medfiltDims = self.__converter.medfilt_dims
self.__paramsWid = paramsWid = ConversionParamsWidget(
imgBinning=imgBinning, medfiltDims=medfiltDims)
grpLayout.addWidget(paramsWid)
# ################
......@@ -450,14 +512,6 @@ class QSpaceWidget(Qt.QDialog):
# setting initial state
# #################
self.__converter = QSpaceConverter(xsocH5File,
output_f=outQSpaceH5,
qspace_dims=qspaceDims,
img_binning=imageBinning,
medfilt_dims=medfiltDims,
roi=roi,
entries=entries)
cancelBn.clicked.connect(self.close)
convertBn.clicked.connect(self.__slotConvertBnClicked)
......
......@@ -263,6 +263,52 @@ class QSpaceInfoNode(Node):
# Adding ROI info
##################################################
shifts = qspaceH5.shifts
shiftNode = Node(nodeName='Shift')
if shifts is None:
shiftNode.setData(ModelColumns.ValueColumn,
'No.',
role=Qt.Qt.DisplayRole)
else:
shiftNode.setData(ModelColumns.ValueColumn,
'Yes.',
role=Qt.Qt.DisplayRole)
style = Qt.qApp.style()
icon = style.standardIcon(Qt.QStyle.SP_MessageBoxWarning)
shiftNode.setData(ModelColumns.ValueColumn,
icon,
role=Qt.Qt.DecorationRole)
for entry in selected:
eShiftNode = Node(nodeName=entry)
shift = shifts[entry]
sampleShift = shift['shift']
gridShift = shift['grid_shift']
text = ''
if sampleShift is not None:
text = 'sample:[{0:6g}, {1:6g}]'.format(*sampleShift)
if gridShift is not None:
if text:
text += ', '
text += 'grid:{0}'.format(gridShift)
if not text:
text = 'unknown'
eShiftNode.setData(ModelColumns.ValueColumn,
text,
role=Qt.Qt.DisplayRole)
shiftNode.appendChild(eShiftNode)
children.append(shiftNode)
##################################################
# Adding ROI info
##################################################
sampleRoi = qspaceH5.sample_roi
toolTip = """<ul>
<li>xMin : {0:.7g}
......@@ -274,18 +320,23 @@ class QSpaceInfoNode(Node):
roiNode = Node(nodeName='Roi')
text = '{0:6g}, {1:6g}, {2:6g}, {3:6g}'.format(*sampleRoi)
roiNode._setDataInternal(ModelColumns.ValueColumn, text)
roiNode._setDataInternal(ModelColumns.NameColumn, toolTip, Qt.Qt.ToolTipRole)
roiNode._setDataInternal(ModelColumns.NameColumn,
toolTip, Qt.Qt.ToolTipRole)
node = Node(nodeName='xMin')
node._setDataInternal(ModelColumns.ValueColumn, '{0:.7g}'.format(sampleRoi[0]))
node._setDataInternal(ModelColumns.ValueColumn,
'{0:.7g}'.format(sampleRoi[0]))
roiNode.appendChild(node)
node = Node(nodeName='xMax')
node._setDataInternal(ModelColumns.ValueColumn, '{0:.7g}'.format(sampleRoi[1]))
node._setDataInternal(ModelColumns.ValueColumn,
'{0:.7g}'.format(sampleRoi[1]))
roiNode.appendChild(node)
node = Node(nodeName='yMin')
node._setDataInternal(ModelColumns.ValueColumn, '{0:.7g}'.format(sampleRoi[2]))
node._setDataInternal(ModelColumns.ValueColumn,
'{0:.7g}'.format(sampleRoi[2]))
roiNode.appendChild(node)
node = Node(nodeName='yMax')
node._setDataInternal(ModelColumns.ValueColumn, '{0:.7g}'.format(sampleRoi[3]))
node._setDataInternal(ModelColumns.ValueColumn,
'{0:.7g}'.format(sampleRoi[3]))
roiNode.appendChild(node)
children.append(roiNode)
......
# coding: utf-8
# /*##########################################################################
#
# Copyright (c) 2015-2016 European Synchrotron Radiation Facility
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#
# ###########################################################################*/
from __future__ import absolute_import
__authors__ = ["D. Naudet"]
__license__ = "MIT"
__date__ = "15/09/2016"
import os
from ...io.ShiftH5 import ShiftH5
from .ProjectItem import ProjectItem
from .ProjectDef import ItemClassDef
@ItemClassDef('ShiftGroup')
class ShiftGroup(ProjectItem):
""" Project item containing a group of fit results. """
def addShiftFile(self, shiftFile):
"""
Adds a shift file to this group. Creates a FitItem.
:param shiftFile:
:return:
"""
childs = self.getShiftItems()
if len(childs) > 0:
raise NotImplementedError('Only one shift file supported '
'at the moment.')
itemName = os.path.basename(shiftFile).rsplit('.')[0]
itemPath = self.path + '/' + itemName
item = ShiftItem(self.filename, itemPath, mode='a')
item.shiftFile = shiftFile
return item
def getShiftItems(self):
"""
Returns all shift items in this group.
:return:
"""
return self.children(classinfo=ShiftItem)
@ItemClassDef('ShiftItem')
class ShiftItem(ProjectItem):
""" Project item containing shift values. """
ShiftH5FilePath = 'input'
def __init__(self, *args, **kwargs):
self.__shiftFile = None
super(ShiftItem, self).__init__(*args, **kwargs)
shiftH5 = property(lambda self: ShiftH5(self.shiftFile)
if self.shiftFile else None)
@property
def shiftFile(self):
""" The name of the input data file. """
if self.__shiftFile is None:
with self._get_file() as h5f:
path = self.path + '/' + ShiftItem.ShiftH5FilePath
if path in h5f:
group = h5f.get(path)
if group:
self.__shiftFile = group.file.filename
del group
return self.__shiftFile
@shiftFile.setter
def shiftFile(self, shiftFile):
""" Set the Shift data file for this item. The Shift data
file can only be set once. To use a different data file you have to
create a new project. """
# TODO : make sure file exists and is readable
if self.shiftFile is not None:
raise ValueError('Shift input file is already set.')
# Adding the external link to the file
self.__shiftFile = shiftFile
path = self.path + '/' + ShiftItem.ShiftH5FilePath
self.add_file_link(path, shiftFile, '/')
self.setHidden(True, path)
self._createItem()
def _createItem(self):
shiftFile = self.shiftFile
if shiftFile is None:
return
if __name__ == '__main__':
pass
......@@ -30,11 +30,15 @@ __license__ = "MIT"
__date__ = "15/09/2016"
import os
import numpy as np
from .ProjectDef import ItemClassDef
from .ProjectItem import ProjectItem
from .AcqDataGroup import AcqDataGroup
from .IntensityGroup import IntensityGroup
from .QSpaceGroup import QSpaceGroup
from .ShiftGroup import ShiftGroup
from ...io.ShiftH5 import ShiftH5Writer
@ItemClassDef('XsocsProject')
......@@ -43,6 +47,7 @@ class XsocsProject(ProjectItem):
# ScanPositionsPath = '/Positions'
IntensityGroupPath = '/Intensity'
QSpaceGroupPath = '/QSpace'
ShiftGroupPath = '/Shift'
XsocsNone, XsocsInput, XsocsQSpace, XsocsFit = range(4)
......@@ -55,6 +60,8 @@ class XsocsProject(ProjectItem):
workdir = property(lambda self: os.path.dirname(self.filename))
def _createItem(self):
super(XsocsProject, self)._createItem()
AcqDataGroup(self.filename,
self.AcquisitionGroupPath,
mode=self.mode,
......@@ -68,6 +75,25 @@ class XsocsProject(ProjectItem):
mode=self.mode,
gui=self.gui)
# TODO : get prefix
xsocsFile = os.path.basename(self.filename)
xsocsPrefix = xsocsFile.rpartition('.')[0]
shiftFile = '{0}_shift.h5'.format(xsocsPrefix)
shiftFile = os.path.join(self.workdir, shiftFile)
writer = ShiftH5Writer(shiftFile, mode='w')
xsocsH5 = self.xsocsH5
entries = xsocsH5.entries()
for entry in entries:
n_images = xsocsH5.n_images(entry)
writer.create_entry(entry, n_points=n_images)
shiftGroup = ShiftGroup(self.filename,
self.ShiftGroupPath,
mode=self.mode,
gui=self.gui)
shiftGroup.setHidden(True)
shiftGroup.addShiftFile(shiftFile)
def positions(self, entry):
with self.xsocsH5 as xsocsH5:
if entry == 'Total':
......@@ -82,7 +108,10 @@ class XsocsProject(ProjectItem):
:return: str
"""
with self.xsocsH5 as xsocsH5:
return str(xsocsH5.scan_angle(entry))
angle = xsocsH5.scan_angle(entry)
if angle is None:
return None
return str(angle)
def qspaceGroup(self, mode=None):
mode = mode or self.mode
......@@ -96,6 +125,12 @@ class XsocsProject(ProjectItem):
self.IntensityGroupPath,
mode=mode)
def shiftGroup(self, mode=None):
mode = mode or self.mode
return ShiftGroup(self.filename,
self.ShiftGroupPath,
mode=mode)
if __name__ == '__main__':
pass
This diff is collapsed.
......@@ -36,15 +36,19 @@ import numpy as np
from silx.gui import qt as Qt
from .PlotModel import PlotTree
from .IntensityModel import IntensityTree, IntensityTotalNode
from .IntensityModel import IntensityTree, IntensityGroupNode
from .RectRoiWidget import RectRoiWidget
from ..shift.ShiftView import ShiftWidget
from ...model.ModelDef import ModelRoles
from ...widgets.XsocsPlot2D import XsocsPlot2D
from ...widgets.Buttons import FixedSizePushButon
IntensityViewEvent = namedtuple('IntensityViewEvent', ['roi', 'entries'])
IntensityViewEvent = namedtuple('IntensityViewEvent', ['roi',
'entries',
'shiftFile'])
class IntensityView(Qt.QMainWindow):
......@@ -70,6 +74,7 @@ class IntensityView(Qt.QMainWindow):
self.__displayedNode = None
self.__selectedPoint = None
self.__shiftApplied = False
self.__plotWindow = plotWindow = XsocsPlot2D()
plotWindow.setShowMousePosition(True)
......@@ -79,16 +84,30 @@ class IntensityView(Qt.QMainWindow):
selector = Qt.QWidget()
layout = Qt.QVBoxLayout(selector)
shiftLayout = Qt.QHBoxLayout()
shiftCb = Qt.QCheckBox('[WIP] Apply shift')
shiftEditBn = Qt.QToolButton()
shiftEditBn.setText('Edit')
shiftEditBn.setToolTip('Edit shift values')
shiftLayout.addWidget(shiftCb)
shiftLayout.addWidget(shiftEditBn)
shiftCb.toggled.connect(self.__slotShiftToggled)
shiftEditBn.clicked.connect(self.__slotShiftEditClicked)
layout.addLayout(shiftLayout)
# TODO : check item type
self.__iGroup = intensityGroup
self.__tree = tree = IntensityTree(intensityGroup, parent=self)
self.__tree = tree = IntensityTree(intensityGroup,
parent=self)
tree.model().dataChanged.connect(self.__slotModelDataChanged)
tree.sigCurrentChanged.connect(self.__slotItemSelected)
layout.addWidget(tree)
bnLayout = Qt.QHBoxLayout()
selAllBn = FixedSizePushButon('Select All')
selNoneBn = FixedSizePushButon('Clear')
selNoneBn = FixedSizePushButon('Unselect All')
selAllBn.clicked.connect(tree.model().checkAll)
selNoneBn.clicked.connect(tree.model().uncheckAll)
bnLayout.addWidget(selAllBn)
......@@ -134,7 +153,70 @@ class IntensityView(Qt.QMainWindow):
self.setCentralWidget(plotWindow)
iGroupIndex = tree.model().iGroupNodeIndex()
tree.selectionModel().setCurrentIndex(iGroupIndex,
Qt.QItemSelectionModel.ClearAndSelect)
def __slotShiftToggled(self, checked):
"""
Slot called when the 'apply shift' checkbox is toggled.
:param checked:
:return:
"""
self.__shiftApplied = checked
tree = self.__tree
model = tree.model()
if checked:
sItems = self.__iGroup.projectRoot().shiftGroup().getShiftItems()
if len(sItems) > 1:
raise NotImplementedError('Only one shift item supported '
'right now.')
sItem = sItems[0]
else:
sItem = None
# at the moment a shift item is created the first time the project
# is created
# couldnt set the curstor with QWidget.setCursor for some reason
Qt.qApp.setOverrideCursor(Qt.Qt.WaitCursor)
model.setShiftItem(sItem)
indexes = self.__tree.selectedIndexes()
if len(indexes) == 0:
index = model.index(0,
0,
tree.rootIndex())
tree.selectionModel().select(
index,
Qt.QItemSelectionModel.ClearAndSelect)
else:
# only one index is selectable
index = indexes[0]
self.__slotItemSelected(index.data(ModelRoles.InternalDataRole))
Qt.qApp.restoreOverrideCursor()
def __slotShiftEditClicked(self):
"""
Slot called when the 'edit shift' button is clicked.
:return:
"""
# TODO : only one shift item supported at the moment
shiftItem = self.__iGroup.projectRoot().shiftGroup().getShiftItems()[0]
shiftWidget = ShiftWidget(self.__iGroup, shiftItem, parent=self)
shiftWidget.setAttribute(Qt.Qt.WA_DeleteOnClose)
shiftWidget.setWindowModality(Qt.Qt.WindowModal)
shiftWidget.show()
def __slotModelDataChanged(self, topLeft, bottomRight, roles=None):
"""
Slot called when data changes in the model. In this case it is
when an entry is checked or unchecked.
:param topLeft:
:param bottomRight:
:param roles:
:return:
"""
nodeL = topLeft.data(ModelRoles.InternalDataRole)
nodeR = bottomRight.data(ModelRoles.InternalDataRole)
......@@ -145,7 +227,7 @@ class IntensityView(Qt.QMainWindow):
if nodeL is None:
return
if not isinstance(nodeL, IntensityTotalNode):
if not isinstance(nodeL, IntensityGroupNode):
return
# else: the total intensity has changed.
......@@ -164,11 +246,13 @@ class IntensityView(Qt.QMainWindow):
self.__displayedNode = node
intensity, positions = node.scatterData()
title = node.nodeName
if intensity is None:
self.__plotWindow.clear()
self.__plotWindow.setGraphTitle(title)
return
self.setPlotData(positions.pos_0, positions.pos_1, intensity, title)
self.setPlotData(positions[0], positions[1], intensity, title)
def setPlotData(self, x, y, data, title=None):
"""
......@@ -240,7 +324,15 @@ class IntensityView(Qt.QMainWindow):
selEntries = [entries[idx] for idx in selected]
event = IntensityViewEvent(roi=roi, entries=selEntries)
if self.__shiftApplied:
shiftGroup = self.__iGroup.projectRoot().shiftGroup()
# TODO : only one shift file supported right now
shiftFile = shiftGroup.getShiftItems()[0].shiftFile
else:
shiftFile = None
event = IntensityViewEvent(roi=roi,
entries=selEntries,
shiftFile=shiftFile)
self.sigProcessApplied.emit(event)
......
......@@ -33,6 +33,7 @@ def configuration(parent_package='', top_path=None):
config = Configuration('view', parent_package, top_path)
config.add_subpackage('fitview')
config.add_subpackage('intensity')
config.add_subpackage('shift')
return config
......
This diff is collapsed.
This diff is collapsed.
# coding: utf-8
# /*##########################################################################
#
# Copyright (c) 2015-2016 European Synchrotron Radiation Facility
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions: