Skip to content

Commit

Permalink
Improve knossos conversion (#271)
Browse files Browse the repository at this point in the history
* make file listing in knossos conversion more precise

* format
  • Loading branch information
philippotto authored Feb 2, 2021
1 parent 54f7bf0 commit 8eb70e6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion wkcuber/convert_knossos.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,9 @@ def convert_knossos(
with get_executor_for_args(args) as executor:
knossos_cubes = list(source_knossos.list_cubes())
if len(knossos_cubes) == 0:
logging.error("No input KNOSSOS cubes found.")
logging.error(
"No input KNOSSOS cubes found. Make sure to pass the path which points to a KNOSSOS magnification (e.g., testdata/knossos/color/1)."
)
exit(1)

knossos_cubes.sort()
Expand Down
2 changes: 1 addition & 1 deletion wkcuber/knossos.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def __get_only_raw_file_path(self, cube_xyz: Tuple[int, ...]) -> Optional[str]:
return raw_files[0] if len(raw_files) > 0 else None

def list_files(self) -> Iterator[str]:
return iglob(path.join(self.root, "**", "*.raw"), recursive=True)
return iglob(path.join(self.root, "*", "*", "*", "*.raw"), recursive=True)

def __parse_cube_file_name(self, filename: str) -> Optional[Tuple[int, int, int]]:
m = CUBE_REGEX.search(filename)
Expand Down

0 comments on commit 8eb70e6

Please sign in to comment.