Commit f74c53c5 authored by Julia Garriga Ferrer's avatar Julia Garriga Ferrer
Browse files

[app][ows_to_script] Set first filename directory as _dir if it's not given

parent 4fd2295c
Pipeline #52388 passed with stage
in 5 minutes and 2 seconds
...@@ -120,6 +120,7 @@ if __name__ == '__main__': ...@@ -120,6 +120,7 @@ if __name__ == '__main__':
filenames=filenames, filenames=filenames,
copy_files=True, in_memory=not options.in_disk) copy_files=True, in_memory=not options.in_disk)
else: else:
_dir = _dir if _dir != None else os.path.dirname(options.first_filename)
dataset = Dataset(_dir=_dir, dataset = Dataset(_dir=_dir,
first_filename=options.first_filename, first_filename=options.first_filename,
copy_files=True, in_memory=not options.in_disk) copy_files=True, in_memory=not options.in_disk)
......
...@@ -1302,7 +1302,7 @@ class Dataset(): ...@@ -1302,7 +1302,7 @@ class Dataset():
H, W = self.get_data(0).shape H, W = self.get_data(0).shape
if self.dims.ndim == 1 and kind=="rsm": if self.dims.ndim == 1 and kind == "rsm":
ffz = self.get_metadata_values(POSITIONER_METADATA, "ffz")[0] ffz = self.get_metadata_values(POSITIONER_METADATA, "ffz")[0]
mainx = -self.get_metadata_values(POSITIONER_METADATA, "mainx")[0] mainx = -self.get_metadata_values(POSITIONER_METADATA, "mainx")[0]
self.transformation = compute_rsm(H, W, d, ffz, mainx) self.transformation = compute_rsm(H, W, d, ffz, mainx)
......
...@@ -120,17 +120,16 @@ class TransformationWidgetOW(OWWidget): ...@@ -120,17 +120,16 @@ class TransformationWidgetOW(OWWidget):
self.controlArea.layout().addWidget(self._widget) self.controlArea.layout().addWidget(self._widget)
self._widget.setDataset(*self._dataset) self._widget.setDataset(*self._dataset)
def _sendSignal(self): def _sendSignal(self):
""" """
Emits the signal with the new dataset. Emits the signal with the new dataset.
""" """
if hasattr(self._widget, 'magnification'): if hasattr(self._widget, 'magnification'):
self.magnification = self._widget.magnification self.magnification = self._widget.magnification
self.kind=False self.kind = False
elif hasattr(self._widget, 'pixelSize'): elif hasattr(self._widget, 'pixelSize'):
self.pixelSize = self._widget.pixelSize self.pixelSize = self._widget.pixelSize
self.rotate = self._widget.rotate self.rotate = self._widget.rotate
self.kind=True self.kind = True
self.close() self.close()
self.Outputs.dataset.send(self._widget.getDataset()) self.Outputs.dataset.send(self._widget.getDataset())
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