fvpolpeta / devide

Automatically exported from code.google.com/p/devide
BSD 3-Clause "New" or "Revised" License
2 stars 1 forks source link

ITKWriter is broken - error about SetFileName #161

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Load dataset, I used http://pubimage.hcuge.ch:8080/DATA/MAGIX.zip
2. Use vtktoitk to convert
3. Use ITKWriter to save in Analyze format (meep.hdr) (other formats don't 
seem to work either)

What is the expected output? What do you see instead?
Expected file to be saved in the specified format. Instead, an error 
message is shown:

Unable to execute part 0 of module dvm3 (ITKWriter): invalid null reference 
in method 'itkImageFileWriterIF3_SetFileName', argument 2 of type 
'std::string const &'

Log:
10:34:19: Traceback (most recent call last): 
10:34:19:   File "C:\Program Files\DeVIDE-
RE\devide\interfaces\wx_interface\graph_editor.py", line 567, in 
_execute_modules     
self._devide_app.network_manager.execute_network(allMetaModules) 
10:34:19:   File "C:\Program Files\DeVIDE-RE\devide\network_manager.py", 
line 46, in execute_network     
self._devide_app.scheduler.execute_modules(sms) 
10:34:19:   File "C:\Program Files\DeVIDE-RE\devide\scheduler.py", line 
698, in execute_modules     
self.get_scheduler().execute_modules(scheduler_modules) 
10:34:19:   File "C:\Program Files\DeVIDE-RE\devide\scheduler.py", line 
569, in execute_modules     mm.execute_module(sm.meta_module, sm.part) 
10:34:19:   File "C:\Program Files\DeVIDE-RE\devide\module_manager.py", 
line 848, in execute_module     meta_module.execute_module(part, streaming) 
10:34:19:   File "C:\Program Files\DeVIDE-RE\devide\meta_module.py", line 
358, in execute_module     self.instance.execute_module() 
10:34:19:   File "C:\Program Files\DeVIDE-
RE\devide\modules\insight\ITKWriter.py", line 123, in execute_module     
self._writer.SetFileName(self._config.filename) 
10:34:19: ModuleManagerException: Unable to execute part 0 of module dvm3 
(ITKWriter): invalid null reference in method 
'itkImageFileWriterIF3_SetFileName', argument 2 of type 'std::string const 
&' 
10:34:19: Unable to execute part 0 of module dvm3 (ITKWriter): invalid null 
reference in method 'itkImageFileWriterIF3_SetFileName', argument 2 of type 
'std::string const &'

Introspecting reveals that obj._config.filename is a unicode string, while 
obj._writer.SetFileName only accepts normal strings. 

Changing line 123 of ITKWriter.py to:
self._writer.SetFileName(str(self._config.filename))
fixes the issue. 

Original issue reported on code.google.com by stef.bus...@gmail.com on 17 Dec 2009 at 9:55

GoogleCodeExporter commented 9 years ago
Using the Analyze file format still doesn't work, however, and displays a 
somewhat 
cryptic error in a vtkOutputWindow: "AnalyzeImageIO (0CDF90F8): ERROR: Analyze 
7.5 
File Format Only Allows RPI, PIR, and RIP Orientation". I'm not sure if this is 
a bug, 
or how this should be solved.

Other formats like .mha work fine with the patch applied.

Original comment by stef.bus...@gmail.com on 17 Dec 2009 at 9:56