cd4ddf72426281fc556e980fd9635bfb5b063577,ilastik/applets/layerViewer/opLayerViewer.py,OpLayerViewer,checkConstraints,#OpLayerViewer#,43
Before Change
Example of how to check input data constraints.
if self.RawInput.ready():
numChannels = self.RawInput.meta.getTaggedShape()["c"]
if numChannels != 1:
raise DatasetConstraintError(
"Layer Viewer",
"Raw data must have exactly one channel. " +
"You attempted to add a dataset with {} channels".format( numChannels ) )
if self.OtherInput.ready() and self.RawInput.ready():
rawTaggedShape = self.RawInput.meta.getTaggedShape()
otherTaggedShape = self.OtherInput.meta.getTaggedShape()
rawTaggedShape["c"] = None
After Change
rawTaggedShape["c"] = None
otherTaggedShape["c"] = None
rawTaggedShape["t"] = None
otherTaggedShape["t"] = None
if dict(rawTaggedShape) != dict(otherTaggedShape):
msg = "Raw data and other data must have equal spatial dimensions (different channels are okay).\n"\
"Your datasets have shapes: {} and {}".format( self.RawInput.meta.shape, self.OtherInput.meta.shape )
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 3
Instances Project Name: ilastik/ilastik
Commit Name: cd4ddf72426281fc556e980fd9635bfb5b063577
Time: 2015-03-04
Author: bergs@janelia.hhmi.org
File Name: ilastik/applets/layerViewer/opLayerViewer.py
Class Name: OpLayerViewer
Method Name: checkConstraints
Project Name: ilastik/ilastik
Commit Name: 64099d49ad3f9a7b255044a581e204861b7e0db1
Time: 2015-04-23
Author: bergs@janelia.hhmi.org
File Name: ilastik/applets/layerViewer/opLayerViewer.py
Class Name: OpLayerViewer
Method Name: checkConstraints
Project Name: ilastik/ilastik
Commit Name: 5e5b4d43ba1561468c69c2270b2f61157dc69dd6
Time: 2013-09-18
Author: bergs@janelia.hhmi.org
File Name: ilastik/applets/labeling/labelingGui.py
Class Name: LabelingGui
Method Name: _updateLabelList