Closed pieper closed 6 years ago
Calling Allocate on a vtkDoubleArray resets the number of tuples, leading to the error message below when trying to insert.
This fix uses SetNumberOfTuples, which also does the allocation to for the correct number of tuples.
Traceback (most recent call last): File "/private/tmp/Slicer.app/Contents/lib/Slicer-4.9/qt-scripted-modules/MultiVolumeImporter.py", line 191, in onImportButtonClicked self.read4DNIfTI(mvNode, niftiFiles[0]) File "/private/tmp/Slicer.app/Contents/lib/Slicer-4.9/qt-scripted-modules/MultiVolumeImporter.py", line 357, in read4DNIfTI volumeLabels.SetComponent(i, 0, frameId) ValueError: expects 0 <= tupleIdx && tupleIdx < GetNumberOfTuples()
See:
https://www.vtk.org/doc/nightly/html/classvtkAbstractArray.html#a4d40ec8fbe0eb6c0752ca7890af1ba33
Calling Allocate on a vtkDoubleArray resets the number of tuples, leading to the error message below when trying to insert.
This fix uses SetNumberOfTuples, which also does the allocation to for the correct number of tuples.
Traceback (most recent call last): File "/private/tmp/Slicer.app/Contents/lib/Slicer-4.9/qt-scripted-modules/MultiVolumeImporter.py", line 191, in onImportButtonClicked self.read4DNIfTI(mvNode, niftiFiles[0]) File "/private/tmp/Slicer.app/Contents/lib/Slicer-4.9/qt-scripted-modules/MultiVolumeImporter.py", line 357, in read4DNIfTI volumeLabels.SetComponent(i, 0, frameId) ValueError: expects 0 <= tupleIdx && tupleIdx < GetNumberOfTuples()
See:
https://www.vtk.org/doc/nightly/html/classvtkAbstractArray.html#a4d40ec8fbe0eb6c0752ca7890af1ba33