Skip to content

Commit

Permalink
Merge pull request #43 from OmooLab/feature/dev
Browse files Browse the repository at this point in the history
fix: cannot decode utf-8 issue
  • Loading branch information
icrdr authored Sep 11, 2024
2 parents 48700b3 + 80da400 commit e384798
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
4 changes: 2 additions & 2 deletions bioxelnodes/assets/Nodes/BioxelNodes_v1.0.0.blend
Git LFS file not shown
4 changes: 3 additions & 1 deletion bioxelnodes/bioxel/parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ def get_ext(filepath: Path) -> str:
elif filepath.name.endswith(".map.gz"):
return ".map.gz"
else:
return filepath.suffix
suffix = filepath.suffix
return "" if len(suffix) > 5 else suffix


def get_filename(filepath: Path):
Expand Down Expand Up @@ -310,6 +311,7 @@ def parse_volumetric_data(data_file: str, series_id="", progress_callback=None):
def get_meta(key):
try:
stirng = reader.GetMetaData(0, key).removesuffix(" ")
stirng.encode('utf-8')
if stirng in ["No study description",
"No series description",
""]:
Expand Down
11 changes: 7 additions & 4 deletions bioxelnodes/operators/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,7 @@ def invoke(self, context, event):
def get_meta(key):
try:
stirng = single.GetMetaData(key).removesuffix(" ")
stirng.encode('utf-8')
if stirng in ["No study description",
"No series description",
""]:
Expand All @@ -416,13 +417,15 @@ def get_meta(key):
if series_id == "":
series_id = "empty"

series_items[series_id] = "{:<20} {:>1}".format(f"{study_description}>{series_description}({series_modality})",
label = "{:<20} {:>1}".format(f"{study_description}>{series_description}({series_modality})",
f"({size_x}x{size_y})x{count}")

series_items[series_id] = label

for key, value in series_items.items():
for series_id, label in series_items.items():
series_item = self.series_ids.add()
series_item.id = key
series_item.label = value
series_item.id = series_id
series_item.label = label

if len(series_items.keys()) > 1:
self.skip_series_select = False
Expand Down

0 comments on commit e384798

Please sign in to comment.