View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0003923 | Slicer4 | Core: Base Code | public | 2014-12-19 08:28 | 2018-03-02 11:02 |
Reporter | pohl | Assigned To | jcfr | ||
Priority | normal | Severity | major | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Product Version | Slicer 4.4.0 | ||||
Target Version | Fixed in Version | Slicer 4.7.0 | |||
Summary | 0003923: AddArchetypeScalarVolume fails when running through Slicer --launch | ||||
Description | Executing AddArchetypeScalarVolume in a python script invoked through --launch fails even tough it works fine when running it through the python shell provided by Slicer ERROR: In /software/Slicer4/trunk/Libs/MRML/Core/vtkMRMLVolumeArchetypeStorageNode.cxx, line 367 | ||||
Steps To Reproduce |
and then enter modules = ('os', 'sys', 'vtk', 'qt', 'slicer','vtkSlicerVolumesModuleLogic') for m in modules: mrmlScene = slicer.vtkMRMLScene() volumesLogic.AddArchetypeScalarVolume('./share/Slicer-4.4/qt-loadable-modules/EMSegment/Testing/TestData/MRI-Human-Brain/small_atlas_t1_stripped.nrrd', 'Image', 0, None) | ||||
Additional Information | this worked in Slicer 4.2.2 | ||||
Tags | No tags attached. | ||||
Since r23915, VTK module can be imported and example can be simplified. It is not needed to explicitly updated the PYTHONPATH. For reference: //-------------- This commit update launcher settings associated with VTKv6 project so that ./Slicer --launch python -c 'import vtk' |
|
Here is the solution: (1) Apply the last commit associated with this branch: https://github.com/jcfr/Slicer/tree/3923-allow-registration-of-itk-factory-from-python (2) Update your snipped to set ITK_AUTOLOAD_PATH and register the factory using ctypes Updated example: SLICERSUPER=/software/Slicer4/superbuild .. and the code to copy in the CTK python shell: 8<----8<----8<----8<----8<----8<----8<----8<----8<----8<----8<----8<---- modules = ('os', 'sys', 'vtk', 'slicer', 'vtkSlicerVolumesModuleLogic') for m in modules: mrmlScene = slicer.vtkMRMLScene() volumesLogic.AddArchetypeScalarVolume('./share/Slicer-4.4/qt-loadable-modules/EMSegment/Testing/TestData/MRI-Human-Brain/small_atlas_t1_stripped.nrrd', 'Image', 0, None) |
|
@Kilian: Let me know if the solution discuss in http://www.na-mic.org/Bug/view.php?id=3923#c13353 works for you. Thanks |
|
I think it worked - I am just not sure if the following warning messgae is ok or not : cannot import name _qSlicerCoreApplicationInstance Here is what I dud :
|
|
The message is expected for now. It should be possible to tweak Slicer to avoid it. |
|
Many things have changed since the problem was reported, but this works fine now: Slicer.exe --no-main-window --show-python-interactor |
|
Date Modified | Username | Field | Change |
---|---|---|---|
2014-12-19 08:28 | pohl | New Issue | |
2014-12-19 08:28 | pohl | Status | new => assigned |
2014-12-19 08:28 | pohl | Assigned To | => jcfr |
2015-10-06 21:00 | jcfr | Note Added: 0013352 | |
2015-10-06 22:40 | jcfr | Note Added: 0013353 | |
2015-10-06 22:40 | jcfr | Note Edited: 0013353 | |
2015-10-06 22:41 | jcfr | Note Edited: 0013353 | |
2015-10-06 22:41 | jcfr | Status | assigned => feedback |
2015-10-06 22:42 | jcfr | Note Added: 0013354 | |
2015-10-14 12:21 | pohl | Note Added: 0013386 | |
2015-10-27 10:28 | jcfr | Status | feedback => acknowledged |
2015-10-27 10:28 | jcfr | Target Version | Slicer 4.5.0-1 => |
2015-10-27 10:28 | jcfr | Note Added: 0013431 | |
2017-07-25 22:54 | lassoan | Status | acknowledged => resolved |
2017-07-25 22:54 | lassoan | Resolution | open => fixed |
2017-07-25 22:54 | lassoan | Fixed in Version | => Slicer 4.7.0 |
2017-07-25 22:54 | lassoan | Note Added: 0014987 | |
2017-07-25 22:54 | lassoan | Note Edited: 0014987 | View Revisions |
2018-03-02 11:02 | jcfr | Status | resolved => closed |