def get_output_data(self, data_nr): """Returns the dataset that was produced by ilastik. :param data_nr: number of dataset :return: output dataset of ilastik """ return vigra.readHDF5(self._get_output_data_path(data_nr), const.default_export_key())
def merge_output_into_dataset(self, data_nr, n=0): """Merges the ilastik output in the dataset. The first n channels of the dataset are left unchanged. It is assumed, that extend_data_tzyxc() has been called, so the channels are in the last dimension. :param data_nr: number of dataset :param n: number of channels that are left unchanged """ filepath = self.get_data_path(data_nr) h5key = self.get_data_key(data_nr) filepath_out = self._get_output_data_path(data_nr) h5key_out = const.default_export_key() merge_datasets(filepath, h5key, filepath_out, h5key_out, n=n, compression=self._compression)
def get_data_key(self, data_nr): """Returns the h5 key of the dataset. :param data_nr: number of dataset :return: key of the dataset inside its h5 file :rtype: str """ if self.is_internal(data_nr): dataset_id = self.get_dataset_id(data_nr) data_key = const.localdataset(dataset_id) else: if self._datatype(data_nr) != "hdf5": return const.default_export_key() h5_key = const.filepath(data_nr) data_path = vigra.readHDF5(self.project_filename, h5_key) data_key = os.path.basename(data_path) return data_key