Commit 0ea8820aee0a177ee2bf667fa15388f4ab64a25c

Authored by Thiago Franco de Moraes
1 parent 523a69ac
Exists in master

When importing non DICOM files the filepath was being used as project name

Showing 1 changed file with 2 additions and 4 deletions   Show diff stats
invesalius/control.py
@@ -872,13 +872,11 @@ class Controller(): @@ -872,13 +872,11 @@ class Controller():
872 def OnOpenOtherFiles(self, filepath): 872 def OnOpenOtherFiles(self, filepath):
873 filepath = utils.decode(filepath, const.FS_ENCODE) 873 filepath = utils.decode(filepath, const.FS_ENCODE)
874 if not(filepath) == None: 874 if not(filepath) == None:
875 - name = filepath.rpartition('\\')[-1].split('.')  
876 - 875 + name = os.path.basename(filepath).split(".")[0]
877 group = oth.ReadOthers(filepath) 876 group = oth.ReadOthers(filepath)
878 -  
879 if group: 877 if group:
880 matrix, matrix_filename = self.OpenOtherFiles(group) 878 matrix, matrix_filename = self.OpenOtherFiles(group)
881 - self.CreateOtherProject(str(name[0]), matrix, matrix_filename) 879 + self.CreateOtherProject(name, matrix, matrix_filename)
882 self.LoadProject() 880 self.LoadProject()
883 Publisher.sendMessage("Enable state project", state=True) 881 Publisher.sendMessage("Enable state project", state=True)
884 else: 882 else: