Closed ericdill closed 9 years ago
good catch @CJ-Wright
Thanks @tacaswell Are these functions for general use, I am looking for a way to plot a 2D image stack without too much hassle? If so can I get an example?
Yes, they should be.
@CJ-Wright The following should work. (with you having to fill in exactly what data you want to visualize)
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import sys
from xray_vision import QtGui, QtCore
import numpy as np
from xray_vision.messenger.mpl.cross_section_2d import CrossSection2DMessenger
from xray_vision.qt_widgets import CrossSectionMainWindow
import logging
logger = logging.getLogger(__name__)
def load_cj_data(data_path):
# use the data path to do some data loading
# return a list of labels and a list of data
return return list_of_labels, list_of_data
class StackExplorer(QtGui.QMainWindow):
def __init__(self, parent=None):
QtGui.QMainWindow.__init__(self, parent=parent)
self.setWindowTitle('StackExplorer')
key_list, data_dict = load_cj_data(data_path)
self._main_window = CrossSectionMainWindow(data_list=data_dict,
key_list=key_list)
self._main_window.setFocus()
self.setCentralWidget(self._main_window)
app = QtGui.QApplication(sys.argv)
tt = StackExplorer()
tt.show()
sys.exit(app.exec_())
This should get you started. If you can provide a bit more information regarding where the data is coming from (live vs static) then I might be able to better assist you
@ericdill Thank you very much. My data is being loaded into list of images using TiffStack. Would it be possible to have the init take on the data_list and key_list as kwargs?
I mean you have the code snippet there, add those to the init if you so desire!
On Sun, Aug 23, 2015, 2:35 PM Christopher J. Wright < notifications@github.com> wrote:
@ericdill https://github.com/ericdill Thank you very much. My data is being loaded into list of images using TiffStack. Would it be possible to have the init take on the data_list and key_list as kwargs?
— Reply to this email directly or view it on GitHub https://github.com/Nikea/xray-vision/pull/70#issuecomment-133895635.
Is this also a bad line? https://github.com/ericdill/xray-vision/blob/fix-docstring/xray_vision/backend/mpl/cross_section_2d.py#L166