Skip to content
Open
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Auxiliary directories
.cache/
.vscode/

# compiled python files
*.pyc
Expand Down
10 changes: 5 additions & 5 deletions pyilastik/ilastik_storage_version_01.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,14 +117,14 @@ def __init__(self, h5_handle, image_path=None, prediction=False,
self.skip_image = skip_image

try:
version = self.f.get('/Input Data/StorageVersion')[()].decode()
version = self.f.get('/Input Data/StorageVersion')[()]
except AttributeError:
# for ilastik release > 1.3.0
version = self.f.get('/Input Data/StorageVersion')[()]
assert version == '0.2'

def ilastik_version(self):
version_str = self.f.get('ilastikVersion')[()].decode()
version_str = self.f.get('ilastikVersion')[()]
return int(version_str.replace('.', '')[:3])

def __iter__(self):
Expand Down Expand Up @@ -164,7 +164,7 @@ def image_path_list(self):

path = self.f.get(
'/Input Data/infos/{lane}/Raw Data/filePath'.format(lane=lane))
path = path[()].decode()
path = path[()]

path_list.append(path)

Expand All @@ -184,7 +184,7 @@ def __getitem__(self, i):
lane = 'lane{:04}'.format(i)
path = f.get(
'/Input Data/infos/{lane}/Raw Data/filePath'.format(lane=lane))
path = path[()].decode()
path = path[()]
original_path = path

prediction = None # TODO
Expand Down Expand Up @@ -419,7 +419,7 @@ def _get_block_slices(self, item_index):
slice_list = []
for block in self._get_blocks(item_index):
slices = re.findall('([0-9]+):([0-9]+)',
block.attrs['blockSlice'].decode('ascii'))
block.attrs['blockSlice'])
slice_list.append(slices)

return np.array(slice_list).astype('int')
Expand Down
2 changes: 1 addition & 1 deletion pyilastik/ilastik_version_05.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def __getitem__(self, i):
f = self.f
dset = f.get('/DataSets/dataItem{:02}'.format(i))

path = utils.basename(dset.attrs['fileName'].decode('ascii'))
path = utils.basename(dset.attrs['fileName'])
img = np.array(dset.get('data')) if not self.skip_image else None
labels = np.array(dset.get('labels/data'))

Expand Down
2 changes: 1 addition & 1 deletion pyilastik/lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def read_project(ilastik_file, image_path=None, prediction=False,
version = f.get('/PixelClassification/StorageVersion')
if version is not None:
try:
version = version[()].decode()
version = version[()]
except AttributeError:
# for ilastik releases >1.3.0
version = version[()]
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from setuptools import setup, find_packages

reqs = ['h5py==2.10.0',
reqs = ['h5py>=2.10.0',
'numpy>=1.12.1',
'docopt>=0.6.2',
'tifffile']
Expand All @@ -14,7 +14,7 @@ def readme():


setup(name='pyilastik',
version='0.0.9',
version='0.1.0',
description='Read ilastik labels in python',
author='Manuel Schoelling, Christoph Moehl',
author_email='manuel.schoelling@dzne.de, christoph.oliver.moehl@gmail.com',
Expand Down