-
Notifications
You must be signed in to change notification settings - Fork 21
Open
Description
vtkIGTLToMRMLImage.cxx:326 (vtkIGTLToMRMLImage::IGTLToMRML), there is a coslty memcpy.
Instead, the pointer on the array could be passed to the vtkImageData array. For example (I did not try, but something like that could work):
switch(imageData->GetDataType())
{
vtkTemplateMacro(static_cast<vtkDataArrayTemplate<VTK_TT>* >(imageData->GetPointData()->GetScalars())->SetVoidArray(imgMsg->GetScalarPointer(), imgMsg->GetSubVolumeImageSize(), /*save*/1);
}
Of course, the array memory should stay valid for as long as the imagedata is around.
See:
http://www.vtk.org/doc/nightly/html/classvtkDataArrayTemplate.html#a5d4281c3356c18a276ae7a8db8ca0c87
https://github.com/Slicer/Slicer/blob/master/Libs/vtkITK/vtkITKArchetypeImageSeriesScalarReader.cxx#L130-L132
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels