def from_h5_group(cls, data: h5py.Group, params: Dict = None): params = params or {} params.update({"allowLabels": data["allowLabels"][()], "nickname": data["nickname"][()].decode("utf-8")}) if "axistags" in data: params["axistags"] = AxisTags.fromJSON(data["axistags"][()].decode("utf-8")) elif "axisorder" in data: # legacy support axisorder = data["axisorder"][()].decode("utf-8") params["axistags"] = vigra.defaultAxistags(axisorder) if "subvolume_roi" in data: params["subvolume_roi"] = tuple(data["subvolume_roi"][()]) if "normalizeDisplay" in data: params["normalizeDisplay"] = bool(data["normalizeDisplay"][()]) if "drange" in data: params["drange"] = tuple(data["drange"]) if "display_mode" in data: params["display_mode"] = data["display_mode"][()].decode("utf-8") return cls(**params)
def actual_axistags(axistags, shape): return AxisTags([axistags[j] for j, s in enumerate(shape) if s > 1])