Skip to content
Snippets Groups Projects
Commit 562e173f authored by Christian Kento Rasmussen's avatar Christian Kento Rasmussen
Browse files

Fix path correction for .vgi metadata file

parent eb6e6bea
Branches
No related tags found
2 merge requests!45Save files function,!44Load vol files
...@@ -342,11 +342,15 @@ class DataLoader: ...@@ -342,11 +342,15 @@ class DataLoader:
Args: Args:
path (str): The path to the VGI file. path (str): The path to the VGI file.
returns:
numpy.ndarray or tuple: The loaded volume.
If 'self.return_metadata' is True, returns a tuple (volume, metadata).
""" """
# makes sure path point to .VGI metadata file and not the .VOL file # makes sure path point to .VGI metadata file and not the .VOL file
if path.endswith(".vol") and os.path.isfile(path.replace(".vol",".vgi")): if path.endswith(".vol") and os.path.isfile(path.replace(".vol",".vgi")):
path = path.replace(".vol",".vgi") path = path.replace(".vol",".vgi")
print("WARNING: Corrected path to .vgi metadata file from .vol file") log.warning("Corrected path to .vgi metadata file from .vol file")
meta_data = self._load_vgi_metadata(path) meta_data = self._load_vgi_metadata(path)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment