darfix 4.2.0__py3-none-any.whl → 4.3.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- darfix/core/data_selection.py +11 -2
- darfix/core/dataset.py +72 -157
- darfix/core/grainplot.py +44 -56
- darfix/core/{imageStack.py → image_stack.py} +9 -15
- darfix/core/moment_types.py +6 -0
- darfix/core/{noiseremoval.py → noise_removal.py} +25 -24
- darfix/core/noise_removal_type.py +14 -0
- darfix/core/positioners.py +6 -0
- darfix/core/rocking_curves.py +6 -3
- darfix/core/rocking_curves_map.py +1 -1
- darfix/core/{shiftcorrection.py → shift_correction.py} +1 -2
- darfix/core/state_of_operation.py +7 -46
- darfix/core/utils.py +0 -39
- darfix/dtypes.py +1 -9
- darfix/gui/{binningWidget.py → binning_widget.py} +2 -29
- darfix/gui/{blindSourceSeparationWidget.py → blind_source_separation_widget.py} +4 -16
- darfix/gui/{chooseDimensions.py → choose_dimensions.py} +1 -1
- darfix/gui/concatenate_scans.py +4 -4
- darfix/gui/data_selection/{hdf5_data_selection_widgets.py → hdf5_dataset_selection_widget.py} +3 -56
- darfix/gui/data_selection/line_edits.py +54 -8
- darfix/gui/data_selection/scan_selection_widgets.py +24 -11
- darfix/gui/data_selection/utils.py +11 -0
- darfix/gui/data_selection/{WorkingDirSelectionWidget.py → working_dir_selection_widget.py} +15 -14
- darfix/gui/{dimensionsWidget.py → dimensions_widget.py} +1 -1
- darfix/gui/{displayComponentsWidget.py → display_components_widget.py} +1 -1
- darfix/gui/{filterByDimension.py → filter_by_dimension.py} +1 -1
- darfix/gui/{grainplot/dimensionRangeSlider2D.py → grain_plot/dimension_range_slider_2d.py} +2 -2
- darfix/gui/{grainplot/grainPlotWidget.py → grain_plot/grain_plot_widget.py} +1 -1
- darfix/gui/{grainplot/mosaicityWidget.py → grain_plot/mosaicity_widget.py} +21 -23
- darfix/gui/{magnificationWidget.py → magnification_widget.py} +1 -1
- darfix/gui/{noiseremoval → noise_removal}/noise_removal_widget.py +12 -16
- darfix/gui/{noiseremoval → noise_removal}/operation_list_widget.py +2 -2
- darfix/gui/{noiseremoval → noise_removal}/parameters_widget.py +6 -6
- darfix/gui/{PCAWidget.py → pca_widget.py} +2 -4
- darfix/gui/{projectionWidget.py → projection_widget.py} +1 -1
- darfix/gui/rocking_curves/{rockingCurvesPlot.py → rocking_curves_plot.py} +13 -13
- darfix/gui/rocking_curves/{rockingCurvesWidget.py → rocking_curves_widget.py} +10 -18
- darfix/gui/{roiSelectionWidget.py → roi_selection_widget.py} +9 -101
- darfix/gui/{shiftcorrection/shiftCorrectionWidget.py → shift_correction/shift_correction_widget.py} +4 -7
- darfix/gui/utils/data_path_completer.py +7 -7
- darfix/gui/utils/data_path_selection.py +4 -4
- darfix/gui/utils/{rangeSlider.py → range_slider.py} +1 -1
- darfix/gui/{weakBeamWidget.py → weak_beam_widget.py} +13 -28
- darfix/gui/{zSumWidget.py → zsum_widget.py} +1 -2
- darfix/main.py +19 -3
- darfix/processing/rocking_curves.py +12 -13
- darfix/tasks/binning.py +6 -17
- darfix/tasks/blind_source_separation.py +121 -0
- darfix/tasks/blindsourceseparation.py +8 -131
- darfix/tasks/copy.py +0 -2
- darfix/tasks/data_partition.py +39 -0
- darfix/tasks/datapartition.py +8 -50
- darfix/tasks/dimension_definition.py +197 -0
- darfix/tasks/dimensiondefinition.py +8 -197
- darfix/tasks/grain_plot.py +93 -0
- darfix/tasks/grainplot.py +8 -103
- darfix/tasks/hdf5_data_selection.py +5 -11
- darfix/tasks/hdf5_scans_concatenation.py +4 -4
- darfix/tasks/noise_removal.py +88 -0
- darfix/tasks/noiseremoval.py +8 -86
- darfix/tasks/pca.py +1 -3
- darfix/tasks/projection.py +1 -6
- darfix/tasks/rocking_curves.py +10 -5
- darfix/tasks/roi.py +0 -2
- darfix/tasks/shift_correction.py +45 -0
- darfix/tasks/shiftcorrection.py +8 -43
- darfix/tasks/transformation.py +0 -2
- darfix/tasks/weak_beam.py +71 -0
- darfix/tasks/weakbeam.py +8 -67
- darfix/tasks/zsum.py +1 -1
- darfix/tests/conftest.py +1 -1
- darfix/tests/gui/test_data_path_completer.py +4 -4
- darfix/tests/gui/test_dimension_range_slider_2d.py +2 -2
- darfix/tests/gui/test_range_slider_with_spinboxes.py +1 -1
- darfix/tests/orange/test_ewoks.py +13 -9
- darfix/tests/orange/widgets/test_hdf5_data_selection.py +93 -0
- darfix/tests/tasks/test_data_copy.py +0 -2
- darfix/tests/tasks/{test_dimensiondefinition.py → test_dimension_definition.py} +1 -1
- darfix/tests/tasks/test_weak_beam.py +9 -0
- darfix/tests/test_components_matching.py +2 -2
- darfix/tests/test_dataset.py +2 -28
- darfix/tests/test_dimension.py +1 -1
- darfix/tests/test_generate_grain_maps_nxdict.py +4 -5
- darfix/tests/test_image_operations.py +4 -4
- darfix/tests/test_image_registration.py +17 -17
- darfix/tests/test_image_stack.py +2 -13
- darfix/tests/test_mask.py +1 -1
- darfix/tests/test_moments.py +2 -2
- darfix/tests/test_rocking_curves.py +1 -3
- darfix/tests/test_shift.py +7 -7
- darfix/tests/test_workflow.py +4 -4
- darfix/tests/test_zsum.py +3 -6
- {darfix-4.2.0.dist-info → darfix-4.3.0.dist-info}/METADATA +5 -3
- {darfix-4.2.0.dist-info → darfix-4.3.0.dist-info}/RECORD +141 -135
- orangecontrib/darfix/widgets/__init__.py +10 -1
- orangecontrib/darfix/widgets/binning.py +3 -3
- orangecontrib/darfix/widgets/blindsourceseparation.py +4 -6
- orangecontrib/darfix/widgets/concatenateHDF5.py +1 -1
- orangecontrib/darfix/widgets/datacopy.py +1 -1
- orangecontrib/darfix/widgets/datapartition.py +7 -102
- orangecontrib/darfix/widgets/{datasetWidgetBase.py → dataset_widget_base.py} +17 -5
- orangecontrib/darfix/widgets/dimensions.py +6 -6
- orangecontrib/darfix/widgets/grainplot.py +3 -3
- orangecontrib/darfix/widgets/hdf5dataselection.py +34 -14
- orangecontrib/darfix/widgets/metadata.py +2 -2
- orangecontrib/darfix/widgets/noiseremoval.py +4 -4
- orangecontrib/darfix/widgets/{operationWidgetBase.py → operation_widget_base.py} +2 -2
- orangecontrib/darfix/widgets/pca.py +2 -2
- orangecontrib/darfix/widgets/projection.py +2 -2
- orangecontrib/darfix/widgets/rockingcurves.py +5 -2
- orangecontrib/darfix/widgets/roiselection.py +24 -106
- orangecontrib/darfix/widgets/rsmhistogram.py +2 -2
- orangecontrib/darfix/widgets/shiftcorrection.py +3 -3
- orangecontrib/darfix/widgets/transformation.py +4 -4
- orangecontrib/darfix/widgets/weakbeam.py +20 -103
- orangecontrib/darfix/widgets/zsum.py +3 -5
- darfix/gui/dataPartitionWidget.py +0 -167
- darfix/gui/data_selection/DataSelectionBase.py +0 -59
- darfix/tests/tasks/test_datapartition.py +0 -52
- /darfix/core/{componentsMatching.py → components_matching.py} +0 -0
- /darfix/core/{datapathfinder.py → data_path_finder.py} +0 -0
- /darfix/core/{imageRegistration.py → image_registration.py} +0 -0
- /darfix/gui/{grainplot → grain_plot}/__init__.py +0 -0
- /darfix/gui/{grainplot → grain_plot}/_oridist_toolbar_buttons.py +0 -0
- /darfix/gui/{grainplot → grain_plot}/flashlight.py +0 -0
- /darfix/gui/{grainplot → grain_plot}/flashlight_mode_action.py +0 -0
- /darfix/gui/{grainplot → grain_plot}/oridist_toolbar.py +0 -0
- /darfix/gui/{grainplot → grain_plot}/utils.py +0 -0
- /darfix/gui/{metadataWidget.py → metadata_widget.py} +0 -0
- /darfix/gui/{operationProcess.py → parallel/operation_process.py} +0 -0
- /darfix/gui/{operationThread.py → parallel/operation_thread.py} +0 -0
- /darfix/gui/rocking_curves/{fitComboBox.py → fit_combobox.py} +0 -0
- /darfix/gui/{roiLimitsToolbar.py → roi_limits_toolbar.py} +0 -0
- /darfix/gui/{rsmHistogramWidget.py → rsm_histogram_widget.py} +0 -0
- /darfix/gui/{rsmWidget.py → rsm_widget.py} +0 -0
- /darfix/gui/{shiftcorrection → shift_correction}/__init__.py +0 -0
- /darfix/gui/{shiftcorrection/shiftInput.py → shift_correction/shift_input.py} +0 -0
- /darfix/gui/utils/{standardButtonBox.py → standard_buttonbox.py} +0 -0
- /darfix/processing/{imageOperations.py → image_operations.py} +0 -0
- /darfix/tests/{test_datapathfinder.py → test_data_path_finder.py} +0 -0
- {darfix-4.2.0.dist-info → darfix-4.3.0.dist-info}/WHEEL +0 -0
- {darfix-4.2.0.dist-info → darfix-4.3.0.dist-info}/entry_points.txt +0 -0
- {darfix-4.2.0.dist-info → darfix-4.3.0.dist-info}/licenses/LICENSE +0 -0
- {darfix-4.2.0.dist-info → darfix-4.3.0.dist-info}/top_level.txt +0 -0
|
@@ -2,9 +2,9 @@ from __future__ import annotations
|
|
|
2
2
|
|
|
3
3
|
from ewokscore.missing_data import MISSING_DATA
|
|
4
4
|
|
|
5
|
-
from darfix.gui.
|
|
5
|
+
from darfix.gui.zsum_widget import ZSumWidget
|
|
6
6
|
from darfix.tasks.zsum import ZSum
|
|
7
|
-
from orangecontrib.darfix.widgets.
|
|
7
|
+
from orangecontrib.darfix.widgets.dataset_widget_base import DatasetWidgetBase
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
class ZSumWidgetOW(DatasetWidgetBase, ewokstaskclass=ZSum):
|
|
@@ -17,7 +17,7 @@ class ZSumWidgetOW(DatasetWidgetBase, ewokstaskclass=ZSum):
|
|
|
17
17
|
want_main_area = True
|
|
18
18
|
want_control_area = False
|
|
19
19
|
|
|
20
|
-
_ewoks_inputs_to_hide_from_orange =
|
|
20
|
+
_ewoks_inputs_to_hide_from_orange = "selected_axis"
|
|
21
21
|
|
|
22
22
|
def __init__(self):
|
|
23
23
|
super().__init__()
|
|
@@ -41,11 +41,9 @@ class ZSumWidgetOW(DatasetWidgetBase, ewokstaskclass=ZSum):
|
|
|
41
41
|
self._widget.setZSum(z_sum)
|
|
42
42
|
|
|
43
43
|
def _onAxisChanged(self, selectedAxis: int):
|
|
44
|
-
self.set_default_input("indices", self._widget.indices)
|
|
45
44
|
self.set_dynamic_input("selected_axis", selectedAxis)
|
|
46
45
|
self.execute_ewoks_task_without_propagation()
|
|
47
46
|
|
|
48
47
|
def _onUncheckFiltering(self):
|
|
49
|
-
self.set_default_input("indices", None)
|
|
50
48
|
self.set_dynamic_input("selected_axis", None)
|
|
51
49
|
self.execute_ewoks_task_without_propagation()
|
|
@@ -1,167 +0,0 @@
|
|
|
1
|
-
from __future__ import annotations
|
|
2
|
-
|
|
3
|
-
from typing import Optional
|
|
4
|
-
|
|
5
|
-
import numpy
|
|
6
|
-
from silx.gui import qt
|
|
7
|
-
from silx.gui.plot import Plot1D
|
|
8
|
-
|
|
9
|
-
from darfix import dtypes
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
class DataPartitionWidget(qt.QMainWindow):
|
|
13
|
-
sigComputeHistogram = qt.Signal()
|
|
14
|
-
"emit when the user ask for computing the histogram"
|
|
15
|
-
sigPartitionData = qt.Signal()
|
|
16
|
-
"emit when the user ask for filtering the data"
|
|
17
|
-
sigAbort = qt.Signal()
|
|
18
|
-
"emit when user request to abort the processing"
|
|
19
|
-
sigNbBinsChanged = qt.Signal(int)
|
|
20
|
-
"emit when the number of bins has changed"
|
|
21
|
-
sigBottomBinChanged = qt.Signal(int)
|
|
22
|
-
"emit when the bottom bin has changed"
|
|
23
|
-
sigTopBinChanged = qt.Signal(int)
|
|
24
|
-
"emit when the top bin has changed"
|
|
25
|
-
|
|
26
|
-
def __init__(self, parent=None):
|
|
27
|
-
qt.QMainWindow.__init__(self, parent)
|
|
28
|
-
self._dataset = None
|
|
29
|
-
|
|
30
|
-
self._plot = Plot1D()
|
|
31
|
-
|
|
32
|
-
binsLabel = qt.QLabel("Number of histogram bins:")
|
|
33
|
-
filterRangeLabel = qt.QLabel("Filter range:")
|
|
34
|
-
self._bins = qt.QLineEdit("")
|
|
35
|
-
self._bins.setToolTip(
|
|
36
|
-
"Defines the number of equal-width bins in the given range for the histogram"
|
|
37
|
-
)
|
|
38
|
-
self._bins.setValidator(qt.QIntValidator())
|
|
39
|
-
self._bottomBinsNumber = qt.QLineEdit("")
|
|
40
|
-
self._bottomBinsNumber.setPlaceholderText("First bin")
|
|
41
|
-
self._bottomBinsNumber.setToolTip(
|
|
42
|
-
"Minimum bin to use. It is 0 if nothing is entered."
|
|
43
|
-
)
|
|
44
|
-
self._topBinsNumber = qt.QLineEdit("")
|
|
45
|
-
self._topBinsNumber.setPlaceholderText("Last bin")
|
|
46
|
-
self._topBinsNumber.setToolTip(
|
|
47
|
-
"Maximum bin to use. It is the number of bins if nothing is entered"
|
|
48
|
-
)
|
|
49
|
-
self._bottomBinsNumber.setValidator(qt.QIntValidator())
|
|
50
|
-
self._topBinsNumber.setValidator(qt.QIntValidator())
|
|
51
|
-
self._computeHistogramPB = qt.QPushButton("Compute histogram")
|
|
52
|
-
self._computePartitionPB = qt.QPushButton("Filter")
|
|
53
|
-
self._abortPB = qt.QPushButton("Abort")
|
|
54
|
-
widget = qt.QWidget(parent=self)
|
|
55
|
-
layout = qt.QGridLayout()
|
|
56
|
-
layout.addWidget(binsLabel, 0, 0, 1, 1)
|
|
57
|
-
layout.addWidget(self._bins, 0, 1, 1, 1)
|
|
58
|
-
layout.addWidget(filterRangeLabel, 1, 0, 1, 1)
|
|
59
|
-
layout.addWidget(self._bottomBinsNumber, 1, 1)
|
|
60
|
-
layout.addWidget(self._topBinsNumber, 1, 2)
|
|
61
|
-
layout.addWidget(self._computeHistogramPB, 0, 2, 1, 1)
|
|
62
|
-
layout.addWidget(self._computePartitionPB, 2, 2, 1, 1)
|
|
63
|
-
layout.addWidget(self._abortPB, 3, 2, 1, 1)
|
|
64
|
-
layout.addWidget(self._plot, 3, 0, 1, 3)
|
|
65
|
-
widget.setLayout(layout)
|
|
66
|
-
widget.setSizePolicy(qt.QSizePolicy.Minimum, qt.QSizePolicy.Minimum)
|
|
67
|
-
self.setCentralWidget(widget)
|
|
68
|
-
self._plot.hide()
|
|
69
|
-
|
|
70
|
-
self.setProcessingButtonsEnabled(enable=False)
|
|
71
|
-
|
|
72
|
-
# set up
|
|
73
|
-
self._abortPB.hide()
|
|
74
|
-
|
|
75
|
-
# connect signal / slot
|
|
76
|
-
self._abortPB.pressed.connect(self.sigAbort)
|
|
77
|
-
self._computeHistogramPB.released.connect(self.sigComputeHistogram)
|
|
78
|
-
self._computePartitionPB.released.connect(self.sigPartitionData)
|
|
79
|
-
self._bins.editingFinished.connect(self._nbBinsChanged)
|
|
80
|
-
self._bottomBinsNumber.editingFinished.connect(self._nbBottomBinChanged)
|
|
81
|
-
self._topBinsNumber.editingFinished.connect(self._nbTopBinChanged)
|
|
82
|
-
|
|
83
|
-
def _nbBinsChanged(self):
|
|
84
|
-
self.sigNbBinsChanged.emit(self.getBins())
|
|
85
|
-
|
|
86
|
-
def _nbBottomBinChanged(self):
|
|
87
|
-
self.sigBottomBinChanged.emit(self.getBottomBin())
|
|
88
|
-
|
|
89
|
-
def _nbTopBinChanged(self):
|
|
90
|
-
self.sigTopBinChanged.emit(self.getTopBin())
|
|
91
|
-
|
|
92
|
-
def setDataset(self, dataset):
|
|
93
|
-
if not isinstance(dataset, dtypes.Dataset):
|
|
94
|
-
raise dtypes.DatasetTypeError(dataset)
|
|
95
|
-
self.setBins(dataset.dataset.nframes)
|
|
96
|
-
self.setProcessingButtonsEnabled(enable=True)
|
|
97
|
-
|
|
98
|
-
def _showHistogramCallback(self):
|
|
99
|
-
sender = self.sender()
|
|
100
|
-
frames_intensity = sender.data
|
|
101
|
-
if frames_intensity is None:
|
|
102
|
-
raise RuntimeError(
|
|
103
|
-
"An exception occured during frame intensity computation."
|
|
104
|
-
)
|
|
105
|
-
self.showHistogram(frames_intensity=frames_intensity)
|
|
106
|
-
|
|
107
|
-
def showHistogram(self, frames_intensity: Optional[numpy.array]):
|
|
108
|
-
"""
|
|
109
|
-
Plots the frame intensity histogram.
|
|
110
|
-
"""
|
|
111
|
-
self._abortPB.hide()
|
|
112
|
-
self._abortPB.setEnabled(True)
|
|
113
|
-
self._computePartitionPB.setEnabled(True)
|
|
114
|
-
self._computeHistogramPB.setEnabled(True)
|
|
115
|
-
self._plot.clear()
|
|
116
|
-
if frames_intensity is not None:
|
|
117
|
-
values, bins = numpy.histogram(
|
|
118
|
-
frames_intensity, numpy.arange(self.getBins())
|
|
119
|
-
)
|
|
120
|
-
self._plot.addHistogram(values, bins, fill=True)
|
|
121
|
-
self._plot.show()
|
|
122
|
-
|
|
123
|
-
# bins getter / setter
|
|
124
|
-
def getBins(self) -> Optional[int]:
|
|
125
|
-
text = self._bins.text().replace(" ", "")
|
|
126
|
-
if text == "":
|
|
127
|
-
return None
|
|
128
|
-
else:
|
|
129
|
-
return int(text)
|
|
130
|
-
|
|
131
|
-
def setBins(self, value: int | str | None):
|
|
132
|
-
if value in ("", None):
|
|
133
|
-
self._bins.clear()
|
|
134
|
-
else:
|
|
135
|
-
self._bins.setText(str(value))
|
|
136
|
-
|
|
137
|
-
def getBottomBin(self) -> Optional[int]:
|
|
138
|
-
text = self._bottomBinsNumber.text().replace(" ", "")
|
|
139
|
-
if text == "":
|
|
140
|
-
return None
|
|
141
|
-
else:
|
|
142
|
-
return int(text)
|
|
143
|
-
|
|
144
|
-
def setBottomBin(self, value: int | str | None):
|
|
145
|
-
if value in ("", None):
|
|
146
|
-
self._bottomBinsNumber.clear()
|
|
147
|
-
else:
|
|
148
|
-
self._bottomBinsNumber.setText(str(value))
|
|
149
|
-
|
|
150
|
-
def getTopBin(self) -> Optional[int]:
|
|
151
|
-
text = self._topBinsNumber.text().replace(" ", "")
|
|
152
|
-
if text == "":
|
|
153
|
-
return None
|
|
154
|
-
else:
|
|
155
|
-
return int(text)
|
|
156
|
-
|
|
157
|
-
def setTopBin(self, value: int | str | None):
|
|
158
|
-
if value in ("", None):
|
|
159
|
-
self._topBinsNumber.clear()
|
|
160
|
-
else:
|
|
161
|
-
self._topBinsNumber.setText(str(value))
|
|
162
|
-
|
|
163
|
-
# util function
|
|
164
|
-
def setProcessingButtonsEnabled(self, enable: bool):
|
|
165
|
-
self._abortPB.setEnabled(not enable)
|
|
166
|
-
self._computePartitionPB.setEnabled(enable)
|
|
167
|
-
self._computeHistogramPB.setEnabled(enable)
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
from __future__ import annotations
|
|
2
|
-
|
|
3
|
-
from silx.gui import qt
|
|
4
|
-
|
|
5
|
-
from .WorkingDirSelectionWidget import WorkingDirSelectionWidget
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
class DataSelectionBase(qt.QTabWidget):
|
|
9
|
-
"""Define the base class to define the data selection"""
|
|
10
|
-
|
|
11
|
-
sigRawDataInfosChanged = qt.Signal()
|
|
12
|
-
sigDarkDataInfosChanged = qt.Signal()
|
|
13
|
-
sigTreatedDirInfoChanged = qt.Signal()
|
|
14
|
-
|
|
15
|
-
def __init__(self, parent: qt.QWidget | None = None) -> None:
|
|
16
|
-
super().__init__(parent)
|
|
17
|
-
|
|
18
|
-
self._dataset = None
|
|
19
|
-
self.bg_dataset = None
|
|
20
|
-
self.indices = None
|
|
21
|
-
self.bg_indices = None
|
|
22
|
-
|
|
23
|
-
self._rawDataWidget = self.buildRawDataWidget()
|
|
24
|
-
self.addTab(self._rawDataWidget, "raw data")
|
|
25
|
-
|
|
26
|
-
self._darkDataWidget = self.buildDarkDataWidget()
|
|
27
|
-
self.addTab(self._darkDataWidget, "dark data")
|
|
28
|
-
|
|
29
|
-
self._treatedDirWidget = self.buildProcessedDataWidget()
|
|
30
|
-
self.addTab(self._treatedDirWidget, "treated data")
|
|
31
|
-
|
|
32
|
-
# connect signal / slot
|
|
33
|
-
self._treatedDirData.dirChanged.connect(self.sigTreatedDirInfoChanged)
|
|
34
|
-
|
|
35
|
-
def getTreatedDir(self) -> str:
|
|
36
|
-
return self._treatedDirData.getDir()
|
|
37
|
-
|
|
38
|
-
def setTreatedDir(self, _dir):
|
|
39
|
-
self._treatedDirData.setDir(_dir)
|
|
40
|
-
|
|
41
|
-
def buildProcessedDataWidget(self):
|
|
42
|
-
widget = qt.QWidget()
|
|
43
|
-
widget.setLayout(qt.QVBoxLayout())
|
|
44
|
-
self._treatedDirData = WorkingDirSelectionWidget(parent=self)
|
|
45
|
-
widget.layout().addWidget(self._treatedDirData)
|
|
46
|
-
spacer = qt.QWidget()
|
|
47
|
-
spacer.setSizePolicy(qt.QSizePolicy.Expanding, qt.QSizePolicy.Expanding)
|
|
48
|
-
widget.layout().addWidget(spacer)
|
|
49
|
-
return widget
|
|
50
|
-
|
|
51
|
-
# Base class API to be redefined
|
|
52
|
-
def buildRawDataWidget(self):
|
|
53
|
-
raise NotImplementedError("Base class")
|
|
54
|
-
|
|
55
|
-
def buildDarkDataWidget(self):
|
|
56
|
-
raise NotImplementedError("Base class")
|
|
57
|
-
|
|
58
|
-
def keepDataOnDisk(self) -> bool:
|
|
59
|
-
raise NotImplementedError("Base class")
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import numpy
|
|
2
|
-
import pytest
|
|
3
|
-
|
|
4
|
-
from darfix import dtypes
|
|
5
|
-
from darfix.tasks.datapartition import DataPartition
|
|
6
|
-
from darfix.tests.utils import createDataset
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
@pytest.fixture
|
|
10
|
-
def one_motor_dataset():
|
|
11
|
-
# Dataset with scan shape 100, and frame shape 3,3, with frame intensity gradually increasing from 1 to 10
|
|
12
|
-
return dtypes.Dataset(
|
|
13
|
-
dataset=createDataset(
|
|
14
|
-
data=numpy.linspace(1, 10, 100).repeat(9).reshape((100, 3, 3))
|
|
15
|
-
),
|
|
16
|
-
)
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
def test_data_partition(one_motor_dataset):
|
|
20
|
-
|
|
21
|
-
# test default processing
|
|
22
|
-
task = DataPartition(
|
|
23
|
-
inputs={
|
|
24
|
-
"dataset": one_motor_dataset,
|
|
25
|
-
}
|
|
26
|
-
)
|
|
27
|
-
task.run()
|
|
28
|
-
|
|
29
|
-
# if no filtering then indices of all frames must exist
|
|
30
|
-
numpy.testing.assert_array_equal(
|
|
31
|
-
task.outputs.dataset.indices,
|
|
32
|
-
numpy.arange(0, 100, step=1),
|
|
33
|
-
)
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
def test_data_partition_with_filtering(one_motor_dataset):
|
|
37
|
-
|
|
38
|
-
# test filtering
|
|
39
|
-
task = DataPartition(
|
|
40
|
-
inputs={
|
|
41
|
-
"dataset": one_motor_dataset,
|
|
42
|
-
"filter_bottom_bin_idx": 5,
|
|
43
|
-
"filter_top_bin_idx": 45,
|
|
44
|
-
},
|
|
45
|
-
)
|
|
46
|
-
task.run()
|
|
47
|
-
|
|
48
|
-
# if filtering then some indices must be ignored
|
|
49
|
-
assert not numpy.array_equal(
|
|
50
|
-
task.outputs.dataset.indices,
|
|
51
|
-
numpy.arange(0, 100, step=1),
|
|
52
|
-
)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|