Skip to content
This repository has been archived by the owner on Apr 20, 2020. It is now read-only.

accessing default features keys #223

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions lazyflow/operators/ioOperators/opExportToKnime.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import vigra
import numpy
import math
from ilastik.applets.objectExtraction.opObjectExtraction import default_features_key

def write_numpy_structured_array_to_HDF5(fid, internalPath, data, overwrite = False):
"""
Expand Down Expand Up @@ -175,10 +176,10 @@ def write_to_h5(self, table, image_paths, roi):
raw_shape = self.RawImage.meta.getTaggedShape()
nchannels = raw_shape['c']
try:
minxs = table["Default features, Coord<Minimum>_ch_0"].astype(numpy.int32)
minys = table["Default features, Coord<Minimum>_ch_1"].astype(numpy.int32)
maxxs = table["Default features, Coord<Maximum>_ch_0"].astype(numpy.int32)
maxys = table["Default features, Coord<Maximum>_ch_1"].astype(numpy.int32)
minxs = table[default_features_key+", Coord<Minimum>_ch_0"].astype(numpy.int32)
minys = table[default_features_key+", Coord<Minimum>_ch_1"].astype(numpy.int32)
maxxs = table[default_features_key+", Coord<Maximum>_ch_0"].astype(numpy.int32)
maxys = table[default_features_key+", Coord<Maximum>_ch_1"].astype(numpy.int32)
time_values = table["Time"].astype(numpy.int32)
except ValueError:
logger.info("Object bounding boxes are not passed as features. Object images will not be saved")
Expand All @@ -187,8 +188,8 @@ def write_to_h5(self, table, image_paths, roi):
image_paths["labels"][i] = ""
else:
try:
minzs = table["Default features, Coord<Minimum>_ch_2"].astype(numpy.int32)
maxzs = table["Default features, Coord<Maximum>_ch_2"].astype(numpy.int32)
minzs = table[default_features_key+", Coord<Minimum>_ch_2"].astype(numpy.int32)
maxzs = table[default_features_key+", Coord<Maximum>_ch_2"].astype(numpy.int32)
except ValueError:
minzs = None
maxzs = None
Expand Down