View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0004206 | Slicer4 | Core: Scripting (Wrapping, Python) | public | 2016-06-08 23:55 | 2018-03-02 11:06 |
Reporter | jcfr | Assigned To | hastings.greer | ||
Priority | normal | Severity | feature | Reproducibility | N/A |
Status | closed | Resolution | fixed | ||
Product Version | |||||
Target Version | Slicer 4.6.0 | Fixed in Version | Slicer 4.6.0 | ||
Summary | 0004206: Scripting: Support use of vtkCollection, and vtkArray as iterable | ||||
Description | There are currently no way to do: for node in slicer.mrmlScene.GetNodes(): Or more generally, any method returning a vtkCollection or vtkArray (e.g vtkStringArray) can't be treated as a python iterable. The good news is that the feature has been integrated in upstream VTK: It will be available in Slicer either after updating Slicer/VTK (either by cherry-picking the change or creating a new branch based on VTK master). | ||||
Tags | No tags attached. | ||||
A distinction should be made between the vtkArray class tree which includes vtkSparseArray<T> and vtkDenseArray<T>, and the vtkAbstractArray class tree which includes vtkStringArray, vtkIntArray, vtkFloatArray etc. Confusingly, vtkArrayIterator objects iterate through vtkAbstractArrays, while vtkArrays have no existing iteration protocol. |
|
The implementation of iterable in the vtk master branch depends on many changes in the wrapping implementation made between slicer's version of vtk and the nightly build of vtk. Cherry picking won't be possible. |
|
Since the version of VTK used in Slicer has been updated, I am resolving. |
|
Date Modified | Username | Field | Change |
---|---|---|---|
2016-06-08 23:55 | jcfr | New Issue | |
2016-06-08 23:55 | jcfr | Status | new => assigned |
2016-06-08 23:55 | jcfr | Assigned To | => hastings.greer |
2016-06-09 10:19 | hastings.greer | Note Added: 0013965 | |
2016-06-09 13:06 | hastings.greer | Note Added: 0013966 | |
2016-10-12 03:17 | jcfr | Note Added: 0014160 | |
2016-10-12 03:17 | jcfr | Status | assigned => resolved |
2016-10-12 03:17 | jcfr | Fixed in Version | => Slicer 4.6.0 |
2016-10-12 03:17 | jcfr | Resolution | open => fixed |
2018-03-02 11:06 | jcfr | Status | resolved => closed |