Skip to content

Export dialog allows cropping to sizes that volumina can't handle #336

@btbest

Description

@btbest

We should add validation to the subregion settings to prevent cropping to nonsensically tiny sizes (and we should also let the area in the dialog expand if the dialog is tall enough...)

Image

Using the subregion settings to crop exports to less than 2d (i.e. making all spatial axes except for one singleton) leads to (cf ilastik/ilastik#3070 (review)):

ERROR 2025-09-24 10:06:39,905 excepthooks 13056 8611815616 Traceback (most recent call last):
  File ".../volumina/volumina/volumeEditorWidget.py", line 273, in onShapeChanged
    self._updateTileWidth()
  File ".../volumina/volumina/volumeEditorWidget.py", line 331, in _updateTileWidth
    tile_width = self._getTileWidth()
                 ^^^^^^^^^^^^^^^^^^^^
  File ".../volumina/volumina/volumeEditorWidget.py", line 348, in _getTileWidth
    key, default = self._getTileWidthConfigKeyDefault()
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".../volumina/volumina/volumeEditorWidget.py", line 336, in _getTileWidthConfigKeyDefault
    assert singletons_spacial in range(2)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError

Using the settings to crop exports to just 1px leads to:

ERROR 2025-09-26 15:11:50,092 excepthooks 21964 7528 Traceback (most recent call last):
  File "...\volumina\volumina\widgets\dataExportOptionsDlg.py", line 222, in _handleRoiChange
    opDataExport.RegionStop.setValue(newstop)
  File "...\ilastik\lazyflow\slot.py", line 73, in call_in_setup_context
    return func(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "...\ilastik\lazyflow\slot.py", line 1191, in setValue
    self._changed()
  File "...\ilastik\lazyflow\slot.py", line 1403, in _changed
    self._configureOperator(self)
  File "...\ilastik\lazyflow\slot.py", line 1418, in _configureOperator
    self.operator._setupOutputs()
  File "...\ilastik\lazyflow\operator.py", line 508, in _setupOutputs
    self.setupOutputs()
  File "...\ilastik\lazyflow\operators\ioOperators\opFormattedDataExport.py", line 210, in setupOutputs
    self._opSubRegion.Roi.setValue((new_start, new_stop))
  File "...\ilastik\lazyflow\slot.py", line 73, in call_in_setup_context
    return func(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "...\ilastik\lazyflow\slot.py", line 1191, in setValue
    self._changed()
  File "...\ilastik\lazyflow\slot.py", line 1403, in _changed
    self._configureOperator(self)
  File "...\ilastik\lazyflow\slot.py", line 1418, in _configureOperator
    self.operator._setupOutputs()
  File "...\ilastik\lazyflow\operator.py", line 539, in _setupOutputs
    oslot._changed()
  File "...\ilastik\lazyflow\slot.py", line 1396, in _changed
    c._changed()
  File "...\ilastik\lazyflow\slot.py", line 1403, in _changed
    self._configureOperator(self)
  File "...\ilastik\lazyflow\slot.py", line 1418, in _configureOperator
    self.operator._setupOutputs()
  File "...\ilastik\lazyflow\operator.py", line 539, in _setupOutputs
    oslot._changed()
  File "...\ilastik\lazyflow\slot.py", line 1396, in _changed
    c._changed()
  File "...\ilastik\lazyflow\slot.py", line 1403, in _changed
    self._configureOperator(self)
  File "...\ilastik\lazyflow\slot.py", line 1418, in _configureOperator
    self.operator._setupOutputs()
  File "...\ilastik\lazyflow\operator.py", line 539, in _setupOutputs
    oslot._changed()
  File "...\ilastik\lazyflow\slot.py", line 1396, in _changed
    c._changed()
  File "...\ilastik\lazyflow\slot.py", line 1403, in _changed
    self._configureOperator(self)
  File "...\ilastik\lazyflow\slot.py", line 1418, in _configureOperator
    self.operator._setupOutputs()
  File "...\ilastik\lazyflow\operator.py", line 539, in _setupOutputs
    oslot._changed()
  File "...\ilastik\lazyflow\slot.py", line 1396, in _changed
    c._changed()
  File "...\ilastik\lazyflow\slot.py", line 1407, in _changed
    self._sig_changed(self)
  File "...\ilastik\lazyflow\utility\orderedSignal.py", line 82, in __call__
    f(*args, **kw)
  File "...\volumina\volumina\widgets\stackExportFileOptionsWidget.py", line 98, in _updateDescription
    axes = OpStackWriter.get_nonsingleton_axes_for_tagged_shape(tagged_shape)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "...\ilastik\lazyflow\operators\ioOperators\ioOperators.py", line 396, in get_nonsingleton_axes_for_tagged_shape
    filtered_axes = list(zip(*filtered_items))[0]
                    ~~~~~~~~~~~~~~~~~~~~~~~~~~^^^
IndexError: list index out of range

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions