Commit 021cda63 authored by Julia Garriga Ferrer's avatar Julia Garriga Ferrer
Browse files

[gui][components] Obtain components from Nexus file

parent cb750153
......@@ -31,7 +31,6 @@ __date__ = "17/01/2020"
import numpy
from pathlib import Path
import silx.io
from silx.gui import qt
from silx.gui.colors import Colormap
from silx.gui.plot import StackView
......@@ -39,6 +38,7 @@ from silx.gui.plot import StackView
import darfix
from darfix.core.componentsMatching import ComponentsMatching, Method
from darfix.gui.datasetSelectionWidget import FilenameSelectionWidget
from darfix.io.utils import read_process
import logging
_logger = logging.getLogger(__file__)
......@@ -127,18 +127,17 @@ class LinkComponentsWidget(qt.QWidget):
msg.exec_()
return
file = (silx.io.open(filename)
['entry/data0/image_stack'][()])
dimensions, components, W = read_process(filename)
self._linked_sv.hide()
self._sv1.setStack(file)
self._sv1.setStack(components)
self._displayComponents[0] = True
self._sv1.show()
if all(self._displayComponents):
self._sv2.show()
self._componentsMatching = ComponentsMatching(
components=[file, self._sv2.getStack(False, True)[0]])
components=[components, self._sv2.getStack(False, True)[0]])
def _setStack2(self):
"""
......@@ -149,18 +148,17 @@ class LinkComponentsWidget(qt.QWidget):
if filename == '':
return
file = (silx.io.open(filename)
['entry/data0/image_stack'][()])
dimensions, components, W = read_process(filename)
self._linked_sv.hide()
self._sv2.setStack(file)
self._sv2.setStack(components)
self._displayComponents[1] = True
self._sv2.show()
if all(self._displayComponents):
self._sv1.show()
self._componentsMatching = ComponentsMatching(
components=[self._sv1.getStack(False, True)[0], file])
components=[self._sv1.getStack(False, True)[0], components])
self._computeB.setEnabled(True)
self._computeB.pressed.connect(self._linkComponents)
......
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