devide
devide copied to clipboard
ITKWriter is broken - error about SetFileName
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 [email protected]
on 17 Dec 2009 at 9:55
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 [email protected]
on 17 Dec 2009 at 9:56